Model Railroad System
2.2.1
Model RR signals with an Arduino
|
SignalDriverMax72xx is a Snit type (OO class) that implements the host interface to the SignalDriverMax72xx program running on an Arduino. More...
Public Member Functions | |
SignalDriverMax72xx (name,...) | |
Constructor: open the port, configure it, set a readable file event, and prime the port. More... | |
dark () | |
Method to turn off all LEDs. More... | |
set (signo, aspect) | |
Method to set the aspect for one signal. More... | |
~SignalDriverMax72xx () | |
Destructor: close the port. More... | |
Static Public Member Functions | |
static | validate (object) |
Type validation typemethod. More... | |
Private Member Functions | |
_ReadPort () | |
Method to gobble from the Arduino. More... | |
Private Attributes | |
portfd | |
Variable to hold the port fd. More... | |
_ready | |
Variable to hold ready (for a command) state. More... | |
Static Private Attributes | |
static | validateaspects |
Validation type for aspects. More... | |
static | validatesignalnums |
Validation type for signal numbers. More... | |
SignalDriverMax72xx is a Snit type (OO class) that implements the host interface to the SignalDriverMax72xx program running on an Arduino.
It provides an abstraction of the serial port interface that controls signals multiplexed by the MAX72xx chip. This version assumes a that there is only one SignalDriverMax72xx driver boards (1 to 8 signals, numbered 0 through 7) connected to the Arduino. This version assumes that only these aspects are valid (case folded):
g_r (Green over Red – Clear) y_r (Yellow over Red – Approach) r_r (Red over Red – [Absolute] Stop) r_g (Red over Green – Slow Clear) r_y (Red over Yellow – Approach Limited) dark (all lights off)
Definition at line 19 of file SignalDriverMax72xx_Host.tcl.
SignalDriverMax72xx::SignalDriverMax72xx | ( | name | , |
... | |||
) |
Constructor: open the port, configure it, set a readable file event, and prime the port.
name | The name of the object to be created. |
... | Options:
|
SignalDriverMax72xx::~SignalDriverMax72xx | ( | ) |
Destructor: close the port.
|
private |
Method to gobble from the Arduino.
SignalDriverMax72xx::dark | ( | ) |
Method to turn off all LEDs.
SignalDriverMax72xx::set | ( | signo | , |
aspect | |||
) |
Method to set the aspect for one signal.
signo | Signal number |
aspect | The desired aspect |
|
static |
Type validation typemethod.
object | An object to be validated. |
|
private |
Variable to hold ready (for a command) state.
Definition at line 51 of file SignalDriverMax72xx_Host.tcl.
|
private |
Variable to hold the port fd.
Definition at line 38 of file SignalDriverMax72xx_Host.tcl.
|
staticprivate |
Validation type for aspects.
Definition at line 24 of file SignalDriverMax72xx_Host.tcl.
|
staticprivate |
Validation type for signal numbers.
Definition at line 28 of file SignalDriverMax72xx_Host.tcl.