mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Add distance counter double click to activate
DCMB=[No] - Czy potrzebne jest podwojne nacisniecie DCDPP=[1.0] - W jakim czasie drugie nacisnienie ma nastapic od pierwszego, aby aktywowac pomiar
This commit is contained in:
@@ -1213,6 +1213,8 @@ class TMoverParameters
|
|||||||
double SpringBrakeDriveEmergencyVel{-1};
|
double SpringBrakeDriveEmergencyVel{-1};
|
||||||
bool HideDirStatusWhenMoving{false}; // Czy gasic lampki kierunku powyzej predkosci zdefiniowanej przez HideDirStatusSpeed
|
bool HideDirStatusWhenMoving{false}; // Czy gasic lampki kierunku powyzej predkosci zdefiniowanej przez HideDirStatusSpeed
|
||||||
int HideDirStatusSpeed{1}; // Predkosc od ktorej lampki kierunku sa wylaczane
|
int HideDirStatusSpeed{1}; // Predkosc od ktorej lampki kierunku sa wylaczane
|
||||||
|
bool isDoubleClickForMeasureNeeded = {false}; // czy rozpoczecie pomiaru odleglosci odbywa sie po podwojnym wcisnienciu przycisku?
|
||||||
|
float DistanceCounterDoublePressPeriod = {1.f}; // czas w jakim nalezy podwojnie wcisnac przycisk, aby rozpoczac pomiar odleglosci
|
||||||
TSecuritySystem SecuritySystem;
|
TSecuritySystem SecuritySystem;
|
||||||
int EmergencyBrakeWarningSignal{0}; // combined with basic WarningSignal when manual emergency brake is active
|
int EmergencyBrakeWarningSignal{0}; // combined with basic WarningSignal when manual emergency brake is active
|
||||||
TUniversalCtrlTable UniCtrlList; /*lista pozycji uniwersalnego nastawnika*/
|
TUniversalCtrlTable UniCtrlList; /*lista pozycji uniwersalnego nastawnika*/
|
||||||
|
|||||||
@@ -10625,6 +10625,9 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
|||||||
|
|
||||||
extract_value(HideDirStatusWhenMoving, "HideDirStatusWhenMoving", line, "");
|
extract_value(HideDirStatusWhenMoving, "HideDirStatusWhenMoving", line, "");
|
||||||
extract_value(HideDirStatusSpeed, "HideDirStatusSpeed", line, "");
|
extract_value(HideDirStatusSpeed, "HideDirStatusSpeed", line, "");
|
||||||
|
extract_value(isDoubleClickForMeasureNeeded, "DCMB", line, "");
|
||||||
|
extract_value(DistanceCounterDoublePressPeriod, "DCDPP", line, "");
|
||||||
|
|
||||||
|
|
||||||
std::map<std::string, start_t> starts {
|
std::map<std::string, start_t> starts {
|
||||||
{ "Disabled", start_t::disabled },
|
{ "Disabled", start_t::disabled },
|
||||||
|
|||||||
24
Train.cpp
24
Train.cpp
@@ -1317,7 +1317,17 @@ void TTrain::OnCommand_distancecounteractivate( TTrain *Train, command_data cons
|
|||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggDistanceCounterButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggDistanceCounterButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
// activate or start anew
|
// activate or start anew
|
||||||
Train->m_distancecounter = 0.f;
|
if (Train->mvOccupied->isDoubleClickForMeasureNeeded) {
|
||||||
|
// handler tempomatu dla podwojnego kliku
|
||||||
|
if (Train->trainLenghtMeasureTimer >= 0.f) // jesli zdazylismy w czasie sekundy
|
||||||
|
Train->m_distancecounter = 0.f; // rozpoczynamy pomiar
|
||||||
|
else
|
||||||
|
Train->trainLenghtMeasureTimer = Train->mvOccupied->DistanceCounterDoublePressPeriod; // odpalamy zegarek od nowa
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// dla pojedynczego kliku
|
||||||
|
Train->m_distancecounter = 0.f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( Command.action == GLFW_RELEASE ) {
|
else if( Command.action == GLFW_RELEASE ) {
|
||||||
// visual feedback
|
// visual feedback
|
||||||
@@ -2899,7 +2909,7 @@ void TTrain::OnCommand_pantographvalvesoff( TTrain *Train, command_data const &C
|
|||||||
}
|
}
|
||||||
else if( Command.action == GLFW_RELEASE ) {
|
else if( Command.action == GLFW_RELEASE ) {
|
||||||
// visual feedback
|
// visual feedback
|
||||||
// NOTE: pantvalves_sw: is a specialized button, with no toggle behavior support
|
// NOTE: pantvalves_sw: is a speciali zed button, with no toggle behavior support
|
||||||
if (hasSeparateSwitches)
|
if (hasSeparateSwitches)
|
||||||
Train->ggPantValvesOff.UpdateValue(0.f, Train->dsbSwitch);
|
Train->ggPantValvesOff.UpdateValue(0.f, Train->dsbSwitch);
|
||||||
else
|
else
|
||||||
@@ -6952,6 +6962,16 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
mvOccupied->OperateDoors( static_cast<side>( idx ), true );
|
mvOccupied->OperateDoors( static_cast<side>( idx ), true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// train measurement timer
|
||||||
|
if (trainLenghtMeasureTimer >= 0.f) {
|
||||||
|
trainLenghtMeasureTimer -= Deltatime;
|
||||||
|
if (trainLenghtMeasureTimer < 0.f)
|
||||||
|
{
|
||||||
|
trainLenghtMeasureTimer = -1.f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// helper variables
|
// helper variables
|
||||||
if( DynamicObject->Mechanik != nullptr ) {
|
if( DynamicObject->Mechanik != nullptr ) {
|
||||||
m_doors = (
|
m_doors = (
|
||||||
|
|||||||
1
Train.h
1
Train.h
@@ -885,6 +885,7 @@ private:
|
|||||||
bool m_dirbackward{ false }; // helper, true if direction set to backward
|
bool m_dirbackward{ false }; // helper, true if direction set to backward
|
||||||
bool m_doorpermits{ false }; // helper, true if any door permit is active
|
bool m_doorpermits{ false }; // helper, true if any door permit is active
|
||||||
float m_doorpermittimers[2] = { -1.f, -1.f };
|
float m_doorpermittimers[2] = { -1.f, -1.f };
|
||||||
|
float trainLenghtMeasureTimer = { -1.f };
|
||||||
// ld substitute
|
// ld substitute
|
||||||
bool m_couplingdisconnect { false };
|
bool m_couplingdisconnect { false };
|
||||||
bool m_couplingdisconnectback { false };
|
bool m_couplingdisconnectback { false };
|
||||||
|
|||||||
Reference in New Issue
Block a user