Model Railroad System
2.2.2
|
Switch (turnout) operation using a Chubb SMINI board and a Circuits4Tracks Quad OD for OS detection. More...
Public Member Functions | |
C4TSMINI_Switch (name,...) | |
Constructor: initialize the switch object. More... | |
occupiedp () | |
The occupiedp method returns yes or no (true or false) indicating block (OS) occupation. More... | |
pointstate () | |
The pointstate method returns normal if the points are aligned to the main route and reverse if the points are aligned to the divergent route. More... | |
motor (route) | |
The motor method sets the switch motor to align the points for the specificed route. More... | |
propagate (aspect, from,...) | |
Method used to propagate distant signal states back down the line. More... | |
Static Public Member Functions | |
static | validate (object) |
Type validating code Raises an error if object is not either the empty string or a SR4_C4TSR4_Switch type. More... | |
Protected Member Functions | |
_entering () | |
Code to run when just entering the OS Sets the signal aspects and propagates signal state. More... | |
_exiting () | |
Code to run when about to exit the OS. More... | |
Private Member Functions | |
_settruedirection (option, value) | |
A method to fake direction for frog facing switches. More... | |
_gettruedirection (option) | |
A method to fake direction for frog facing switches. More... | |
Private Attributes | |
node | |
SMINI node object. More... | |
isoccupied | |
Saved occupation state. More... | |
Static Private Attributes | |
static | _motorbits |
Motor bit values. More... | |
static | _pointsense |
Point sense bit values. More... | |
static | _routes |
Route check validation object. More... | |
Switch (turnout) operation using a Chubb SMINI board and a Circuits4Tracks Quad OD for OS detection.
Above is a typical switch (turnout) using an Chubb SMINI board to control a Circuitron Tortoise Switch Machine and to sense the point position and a Circuits4Track quad occupancy detector to sense occupation of the switch.
Typical usage:
For the track work elements use "switchN occupiedp" for the track work elements' occupied script and use "switchN pointstate" for the track work elements' state script. For the switch plate use "switchN motor normal" for the normal script and "switchN motor reverse" for the reverse script.
Then in the Main Loop, you would have:
Definition at line 57 of file C4TSMINI_Switch.tcl.
C4TSMINI_Switch::C4TSMINI_Switch | ( | name | , |
... | |||
) |
Constructor: initialize the switch object.
Create a low level sensor object and install it as a component. Install the switch's signals, motor, and point sense objects.
name | Name of the switch object |
... | Options:
|
|
protected |
Code to run when just entering the OS Sets the signal aspects and propagates signal state.
|
protected |
Code to run when about to exit the OS.
|
private |
A method to fake direction for frog facing switches.
option | This is always -direction. |
|
private |
A method to fake direction for frog facing switches.
option | This is always -direction. |
value | Either forward or reverse. |
C4TSMINI_Switch::motor | ( | route | ) |
The motor method sets the switch motor to align the points for the specificed route.
route | The desired route. A value of normal means align the points to the main (straight) route and a value of reverse means align the points to the divergent route. |
C4TSMINI_Switch::occupiedp | ( | ) |
The occupiedp method returns yes or no (true or false) indicating block (OS) occupation.
C4TSMINI_Switch::pointstate | ( | ) |
The pointstate method returns normal if the points are aligned to the main route and reverse if the points are aligned to the divergent route.
If the state cannot be determined, a value of unknown is returned.
C4TSMINI_Switch::propagate | ( | aspect | , |
from | , | ||
... | |||
) |
Method used to propagate distant signal states back down the line.
aspect | The signal aspect that is being propagated. |
from | The propagating block. |
... | Options:
|
|
static |
Type validating code Raises an error if object is not either the empty string or a SR4_C4TSR4_Switch type.
object | Some object. |
|
staticprivate |
Motor bit values.
Definition at line 86 of file C4TSMINI_Switch.tcl.
|
staticprivate |
Point sense bit values.
Definition at line 90 of file C4TSMINI_Switch.tcl.
|
staticprivate |
Route check validation object.
Definition at line 165 of file C4TSMINI_Switch.tcl.
|
private |
Saved occupation state.
Definition at line 82 of file C4TSMINI_Switch.tcl.
|
private |
SMINI node object.
Definition at line 78 of file C4TSMINI_Switch.tcl.