18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-22 03:15:00 +01:00

Merge pull request #268 from MaSzyna-EU07/fix/ws-hold-coil-lever-bistable

Bistable hold coil lever of the line breaker (eu07/maszyna#364)
This commit is contained in:
2026-11-09 12:57:49 +00:00
committed by GitHub
5 changed files with 112 additions and 2 deletions

View File

@@ -61,6 +61,9 @@ public:
// returns offset of submodel associated with the button from the model centre
glm::vec3 model_offset() const;
TGaugeType type() const;
// whether the definition of the control declared its type, rather than left it at the default
bool type_declared() const {
return m_typedeclared; }
inline
bool is_push() const {
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::push ) ) != 0; }
@@ -97,6 +100,7 @@ private:
// members
TGaugeAnimation m_animation { TGaugeAnimation::gt_Unknown }; // typ ruchu
TGaugeType m_type { TGaugeType::toggle }; // switch type
bool m_typedeclared { false }; // the type was given with type: in the definition
float m_friction { 0.f }; // hamowanie przy zliżaniu się do zadanej wartości
float m_targetvalue { 0.f }; // wartość docelowa
float m_value { 0.f }; // wartość obecna