Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::DoubleSlipSwitch Struct Referenceabstract

A double slip switch is made from eight tracks that form a crossing with the possibility to divert the route to connect two of the narrowing (incoming) tracks pairwise. There are four narrowing (incoming) tracks, two crossing tracks and two diverting tracks, connecting two narrowing ones each. The two straight tracks 'X', are crossing each other; two incoming narrowing tracks, two outgoing narrowing tracks - all four connecting to the straight track ends - and two diverging tracks ')' and '(', connecting incoming and outgoing tracks (ignore the dots): More...

#include <C:/Trend/Development/Trax3/Code/trax/Switch.h>

Inheritance diagram for trax::DoubleSlipSwitch:

Public Types

enum  SlotNames {
  slot_none = -1 , slot_0 = 0 , slot_1 , slot_2 ,
  slot_3 , slot_4 , slot_5 , slot_6 ,
  slot_7 , slot_8 , slot_9 , slot_10 ,
  slot_11 , slot_count
}
enum class  Status {
  none = -1 , go , go1 = go , go2 ,
  branch , branch1 = branch , branch2 , count ,
  toggle , change
}
 Status values of a switch. More...

Public Member Functions

virtual Status Set (Status to, bool pulse=true)=0
 Turns the switch to the specified setting.
virtual Status Get () const =0
 Gets the setting of the switch.
virtual void SetCenter (const spat::Frame< Length, One > &center)=0
 Sets the center of the switch.
virtual JackJackOn (Status status)=0
 Gets a Jack that pulses its Plug if the specified Status is set.
virtual MultiPlugPlugTo (Status status)=0
 Gets a Plug that switches to the specified Status.
virtual void Set (const Track &trackA, Track::EndType trackendA, const Track &trackB, Track::EndType trackendB, bool pulse=true)=0
 Sets the Connector to the setting that connects the two track ends.
Public Member Functions inherited from trax::Connector
virtual ConnectorType GetConnectorType () const noexcept=0
virtual const char * TypeName () const noexcept=0
virtual bool IsValid () const noexcept=0
 Checks whether the connector is valid.
virtual void Toggle (bool pulse=true)=0
 Sets the connector to the next setting.
virtual void Disconnect ()=0
 Disconnects all track ends from each other.
virtual std::pair< std::shared_ptr< TrackBuilder >, Track::EndTypeSlot (int slot) const noexcept=0
virtual int Slot (const Track &track, Track::EndType trackend) const =0
virtual int CntSlots () const noexcept=0
virtual void SwapSlots (int slotA, int slotB)=0
 Exchanges the content of the two slots.
virtual bool IsComplete () const =0
virtual bool Check (std::ostream &os, Length e_distance=epsilon__length, Angle e_kink=epsilon__angle, Angle e_twist=epsilon__angle) const noexcept=0
 Checks the connector for consistency.
virtual void Clear (int slot)=0
 clears the slot with index slot.
virtual void Clear ()=0
 Releases all the tracks from the slots.
virtual void GetCenter (spat::Frame< Length, One > &center) const =0
 Gets the center of the tracks the connector is connecting.
virtual MultiPlugPlugToToggle () noexcept=0
virtual const MultiPlugPlugToToggle () const noexcept=0
virtual JackJackOnChange () noexcept=0
virtual const JackJackOnChange () const noexcept=0
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.
virtual void UserData (ConnectorUserData *pData) noexcept=0
 Sets a pointer to user provided data.
virtual ConnectorUserData * UserData () const noexcept=0
virtual int Slot (int slot, std::shared_ptr< TrackBuilder > pTrack, Track::EndType trackend, bool connectAnonymous=false)=0
 Populates a slot with a tracks end.
virtual int Slot (std::shared_ptr< TrackBuilder > pTrack, Track::EndType trackend, bool connectAnonymous=false)=0
 Populates the slot with the smallest ID that is still unpopulated.
Public Member Functions inherited from trax::Identified< Connector >
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< DoubleSlipSwitchMake () noexcept
 Makes a standard DoubleSlipSwitch object.

Detailed Description

A double slip switch is made from eight tracks that form a crossing with the possibility to divert the route to connect two of the narrowing (incoming) tracks pairwise. There are four narrowing (incoming) tracks, two crossing tracks and two diverting tracks, connecting two narrowing ones each. The two straight tracks 'X', are crossing each other; two incoming narrowing tracks, two outgoing narrowing tracks - all four connecting to the straight track ends - and two diverging tracks ')' and '(', connecting incoming and outgoing tracks (ignore the dots):

/// 
/// in
/// 
/// \./
/// )X(
/// / \.  
/// 
/// out
/// 
/// 

Member Enumeration Documentation

◆ SlotNames

Enumerator
slot_0 

first narrowing track end

slot_1 

second narrowing track end on the same side of first

slot_2 

third narrowing track end on opposite side to the first

slot_3 

fourth narrowing track end on same side to third

slot_4 

crossing track end connected with first narrowing

slot_5 

crossing track end connected with second narrowing

slot_6 

crossing track end connected with third narrowing

slot_7 

crossing track end connected with fourth narrowing

slot_8 

diverging track end connected with first narrowing

slot_9 

diverging track end connected with fourth narrowing

slot_10 

diverging track end connected with third narrowing

slot_11 

diverging track end connected with second narrowing

◆ Status

enum class trax::DoubleSlipSwitch::Status
strong

Status values of a switch.

Note that there are actually only two states for the DoubleSlipSwitch: go and branch. The others are redundant and play a role only in toggling and pulsing.

Enumerator
none 

status not specified.

go 

the train runs over the crossing tracks.

go1 

the train runs over the crossing tracks.

go2 

the train runs over the crossing tracks. Second go status only differs in the jack that pulses.

branch 

the train runs over the diverging tracks.

branch1 

the train runs over the diverging tracks.

branch2 

the train runs over the diverging tracks. Second branch status only differs in the jack that pulses.

count 

number of valid status values.

toggle 

toggle through the valid status (including go2 and branch2).

change 

signal a status change (used with Jacks'n Plugs).

Member Function Documentation

◆ Set() [1/2]

virtual void trax::Connector::Set ( const Track & trackA,
Track::EndType trackendA,
const Track & trackB,
Track::EndType trackendB,
bool pulse = true )
virtual

Sets the Connector to the setting that connects the two track ends.

Exceptions
std::invalid_argumentif one of the two track ends is not in a slot.
std::logic_error,ifthe two ends can not get connected by the Connector.

Implements trax::Connector.

◆ Set() [2/2]

virtual Status trax::DoubleSlipSwitch::Set ( Status to,
bool pulse = true )
pure virtual

Turns the switch to the specified setting.

Returns
The previous status of the switch.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/Switch.h