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

Curved Block object type. More...

Public Member Functions

 CurvedBlock (name, _ctcpanel, _canvas,...)
 Construct a CurvedBlock object. More...
 
 ~CurvedBlock ()
 Clean up all data objects and free up all resources. More...
 
 setv (value)
 Method to set out value (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 CurvedBlock. More...
 

Private Member Functions

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

Static Private Member Functions

static _square (x)
 Typemethod to compute the square of a number. More...
 
static _RadiansToDegrees (rads)
 Typemethod to convert from radians to degrees. More...
 

Private Attributes

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

Static Private Attributes

static _PI
 PI is $\pi$. More...
 

Detailed Description

Curved Block object type.

These are on the schematic and represent a piece of track on the Schematic.

Parameters
_ctcpanelThe CTCPanel megawidget.
_canvasThe schematic canvas to draw the CurvedBlock on.
...Options:
  • -x1 The first x coordinate of the object (readonly, default 0).
  • -y1 The first y coordinate of the object (readonly, default 0).
  • -x2 The second x coordinate of the object (readonly, default 0).
  • -y2 The second y coordinate of the object (readonly, default 0).
  • -radius The radius of the curve (readonly, default 10).
  • -controlpoint The name of the control point this label is part of (readonly, default MainLine).
  • -label The label of the CurvedBlock (default "").
  • -position The position of the label (readonly, default below).
  • -occupiedcommand A command to run to find out if the block is occupied (default {}).
Defined coords terminals:
  • E1 First endpoint.
  • E2 Second endpoint.
Defined values (states): none. Defined indicators: none.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ CurvedBlock()

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

Construct a CurvedBlock object.

See @FinnApr04@ for an explaination of the underlying math.

Parameters
_ctcpanelThe CTCPanel megawidget.
_canvasThe schematic canvas to draw the CurvedBlock on.
...Option list.

◆ ~CurvedBlock()

CTCPanel::CurvedBlock::~CurvedBlock ( )

Clean up all data objects and free up all resources.

Member Function Documentation

◆ _configureLabel()

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

Method to update the label option.

◆ _RadiansToDegrees()

static CTCPanel::CurvedBlock::_RadiansToDegrees ( rads  )
staticprivate

Typemethod to convert from radians to degrees.

◆ _square()

static CTCPanel::CurvedBlock::_square ( )
staticprivate

Typemethod to compute the square of a number.

◆ geti()

CTCPanel::CurvedBlock::geti ( ind  )

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

◆ invoke()

CTCPanel::CurvedBlock::invoke ( )

Method to invoke the CurvedBlock.

◆ seti()

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

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

◆ setv()

CTCPanel::CurvedBlock::setv ( value  )

Method to set out value (state).

Parameters
valueThe new state to set.

Member Data Documentation

◆ _PI

CTCPanel::CurvedBlock::_PI
staticprivate

PI is $\pi$.

◆ canvas

CTCPanel::CurvedBlock::canvas
private

The canvas component (parent widget component).

◆ ctcpanel

CTCPanel::CurvedBlock::ctcpanel
private

The CTC Panel component (parent widget).