Model Railroad System  2.2.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CTCPanel::Lamp Class Reference

Lamp object type. More...

Public Member Functions

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

Private Member Functions

 _configureColor (option, value)
 Method to update the lamp color. More...
 
 _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...
 
 state
 The state of the lamp. More...
 

Detailed Description

Lamp object type.

These are on the control panel and represent simple single-color lamps.

Parameters
_ctcpanelThe CTCPanel megawidget.
_canvasThe control panel canvas to draw the lamp on.
...Options:
  • -x The x coordinate of the object (readonly, default 0).
  • -y The y coordinate of the object (readonly, default 0).
  • -controlpoint The name of the control point this lamp is part of (readonly, default CP1).
  • -color The color of the lamp (default white).
  • -label The label of the lamp (default "lamp").
Defined coords terminals: none. Defined values (states): Defined indicators: none.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ Lamp()

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

Construct a Lamp object.

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

◆ ~Lamp()

CTCPanel::Lamp::~Lamp ( )

Clean up all data objects and free up all resources.

Member Function Documentation

◆ _configureColor()

CTCPanel::Lamp::_configureColor ( option  ,
value   
)
private

Method to update the lamp color.

◆ _configureLabel()

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

Method to update the label option.

◆ geti()

CTCPanel::Lamp::geti ( ind  )

Method to get the state of one of our indicators (none).

◆ getv()

CTCPanel::Lamp::getv ( )

Method to get our value (lamp state).

◆ invoke()

CTCPanel::Lamp::invoke ( )

Method to invoke the lamp.

◆ seti()

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

Method to set an indicator's state (none).

◆ setv()

CTCPanel::Lamp::setv ( newstate  )

Method to set out value (lamp state).

Parameters
newstateThe new lamp state.

Member Data Documentation

◆ canvas

CTCPanel::Lamp::canvas
private

The canvas component (parent widget component).

◆ ctcpanel

CTCPanel::Lamp::ctcpanel
private

The CTC Panel component (parent widget).

◆ state

CTCPanel::Lamp::state
private

The state of the lamp.