mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49: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:
@@ -1205,16 +1205,17 @@ class TMoverParameters
|
|||||||
int LightsDefPos = 1;
|
int LightsDefPos = 1;
|
||||||
bool LightsWrap = false;
|
bool LightsWrap = false;
|
||||||
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
|
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
|
||||||
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
|
int ScndInMain{0}; /*zaleznosc bocznika od nastawnika*/
|
||||||
bool MBrake = false; /*Czy jest hamulec reczny*/
|
bool MBrake = false; /*Czy jest hamulec reczny*/
|
||||||
double maxTachoSpeed = { 0.0 }; // maksymalna predkosc na tarczce predkosciomierza analogowego
|
double StopBrakeDecc = 0.0;
|
||||||
double StopBrakeDecc = { 0.0 };
|
bool ReleaseParkingBySpringBrake{false};
|
||||||
bool ReleaseParkingBySpringBrake { false };
|
bool ReleaseParkingBySpringBrakeWhenDoorIsOpen{false};
|
||||||
bool ReleaseParkingBySpringBrakeWhenDoorIsOpen{ false };
|
bool SpringBrakeCutsOffDrive{true};
|
||||||
bool SpringBrakeCutsOffDrive { true };
|
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*/
|
||||||
|
|||||||
@@ -10628,6 +10628,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
@@ -1315,7 +1315,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
|
||||||
@@ -2869,7 +2879,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
|
||||||
@@ -6922,6 +6932,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
@@ -882,6 +882,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