Public Member Functions | Public Attributes
cpphlib.PPKMREHANDLER Class Reference

Rotary encoder and matrix keyboard handler. More...

List of all members.

Public Member Functions

def __init__
 Documentation for method.
def stop
def clearstatevalues
def chekinchannelschanges
 Documentation for method.
def inputevent
 Documentation for method.
def getvalue
 Documentation for method.

Public Attributes

 CAEIF
 IOIF
 Addr
 PrevData
 PreREOV
 EventAction
 EventData
 BM
 IOCG
 OA
 SM

Detailed Description

Rotary encoder and matrix keyboard handler.

This class helps to make reading rotary encoder, and matrix keyboard easyer. It's eventhandler reminds if rotary encoder is turning, button of the encoder is being pushed, or released, or any key is being pushed on the matrix keyboard. A statemachine is handling the rotary encoder. The statemachine is running in a standalone thread, so if you create an instance from this class, you need to call the stop method before quitting the control program, otherwise the main thread dies, and the state machine stucks in.


Constructor & Destructor Documentation

def cpphlib.PPKMREHANDLER.__init__ (   self,
  CAEIF,
  IOIF,
  CardAddress 
)

Documentation for method.

Constructs PPKMREHANDLER class.

Parameters:
CAEIFCAE interface instance is already connected to ppds.
IOIFIO interface instance is already connected to ppds.
CardAddressAddress of the keymatrix and rotary encoder driver card.

Short description: Constructs PPKMREHANDLER class

Member Function Documentation

def cpphlib.PPKMREHANDLER.chekinchannelschanges (   self,
  MasterOrFwdData 
)

Documentation for method.

It checks input channel changes. All PP eventhandler classes has method like this. Only one reading method can handle incoming data, because only one clientsocket can be connected to the ppds IO interface. Due to this, a master one, which reads out the receive queue in the working loop, and the processes incoming data is required to have in the case of using more than one eventhandler. After processing the master passes raw data to the next eventhandlers. This way all data will be processed. If the chekinchannelschanges method is called as master, then it always reads out the receivequeue of the IO interface. The master checkinchannelschanges must run first. All the other eventhandlers must receive the data read by the first after each-other, in consequence.

Parameters:
MasterOrFwdDataIt can be the "MASTER", or forwarded input data.

Short description: 052
Short description: Setting variables describing the state of the rotary encoder to default state
def cpphlib.PPKMREHANDLER.getvalue (   self,
  EventDataName 
)

Documentation for method.

It reads the actual value belonging to the defined event

Parameters:
EventDataNameThe name of the data belonging to the certain event. Its value can be "KEYCODE" or "REVALUE".
Short description: It reads the actual value belonging to the defined event
def cpphlib.PPKMREHANDLER.inputevent (   self,
  EventName 
)

Documentation for method.

It is eventhandler of PPKMREHANDLER. Its return value is True in following event cases : "MXKEYBDCLICK" if key is pushed on the keyboard, "REBTNPUSH" if rotary encoder's butthon is pushed, "REBTNRELEASE" if rotary endoder's button is released, "REVALUECHANGE" if position value of the rotary endoder is changed. In case of "MXKEYBDCLICK" and "REVALUECHANGE" the getvalue method is to get the actual value.

Parameters:
EventNameThe name of the event

Short description: Returns true if any event happened
Short description: Stopping the statemachine of the class

The documentation for this class was generated from the following file: