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

Signal plate object type. More...

Public Member Functions

 SIGPlate (name, _ctcpanel, _canvas,...)
 Construct a SIGPlate object. More...
 
 ~SIGPlate ()
 Clean up all data objects and free up all resources. More...
 
 getv ()
 Method to get our value (lever position). More...
 
 setv (state)
 Method to set out value (level position). More...
 
 geti (ind)
 Method to get the state of one of out indicators. More...
 
 seti (ind, value)
 Method to set an indicator's state. More...
 
 invoke ()
 Method to invoke the switch plate. More...
 

Private Member Functions

 _configureLabel (option, value)
 Method to update the label option. More...
 

Private Attributes

 ctcpanel
 The CTC Panel component (parent widget). More...
 
 canvas
 The canvas component (parent widget component). More...
 

Static Private Attributes

static _PlatePolygon
 Polygon coordinates for the plate. More...
 

Detailed Description

Signal plate object type.

These are on the control panel and represent levers for controlling track signals (control point signals). They have a lever that can be in three positions, Left, Center, or Right.

Parameters
_ctcpanelThe CTCPanel megawidget.
_canvasThe control panel canvas to draw the switch plate on.
...Options:
  • -x The x coordinate of the object (readonly, default 0).
  • -y The y coordinate of the object (readonly, default 0).
  • -label The label of the switch plate (default 1).
  • -controlpoint The name of the control point this switch is part of (readonly, default CP1).
  • -leftcommand The Tcl script to run when switch is set to left (default {}).
  • -centercommand The Tcl script to run when switch is set to center (default {}).
  • -rightcommand The Tcl script to run when switch is set to right (default {}).
Defined coords terminals:
  • xy The base coords of the object.
Defined values (states):
  • Left Left position.
  • Right Right position.
  • Center Center position.
Defined indicators:
  • L Left indicator, green if on.
  • C Center indicator, red if on.
  • R Right indicator, green if on.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ SIGPlate()

CTCPanel::SIGPlate::SIGPlate ( name  ,
_ctcpanel  ,
_canvas  ,
  ... 
)

Construct a SIGPlate object.

Parameters
_ctcpanelThe CTCPanel megawidget.
_canvasThe control panel canvas to draw the switch plate on.
...Option list.

◆ ~SIGPlate()

CTCPanel::SIGPlate::~SIGPlate ( )

Clean up all data objects and free up all resources.

Member Function Documentation

◆ _configureLabel()

CTCPanel::SIGPlate::_configureLabel ( option  ,
value   
)
private

Method to update the label option.

◆ geti()

CTCPanel::SIGPlate::geti ( ind  )

Method to get the state of one of out indicators.

Parameters
indThe indicator to fetch state information for.

◆ getv()

CTCPanel::SIGPlate::getv ( )

Method to get our value (lever position).

◆ invoke()

CTCPanel::SIGPlate::invoke ( )

Method to invoke the switch plate.

One of the command scripts is executed depending on the lever position.

◆ seti()

CTCPanel::SIGPlate::seti ( ind  ,
value   
)

Method to set an indicator's state.

Parameters
indThe indicator to set.
valueThe state to set it to.

◆ setv()

CTCPanel::SIGPlate::setv ( state  )

Method to set out value (level position).

Parameters
stateThe new state to set.

Member Data Documentation

◆ _PlatePolygon

CTCPanel::SIGPlate::_PlatePolygon
staticprivate

Polygon coordinates for the plate.

◆ canvas

CTCPanel::SIGPlate::canvas
private

The canvas component (parent widget component).

◆ ctcpanel

CTCPanel::SIGPlate::ctcpanel
private

The CTC Panel component (parent widget).