![]() |
Trax3 3.1.0
trax track library
|
Interface for signals that control the velocity of trains. More...
#include <C:/Trend/Development/Trax3/Code/trax/Signal.h>

Public Member Functions | |
| virtual bool | AffectTravelVelocity (Status status, bool bTravel)=0 |
| Set if the signal should affect the velocity permanently. | |
| virtual bool | AffectTravelVelocity (Status status) const =0 |
| virtual void | SetVelocity (Status status, Velocity velocityMin, Velocity velocityMax)=0 |
| Set the target velocities. | |
| virtual void | SetVelocity (Status status, Velocity velocity)=0 |
| Set the target velocities. | |
| virtual void | VelocityMin (Status status, Velocity velocityMin)=0 |
| Sets the minimum velocity. | |
| virtual void | VelocityMax (Status status, Velocity velocityMax)=0 |
| Sets the maximum velocity. | |
| virtual Velocity | VelocityMin (Status status) const =0 |
| Get the minimum target velocity. | |
| virtual Velocity | VelocityMax (Status status) const =0 |
| Get the maximum target velocity. | |
| virtual bool | IsValidState (Status status) const =0 |
| virtual void | Remove (Status status)=0 |
| Removes thje signal state with index idx. | |
| virtual void | Clear ()=0 |
| Removes all signal states. | |
| virtual void | StopDistance (Length distance)=0 |
| Sets a distance from the far edge to stop at. | |
| virtual Length | StopDistance () const =0 |
| virtual Jack & | JackOnVelocity (Status status)=0 |
| virtual MultiPlug & | PlugToVelocity (Status status)=0 |
| Public Member Functions inherited from trax::Signal | |
| virtual const char * | TypeName () const noexcept=0 |
| virtual Status | Set (Status status, bool pulse=true)=0 |
| Set the Signal's setting. | |
| virtual void | Toggle (bool pulse=true)=0 |
| Sets the signal state to the next setting. | |
| virtual Status | Get () const =0 |
| Get the Signal's setting. | |
| virtual int | CountStatus () const =0 |
| Gets the number of signal status the signal provides. | |
| virtual void | Attach (TrackBuilder *pTrackBuilder) noexcept=0 |
| Attaches the Signal to a TrackBuilder. | |
| virtual TrackBuilder * | TrackAttached () const =0 |
| virtual void | GetTrackRange (TrackRange &trackRange) const =0 |
| Gets the range on the track on wich the signal is effective. | |
| virtual Location | GetLocation () const =0 |
| Creates a Location for the signals reference point on the tracks. | |
| virtual MultiPlug & | PlugToToggle ()=0 |
| virtual Jack & | JackOnChange ()=0 |
| virtual Jack & | JackOn (Status status)=0 |
| Gets a Jack that pulses its Plug if the specified Status is set. | |
| virtual Jack & | JackOnChangeTo (Status status)=0 |
| Gets a Jack that pulses its Plug if the specified Status is set and was not set before. | |
| virtual MultiPlug & | PlugTo (Status status)=0 |
| Gets a Plug that switches to the specified Status. | |
| virtual void | RegisterSockets (SocketRegistry &modul)=0 |
| Registers all the Plugs with the module and supplies the Jacks with plug ids for connecting. | |
| virtual void | UnregisterSockets (SocketRegistry &modul)=0 |
| Removes all references to Plugs and Jacks from the module. | |
| Public Member Functions inherited from trax::Identified< Signal > | |
| virtual const std::string & | Reference (const std::string &name) const=0 |
| Gets a reference that was set for this object by name. | |
| virtual const std::vector< char const * > & | ReferenceNames (const std::string &namePart) const=0 |
| Searches for all reference names that countain namePart as substring in the name. | |
| virtual IDType | ID () const noexcept=0 |
| Identified (const Identified &)=delete | |
| Identified & | operator= (const Identified &)=delete |
Static Public Member Functions | |
| static dclspc std::unique_ptr< VelocityControl > | Make () noexcept |
| Makes a VelocityControl object. | |
Additional Inherited Members | |
| Public Types inherited from trax::Signal | |
| enum class | Status { none = -1 , stop = 0 , clear = 1 , slow , velocity0 = stop , velocity1 = clear , velocity2 = slow , velocity3 , velocity4 , velocity5 , velocity6 , velocity7 , velocity8 , velocity9 , velocity10 , velocity11 , velocity12 , velocityMax = velocity12 , caution , doors_open , doors_close , uncouple , lights_on , jump , count , toggle , change } |
| Various Signal status settings. | |
Interface for signals that control the velocity of trains.
A VelocityControl can have several control states; each velocity control maintains a minimum and a maximum velocity, wich a train might feel compelled to maintain if in the signal area.
|
pure virtual |
| std::invalid_argument | if status is not a velocity signal status. |
| std::out_of_range | if status is not a control state, prefiously set. |
|
pure virtual |
Set if the signal should affect the velocity permanently.
A train maintains a separate travel velocity and a target velocity. If the train enters a signal's area its target velocity will get influenced, but as soon as it leaves the area the target velocity will get set back to travel velocity. The default setting is false.
| bTravel | true if the travel velocity should be affected, false if not. |
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |
| std::out_of_range | if status is not a control state, prefiously set. |
|
pure virtual |
|
pure virtual |
Removes thje signal state with index idx.
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |
Set the target velocities.
Set the velocities for one control state to the same value both. It creates the control state if not created yet. This will yield a control that restricts the velocity of a train to a specific value; e.g. 0 for a stop sign.
| std::invalid_argument | if status is not a velocity signal status. |
|
pure virtual |
Set the target velocities.
Set the velocities for one control state. It creates the control state if not created yet.
| status | Velocity status of signal control. |
| velocityMin | Lower limit of the velocity. |
| velocityMax | Upper limit of the velocity. |
| std::invalid_argument | if status is not a velocity signal status. |
| std::invalid_argument | if velocityMin > velocityMax. |
|
pure virtual |
|
pure virtual |
Sets a distance from the far edge to stop at.
| distance | Distance to stop earlyer than the far edge. |
Get the maximum target velocity.
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |
| std::out_of_range | if status is not a control state, prefiously set. |
|
pure virtual |
Sets the maximum velocity.
The minimum velocity will be set to zero. It creates the control state if not created yet.
| velocityMax | Upper limit of the velocity. |
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |
Get the minimum target velocity.
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |
| std::out_of_range | if status is not a control state, previously created. |
|
pure virtual |
Sets the minimum velocity.
The maximum velocity will be set to an infinite value. It creates the control state if not created yet.
| velocityMin | Lower limit of the velocity. |
| status | Velocity status of signal control. |
| std::invalid_argument | if status is not a velocity signal status. |