Gizmod::GizmoPowermate Class Reference

Powermate Gizmo. More...

#include <GizmoPowermate.hpp>

Inheritance diagram for Gizmod::GizmoPowermate:

Inheritance graph
[legend]
Collaboration diagram for Gizmod::GizmoPowermate:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void changeLEDState (int StaticBrightness, int PulseSpeed, int PulseTable, int PulseAsleep, int PulseAwake)
 Directly send a raw event code to the Powermate.
unsigned char getLED ()
 Get the Powermate's LED value.
float getLEDPercent ()
 Get the Powermate's LED value as a percentage.
bool getLEDPulseAsleep ()
 Get pulse while sleeping.
bool getRotated ()
 Has the dial rotated since last press?
virtual std::string getType ()
 Get the type of the Gizmo.
virtual bool processEvent (GizmoEvent *pEvent)
 Process an event.
void pulseLED (int Level, int PulseSpeed, int PulseTable)
 Set the pulsing state of the LED.
void setLED (unsigned char Level)
 Set the LED intensity.
void setLEDPercent (float Percent)
 Set the LED intensity as a percentage.
void setLEDPulseAsleep (bool Enabled)
 Pulse while sleeping.
void setRotateSensitivity (int TicksPerEvent)
 Set the rotate sensitivity in wheel ticks per generated event (default 1).
 GizmoPowermate ()
 Set the rotate sensitivity in wheel ticks per generated event (default 1).
 GizmoPowermate (const H::DeviceInfo &deviceInfo, int DeviceID, int DeviceClassID)
 Default Constructor.
virtual ~GizmoPowermate ()
 Destructor.

Protected Attributes

unsigned long mClickTimer
 Time of last button press.
unsigned char mLevel
 Current intensity level of the LED.
bool mPulseAsleep
 Pulse when going to sleep.
int mRotateCurDir
 Rotation sensitivity direction keeper.
int mRotateCurTick
 Rotation sensitivity counter.
bool mRotated
 Has the dial rotated since last click.
int mRotateTicksPerEvent
 Rotation sensitivity.

Friends

class boost::serialization::access


Detailed Description

Powermate Gizmo.

This class contains all of the helper functions for making use of the Powermate

Definition at line 62 of file GizmoPowermate.hpp.


Constructor & Destructor Documentation

GizmoPowermate::GizmoPowermate (  ) 

Set the rotate sensitivity in wheel ticks per generated event (default 1).

GizmoPowermate Serialize Constructor.

Serialize Constructor

Definition at line 71 of file GizmoPowermate.cpp.

References mPulseAsleep, mRotateCurDir, mRotateCurTick, mRotated, and mRotateTicksPerEvent.

GizmoPowermate::GizmoPowermate ( const H::DeviceInfo deviceInfo,
int  DeviceID,
int  DeviceClassID 
)

Default Constructor.

GizmoPowermate Default Constructor.

Definition at line 60 of file GizmoPowermate.cpp.

References mPulseAsleep, mRotateCurDir, mRotateCurTick, mRotated, and mRotateTicksPerEvent.

GizmoPowermate::~GizmoPowermate (  )  [virtual]

Destructor.

GizmoPowermate Destructor.

Definition at line 82 of file GizmoPowermate.cpp.


Member Function Documentation

void GizmoPowermate::changeLEDState ( int  StaticBrightness,
int  PulseSpeed,
int  PulseTable,
int  PulseAsleep,
int  PulseAwake 
)

Directly send a raw event code to the Powermate.

Change the state of the Powermate's LED.

Parameters:
StaticBrightness Brightness level of LED
PulseSpeed Pulse speed of the LED
PulseTable Pulse type of LED
PulseAsleep Pulse while asleep
PulseAwake Pulse while awake
This function is what sends raw event codes to the Powermate All other functions use this as their base, as this function encompasses the complete functionality of the Powermate.

Definition at line 101 of file GizmoPowermate.cpp.

References cdbg, H::DeviceInfo::FileDescriptor, and Gizmod::GizmoLinuxInputDevice::mDeviceInfo.

Referenced by pulseLED(), and setLED().

unsigned char GizmoPowermate::getLED (  ) 

Get the Powermate's LED value.

Get the Powermate's LED Value.

Returns:
LED value (0-255)

Definition at line 130 of file GizmoPowermate.cpp.

References mLevel.

float GizmoPowermate::getLEDPercent (  ) 

Get the Powermate's LED value as a percentage.

Get the Powermate's LED Value as a percentage.

Returns:
LED value (0.0-100.0)

Definition at line 138 of file GizmoPowermate.cpp.

References mLevel.

bool GizmoPowermate::getLEDPulseAsleep (  ) 

Get pulse while sleeping.

Returns:
True if the powermate will pulse when it goes to sleep

Definition at line 146 of file GizmoPowermate.cpp.

References mPulseAsleep.

bool GizmoPowermate::getRotated (  ) 

Has the dial rotated since last press?

Get whether or not the dial has rotated since the last button event.

Returns:
True if the dial has moved

Definition at line 162 of file GizmoPowermate.cpp.

References mRotated.

std::string GizmoPowermate::getType (  )  [virtual]

Get the type of the Gizmo.

Get the type of this Gizmo.

Returns:
Type of the Gizmo

Reimplemented from Gizmod::Gizmo.

Definition at line 154 of file GizmoPowermate.cpp.

References GIZMO_POWERMATE_TYPE.

bool GizmoPowermate::processEvent ( GizmoEvent pEvent  )  [virtual]

Process an event.

Parameters:
pEvent The event to process
Returns:
True on if the event should get passed on to the script

Reimplemented from Gizmod::Gizmo.

Definition at line 171 of file GizmoPowermate.cpp.

References Gizmod::GizmoEventPowermate::ClickTime, Gizmod::GizmoLinuxInputEvent::Code, mClickTimer, mRotateCurDir, mRotateCurTick, mRotated, mRotateTicksPerEvent, Gizmod::GizmoLinuxInputDevice::processEvent(), Gizmod::Gizmo::setKeyState(), Gizmod::GizmoLinuxInputEvent::Type, and Gizmod::GizmoLinuxInputEvent::Value.

void GizmoPowermate::pulseLED ( int  Level,
int  PulseSpeed,
int  PulseTable 
)

Set the pulsing state of the LED.

Set the hardware pulsing state of the Powermate's LED.

Parameters:
Level The Level of the Pulsing (255 is a good value)
PulseSpeed Speed of the pulsing (255-270 are good values)
PulseTable Type of the pulsing

Definition at line 209 of file GizmoPowermate.cpp.

References cdbg2, and changeLEDState().

void GizmoPowermate::setLED ( unsigned char  Level  ) 

Set the LED intensity.

Set the intensity of the Powermate's LED.

Parameters:
Level of intensity from 0 - 255

Definition at line 218 of file GizmoPowermate.cpp.

References changeLEDState(), mLevel, and mPulseAsleep.

Referenced by setLEDPercent().

void GizmoPowermate::setLEDPercent ( float  Percent  ) 

Set the LED intensity as a percentage.

Set the intensity of the Powermate's LED as a percentage.

Parameters:
Percent The intensity of the powermate as a range between 0.0 and 100.0

Definition at line 229 of file GizmoPowermate.cpp.

References mLevel, and setLED().

void GizmoPowermate::setLEDPulseAsleep ( bool  Enabled  ) 

Pulse while sleeping.

Set LED pulse while sleeping.

Parameters:
Enabled Set to true if the powermate should pulse when it goes to sleep

Definition at line 244 of file GizmoPowermate.cpp.

References mPulseAsleep.

void GizmoPowermate::setRotateSensitivity ( int  TicksPerEvent  ) 

Set the rotate sensitivity in wheel ticks per generated event (default 1).

Parameters:
TicksPerEvent The number of ticks required to generate an event

Definition at line 252 of file GizmoPowermate.cpp.

References cdbg, and mRotateTicksPerEvent.


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:08 2007 for gizmod by  doxygen 1.5.3