Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
WheelFrameSensors.h
1// trax track library
2// AD 2025
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include "trax/Sensor.h"
30
31namespace trax{
32
33 //Todo: general interval - sensor for the next two
34
37 struct VelocitySensor : virtual Sensor{
38
40 static dclspc std::unique_ptr<VelocitySensor> Make() noexcept;
41
47 virtual void SetVelocity( Velocity velocityMin, Velocity velocityMax ) = 0;
48
49 virtual void SetVelocity( const common::Interval<Velocity>& velocity ) = 0;
50
51 virtual const common::Interval<Velocity>& GetVelocity() const = 0;
52
53 virtual void VelocityMin( Velocity velocityMin ) = 0;
54
55 virtual Velocity VelocityMin() const = 0;
56
57 virtual void VelocityMax( Velocity velocityMax ) = 0;
58
59 virtual Velocity VelocityMax( ) const = 0;
61
66 virtual void TriggerInside( bool bTriggerInside ) = 0;
67
68 virtual bool TriggerInside() const = 0;
70 };
71
74 struct WeighSensor : virtual Sensor{
75
77 static dclspc std::unique_ptr<WeighSensor> Make() noexcept;
78
84 virtual void Weight( Mass weightMin, Mass weightMax ) = 0;
85
86 virtual void Weight( const common::Interval<Mass>& weight ) = 0;
87
88 virtual const common::Interval<Mass>& Weight() const = 0;
89
90 virtual void WeightMin( Mass weightMin ) = 0;
91
92 virtual Mass WeightMin() const = 0;
93
94 virtual void WeightMax( Mass weightMax ) = 0;
95
96 virtual Mass WeightMax( ) const = 0;
98
103 virtual void TriggerInside( bool bTriggerInside ) = 0;
104
105 virtual bool TriggerInside() const = 0;
107
108
114 virtual void WeighTrain( bool bTrain ) = 0;
115
116 virtual bool WeighTrain() const = 0;
118 };
119
120
123 struct IntervalSensor : virtual Sensor{
124
126 static dclspc std::unique_ptr<IntervalSensor> Make() noexcept;
127
133 virtual void Value( Real valueMin, Real valueMax ) = 0;
134
135 virtual void Value( const common::Interval<Real>& interval ) = 0;
136
137 virtual const common::Interval<Real>& Value() const = 0;
138
139 virtual void ValueMin( Real valueMin ) = 0;
140
141 virtual Real ValueMin() const = 0;
142
143 virtual void ValueMax( Real valueMax ) = 0;
144
145 virtual Real ValueMax( ) const = 0;
147
152 virtual void TriggerInside( bool bTriggerInside ) = 0;
153
154 virtual bool TriggerInside() const = 0;
156 };
157
158}
Namespace of common utility classes and methods.
Definition Helpers.h:43
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
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 sensor that detects, wether a wheelframe passing by does this with some value like weight,...
Definition WheelFrameSensors.h:123
static dclspc std::unique_ptr< IntervalSensor > Make() noexcept
Makes a IntervalSensor object.
A Sensor can get attached to a track and be triggerd when a Location runs over it.
Definition Sensor.h:71
A sensor that detects, wether a wheelframe passing by does this within certain velocity limits.
Definition WheelFrameSensors.h:37
static dclspc std::unique_ptr< VelocitySensor > Make() noexcept
Makes a VelocitySensor object.
A sensor that detects wether the weight of a passing railrunner falls into certain limits.
Definition WheelFrameSensors.h:74
static dclspc std::unique_ptr< WeighSensor > Make() noexcept
Makes a WeighSensor object.