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

Locomotive Speed widget. More...

Public Member Functions

 speed ()
 Method to return the current speed. More...
 
 setspeed (speed)
 Method to set the sensed speed. More...
 
 LocomotiveSpeed (name,...)
 Build and install all component widgets and process configuration. More...
 
 invoke ()
 Method to invoke the widget. More...
 

Private Member Functions

 _setspeed (newspeed)
 Set the speed, bound to the bar -command option. More...
 
 _stop ()
 Stop method, bound to the stop button. More...
 
 _up1 ()
 Up by one method, bound to the slow up button. More...
 
 _up10 ()
 Up by 10 method, bound to the fast up button. More...
 
 _down1 ()
 Down by one method, bound to the slow down button. More...
 
 _down10 ()
 Down by one method, bound to the fast down button. More...
 

Private Attributes

 leftbuttons
 Left buttons component (small incrments). More...
 
 up1
 Up by one button. More...
 
 down1
 Down by one button. More...
 
 rightbuttons
 Right buttons component (larger incrments). More...
 
 up10
 Up by ten button. More...
 
 down10
 Down by one button. More...
 
 bar
 Current speed bar. More...
 
 stop
 Stop button. More...
 
 _speed
 The current speed. More...
 

Static Private Attributes

static _up
 Bitmap for up button. More...
 
static _down
 Bitmap for down button. More...
 
static _up10
 Bitmap for fast up button. More...
 
static _down10
 Bitmap for fast down button. More...
 
static _stop
 Bitmap for fast down button. More...
 

Detailed Description

Locomotive Speed widget.

This widget implements Locomotive Speed control / display. There are buttons for increasing or decreasing speed either by units of 1 or by units of 10. Plus there is a bar showing the current relative speed.

Parameters
pathPathname of the widget.
...Options:
  • -command Script to call when the speed is changed. The new speed is appended.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ LocomotiveSpeed()

CabWidgets::LocomotiveSpeed::LocomotiveSpeed ( name  ,
  ... 
)

Build and install all component widgets and process configuration.

Parameters
...Argument list (option value pairs). Gets passed to the implicitly defined configurelist method.

Member Function Documentation

◆ _down1()

CabWidgets::LocomotiveSpeed::_down1 ( )
private

Down by one method, bound to the slow down button.

◆ _down10()

CabWidgets::LocomotiveSpeed::_down10 ( )
private

Down by one method, bound to the fast down button.

◆ _setspeed()

CabWidgets::LocomotiveSpeed::_setspeed ( newspeed  )
private

Set the speed, bound to the bar -command option.

◆ _stop()

CabWidgets::LocomotiveSpeed::_stop ( )
private

Stop method, bound to the stop button.

◆ _up1()

CabWidgets::LocomotiveSpeed::_up1 ( )
private

Up by one method, bound to the slow up button.

◆ _up10()

CabWidgets::LocomotiveSpeed::_up10 ( )
private

Up by 10 method, bound to the fast up button.

◆ invoke()

CabWidgets::LocomotiveSpeed::invoke ( )

Method to invoke the widget.

This calls the script (if any) defined by the -command option.

◆ setspeed()

CabWidgets::LocomotiveSpeed::setspeed ( speed  )

Method to set the sensed speed.

◆ speed()

CabWidgets::LocomotiveSpeed::speed ( )

Method to return the current speed.

Member Data Documentation

◆ _down

CabWidgets::LocomotiveSpeed::_down
staticprivate

Bitmap for down button.

◆ _down10

CabWidgets::LocomotiveSpeed::_down10
staticprivate

Bitmap for fast down button.

◆ _speed

CabWidgets::LocomotiveSpeed::_speed
private

The current speed.

◆ _stop

CabWidgets::LocomotiveSpeed::_stop
staticprivate

Bitmap for fast down button.

◆ _up

CabWidgets::LocomotiveSpeed::_up
staticprivate

Bitmap for up button.

◆ _up10

CabWidgets::LocomotiveSpeed::_up10
staticprivate

Bitmap for fast up button.

◆ bar

CabWidgets::LocomotiveSpeed::bar
private

Current speed bar.

◆ down1

CabWidgets::LocomotiveSpeed::down1
private

Down by one button.

◆ down10

CabWidgets::LocomotiveSpeed::down10
private

Down by one button.

◆ leftbuttons

CabWidgets::LocomotiveSpeed::leftbuttons
private

Left buttons component (small incrments).

◆ rightbuttons

CabWidgets::LocomotiveSpeed::rightbuttons
private

Right buttons component (larger incrments).

◆ stop

CabWidgets::LocomotiveSpeed::stop
private

Stop button.

◆ up1

CabWidgets::LocomotiveSpeed::up1
private

Up by one button.

◆ up10

CabWidgets::LocomotiveSpeed::up10
private

Up by ten button.