Model Railroad System  2.2.2
Public Member Functions | Private Attributes | List of all members
Instruments::DialInstrument Class Reference

Generic dial instrument. More...

Public Member Functions

 DialInstrument (name, _canvas,...)
 Constructor – initialize a DialInstrument. More...
 
 ~DialInstrument ()
 Destructor – free up all resources. More...
 
 setvalue (value, value2=0)
 Method to set the value of the dial instrument. More...
 

Private Attributes

 ValueRange
 Value range. More...
 
 dTextX
 X position of the dial text. More...
 
 dTextY
 Y position of the dial text. More...
 

Detailed Description

Generic dial instrument.

Parameters
_canvasThe canvas to draw the dial instrument on.
...Options:
  • -x The X coordinate of the instrument (default 0).
  • -y The Y coordinate of the instrument (default 0).
  • -size The size of the instrument (default 100).
  • -label The label of the instrument (default DialInstrument).
  • -labelcolor The color of the label (default black).
  • -labelfont The font of the label (default {Times 14 bold}).
  • -background The background color of the instrument (default blue).
  • -outline The outline color of the instrument (default black).
  • -scaleback The background color of the scale (default white).
  • -scaleticks The color of the scale ticks (default black).
  • -fontfamily The font family used on the instrument (default Courier).
  • -maxvalue The maximum value (default 100).
  • -minvalue The minimum value (default 0).
  • -minat The pointer position, in degrees, of the minimum value (default 225).
  • -maxat The pointer position, in degrees, of the maximum value (default 315).
  • -pointercolor The color of the pointer (default black).
  • -secondpointerp Should a second pointer be drawn (default no)?
  • -secondpointercolor The color of the second pointer (default red).
  • -scaleticksinterval The interval of the scale ticks (default 10).
  • -digitalp Should a digital display also be included (default yes)?
  • -digits How many digits for the digital display (default 3).
  • -digitalbackground The background color of the digital display (default white).
  • -digitaldigitcolor The foreground folor of the digital display (default black).
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ DialInstrument()

Instruments::DialInstrument::DialInstrument ( name  ,
_canvas  ,
  ... 
)

Constructor – initialize a DialInstrument.

Parameters
_canvasThe canvas to draw the DialInstrument on.
...Option list.

◆ ~DialInstrument()

Instruments::DialInstrument::~DialInstrument ( )

Destructor – free up all resources.

Member Function Documentation

◆ setvalue()

Instruments::DialInstrument::setvalue ( value  ,
value2  = 0 
)

Method to set the value of the dial instrument.

Parameters
valueThe value to set the instrument to.
value2The value for the second pointer.

Member Data Documentation

◆ dTextX

Instruments::DialInstrument::dTextX
private

X position of the dial text.

◆ dTextY

Instruments::DialInstrument::dTextY
private

Y position of the dial text.

◆ ValueRange

Instruments::DialInstrument::ValueRange
private

Value range.