Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Anl3TrackSystemReader.h
1// Copyright (c) 2013 - 2019 Marc-Michael Horstmann;
2// Copyright (c) 2020 - 2024 Trend Verlag;
3//
4// trax track library
5// AD 2014
6//
7// "It's all over and I'm standing pretty
8// In the dust that was a city"
9//
10// Goldfinger
11
12#include "CollectionSupportXML.h"
13
14#include "trax/Signal.h"
15#include "trax/Switch.h"
16#include "trax/Track.h"
17
18#include <map>
19
20namespace trax{
21
24 struct SensorFilterJack;
25 struct SignalCollection;
26 struct TimerCollection;
28 struct Signal;
29
30 namespace ptreesupport{
31
32 class Anl3TrackSystemReader : public PTreeReader
33 {
34 public:
35 dclspc Anl3TrackSystemReader( const char* pLocale = nullptr );
36 dclspc Anl3TrackSystemReader( SocketRegistry& socketRegistry, const char* pLocale = nullptr );
37
38 std::shared_ptr<TrackSystem> dclspc ReadTrackSystem( const boost::property_tree::ptree& pt ) const override;
39
40 protected:
41 virtual std::shared_ptr<TrackSystem> CreateTrackSystem( const boost::property_tree::ptree& pt,
42 std::vector<std::pair<Track::Coupling,std::string>>& couplings,
43 SignalCollection& signalCollection,
44 IndicatorCollection& indicatorCollection,
45 TimerCollection& timerCollection,
46 PulseCounterCollection& pulseCounterCollection,
47 std::map<IDType,Velocity>& travelVelocities,
48 IDType& maxSensorID ) const;
49
50 virtual void CreateTrackCollection( const boost::property_tree::ptree& pt,
51 TrackSystem& trackSystem,
52 std::vector<std::pair<Track::Coupling,std::string>>& couplings,
53 SignalCollection& signalCollection,
54 IndicatorCollection& indicatorCollection,
55 TimerCollection& timerCollection,
56 PulseCounterCollection& pulseCounterCollection,
57 std::map<IDType,Velocity>& travelVelocities,
58 IDType& maxSensorID ) const;
59
60
61 void ReadDreibein( const boost::property_tree::ptree& pt, spat::Frame<Length,One>& frame ) const;
62
63 Signal::Status SignalStatusFromEEP( int stellung, const Signal& signal ) const;
64 Switch::Status SwitchStatusFromEEP( int weichenstellung ) const noexcept;
65 ThreeWaySwitch::Status ThreeWaySwitchStatusFromEEP( int weichenstellung ) const noexcept;
66 SingleSlipSwitch::Status SingleSlipSwitchStatusFromEEP( int weichenstellung ) const noexcept;
67 DoubleSlipSwitch::Status DoubleSlipSwitchStatusFromEEP( int weichenstellung ) const noexcept;
68 private:
69 std::shared_ptr<TrackBuilder> CreateTrack( const boost::property_tree::ptree& pt,
70 ConnectorCollection& connectors, std::vector<std::tuple<std::shared_ptr<Signal>,TrackBuilder*,common::Interval<Length>>>& signals, IndicatorCollection& indicatorCollection, TimerCollection& timerCollection, PulseCounterCollection& pulseCounterCollection, std::map<IDType,Velocity>& travelVelocities, IDType& maxSensorID ) const;
71
72 std::pair<Track::Coupling,std::string> CreateTrackCoupling( const boost::property_tree::ptree& pt,
73 const TrackSystem& trackSystem ) const;
74
75 std::shared_ptr<Signal> CreateSignal( const boost::property_tree::ptree& pt,
76 IndicatorCollection& indicatorCollection, common::Interval<Length>& trackRange, std::map<IDType,Velocity>& travelVelocities, std::vector<int>& functionMap, bool bCreateSignalSemaphore, bool bCreateVorsignalSemaphore ) const;
77
78 std::unique_ptr<Sensor> CreateKontakt( const boost::property_tree::ptree& pt,
79 TimerCollection& timerCollection, PulseCounterCollection& pulseCounterCollection, TrackLocation& trackLocation, IDType& maxSensorID ) const;
80
81 Track::EndType From( const std::string& name ) const;
82
83 };
84
85 std::shared_ptr<TrackSystem> dclspc ReadTrackSystemFromANL3( const ptreesupport::PTreeReader& reader, const boost::property_tree::ptree& pt );
86 } // namespace ptreesupport
87} // namespace trax
Home of the Track and TrackBuilder interfaces.
Base class for XML readers based on ptree.
Definition CollectionSupportXML.h:97
ptree operator support
Definition CommonSupportXML.h:42
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Collection to hold a set of Connector objects.
Definition ConnectorCollection.h:36
Status
Status values of a switch.
Definition Switch.h:556
Type used for IDs in the trax library.
Definition IDType.h:43
Collection to hold a set of Indicator objects.
Definition IndicatorCollection.h:39
Status
Status.
Definition Switch.h:56
Definition PulseCounterCollection.h:36
Collection to hold a set of Signal objects.
Definition SignalCollection.h:36
A Signal is positioned along a track and is submitted to a Train if it runs over it.
Definition Signal.h:61
Status
Various Signal status settings.
Definition Signal.h:67
Status
Status values of a switch.
Definition Switch.h:460
Interface for a registry that reconnects Plugs and Jacks according to their IDs.
Definition SocketRegistry.h:40
Definition TimerCollection.h:35
Interface for making and shaping tracks.
Definition Track.h:831
EndType
Designates one of the two ends of a track.
Definition Track.h:292
A TrackLocation ist a location on a single track.
Definition TrackLocation.h:43
A track system is the container for tracks.
Definition TrackSystem.h:56