Model Railroad System 2.2.2
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ctiacela::CTIAcela Class Reference

Main CTIAcela interface class. More...

Public Member Functions

 CTIAcela (name, port,...)
 Constructor: open a connection to the CTI Acela. More...
 
 ~CTIAcela ()
 The destructor restores the serial port's state and closes it. More...
 
 HaveData ()
 
 OnlineP ()
 
 Activate (address)
 Activate a control. More...
 
 Deactive (address)
 Deactive a control. More...
 
 PulseOn (address, pulsewidth)
 Pulse On a control. More...
 
 PulseOff (address, pulsewidth)
 Pulse Off a control. More...
 
 Blink (address, pulsewidth)
 Blink a control. More...
 
 ReverseBlink (address, pulsewidth)
 Reverse Blink a control. More...
 
 Control4 (address, c1, c2, c3, c4)
 Configure 4 controls simultaneously. More...
 
 Control8 (address, c1, c2, c3, c4, c5, c6, c7, c8)
 Configure 8 controls simultaneously. More...
 
 Control16 (address, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16)
 Configure 16 controls simultaneously. More...
 
 Throttle (address, speed, momentum, brake, direction, idle)
 Throttle command. More...
 
 EmergencyStop ()
 Emergency Stop. More...
 
 Signal2 (address, lamp1, lamp2, yellow="off")
 Control 2-lamp signals. More...
 
 Signal3 (address, lamp1, lamp2, lamp3)
 Control 3-lamp signals. More...
 
 Signal4 (address, lamp1, lamp2, lamp3, lamp4)
 Control 4-lamp signals. More...
 
 SignalSettings (blinkrate, yellowhue)
 Set Signal Settings. More...
 
 SignalBrightness (brightness)
 Set signal brightness. More...
 
 ConfigureSensor (address, threshold, select, polarity)
 Configure a sensor. More...
 
 Read (address)
 Read the state of a sensor. More...
 
 Read4 (address)
 Read the state of four sensors. More...
 
 Read8 (address)
 Read the state of eight sensors. More...
 
 Read16 (address)
 Read the state of sixteen sensors. More...
 
 ReadAll ()
 Read all sensors. More...
 
 SRQControl (enable="yes")
 Enable or disable SRQ messages. More...
 
 Query ()
 Query sensor change state. More...
 
 ResetNetwork ()
 Reset the network. More...
 
 NetworkOnline ()
 Bring the network online. More...
 
 NetworkOffline ()
 Bring the network offline. More...
 
 Poll ()
 Poll the network configuration. More...
 
 ReadRevision ()
 Read CTI Acela firmware revision. More...
 

Static Public Member Functions

static validate (object)
 Type validation method. More...
 

Private Member Functions

 _handleSRQ ()
 Handle a service request. More...
 
 _transmit (buffer, responsebytes=0)
 Transmit buffer and wait for response. More...
 
 _readevent ()
 Read event method. More...
 
 _readbyte (thebytevar)
 Read a single byte from the serial interface. More...
 

Static Private Member Functions

static highbyte (addr)
 Return the high byte of address. More...
 
static lowbyte (addr)
 Return the low byte of address. More...
 
static pack4 (b1, b2, b3, b4)
 pack 4 bits More...
 
static pack8 (b1, b2, b3, b4, b5, b6, b7, b8)
 pack 4 bits More...
 

Private Attributes

 ttyfd
 Terminal file descriptor. More...
 
 dataavailable
 Flag set to true (yes) when sensor data is available. More...
 
 networkonline
 Flag set to false (no) when the network goes offline. More...
 
 _timeout
 Timeout flag. More...
 

Static Private Attributes

static Responses
 Responses. More...
 
static Opcodes
 Opcodes. More...
 
static LampBits
 Lamp Bits. More...
 
static FilterSelectBits
 Filter Select Bits. More...
 
static CTI_DeviceMap
 CTI Module Map. More...
 
static maxtries
 Loop control for read attempts. More...
 

Detailed Description

Main CTIAcela interface class.

Parameters
nameName of the CTIAcela interface instance.
portName of the serial port connected to the CTI Acela. Either something like /dev/ttySN for real serial ports or /dev/ttyACM0 for a USB connected Acela.
Author
Robert Heller <heller@deepsoft.com>