mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
build 170831. scan table fixes, emergency brake control, mouse support for manual brake
This commit is contained in:
@@ -867,7 +867,7 @@ public:
|
||||
/*
|
||||
int BrakeStatus = b_off; //0 - odham, 1 - ham., 2 - uszk., 4 - odluzniacz, 8 - antyposlizg, 16 - uzyte EP, 32 - pozycja R, 64 - powrot z R
|
||||
*/
|
||||
bool EmergencyBrakeFlag = false; // manual emergency brake
|
||||
bool AlarmChainFlag = false; // manual emergency brake
|
||||
bool RadioStopFlag = false; /*hamowanie nagle*/
|
||||
int BrakeDelayFlag = 0; /*nastawa opoznienia ham. osob/towar/posp/exp 0/1/2/4*/
|
||||
int BrakeDelays = 0; /*nastawy mozliwe do uzyskania*/
|
||||
@@ -1084,6 +1084,7 @@ public:
|
||||
bool DecManualBrakeLevel(int CtrlSpeed);
|
||||
bool DynamicBrakeSwitch(bool Switch);
|
||||
bool RadiostopSwitch(bool Switch);
|
||||
bool AlarmChainSwitch( bool const State );
|
||||
bool AntiSlippingBrake(void);
|
||||
bool BrakeReleaser(int state);
|
||||
bool SwitchEPBrake(int state);
|
||||
|
||||
@@ -1082,7 +1082,7 @@ void TMoverParameters::CollisionDetect(int CouplerN, double dt)
|
||||
EventFlag = true;
|
||||
|
||||
if ((coupler.CouplingFlag & ctrain_pneumatic) == ctrain_pneumatic)
|
||||
EmergencyBrakeFlag = true; // hamowanie nagle - zerwanie przewodow hamulcowych
|
||||
AlarmChainFlag = true; // hamowanie nagle - zerwanie przewodow hamulcowych
|
||||
coupler.CouplingFlag = 0;
|
||||
|
||||
switch (CouplerN) // wyzerowanie flag podlaczenia ale ciagle sa wirtualnie polaczone
|
||||
@@ -2780,31 +2780,46 @@ bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
||||
bool TMoverParameters::RadiostopSwitch(bool Switch)
|
||||
{
|
||||
bool EBS;
|
||||
if ((BrakeSystem != Individual) && (BrakeCtrlPosNo > 0))
|
||||
{
|
||||
if ((!RadioStopFlag) && Switch)
|
||||
{
|
||||
if( ( BrakeSystem != Individual )
|
||||
&& ( BrakeCtrlPosNo > 0 ) ) {
|
||||
|
||||
if( ( true == Switch )
|
||||
&& ( false == RadioStopFlag ) ) {
|
||||
RadioStopFlag = Switch;
|
||||
EBS = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((abs(V) < 0.1) &&
|
||||
(Switch == false)) // odblokowanie hamulca bezpieczenistwa tylko po zatrzymaniu
|
||||
{
|
||||
else {
|
||||
if( ( Switch == false )
|
||||
&& ( std::abs( V ) < 0.1 ) ) {
|
||||
// odblokowanie hamulca bezpieczenistwa tylko po zatrzymaniu
|
||||
RadioStopFlag = Switch;
|
||||
EBS = true;
|
||||
}
|
||||
else
|
||||
else {
|
||||
EBS = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
EBS = false; // nie ma hamulca bezpieczenstwa gdy nie ma hamulca zesp.
|
||||
else {
|
||||
// nie ma hamulca bezpieczenstwa gdy nie ma hamulca zesp.
|
||||
EBS = false;
|
||||
}
|
||||
|
||||
return EBS;
|
||||
}
|
||||
|
||||
bool TMoverParameters::AlarmChainSwitch( bool const State ) {
|
||||
|
||||
bool stateswitched { false };
|
||||
|
||||
if( AlarmChainFlag != State ) {
|
||||
// simple routine for the time being
|
||||
AlarmChainFlag = State;
|
||||
stateswitched = true;
|
||||
}
|
||||
return stateswitched;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// hamowanie przeciwpoślizgowe
|
||||
@@ -3282,12 +3297,19 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
Pipe2->Flow(dpMainValve);
|
||||
}
|
||||
|
||||
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then //ulepszony hamulec bezp.
|
||||
if ((RadioStopFlag) || (TestFlag(SecuritySystem.Status, s_SHPebrake)) ||
|
||||
(TestFlag(SecuritySystem.Status, s_CAebrake)) ||
|
||||
(s_CAtestebrake == true) ||
|
||||
(TestFlag(EngDmgFlag, 32)) /* or (not Battery)*/) // ulepszony hamulec bezp.
|
||||
dpMainValve = dpMainValve + PF(0, PipePress, 0.15) * dt;
|
||||
// ulepszony hamulec bezp.
|
||||
if( ( true == RadioStopFlag )
|
||||
|| ( true == AlarmChainFlag )
|
||||
|| ( true == TestFlag( SecuritySystem.Status, s_SHPebrake ) )
|
||||
|| ( true == TestFlag( SecuritySystem.Status, s_CAebrake ) )
|
||||
/*
|
||||
// NOTE: disabled because 32 is 'load destroyed' flag, what does this have to do with emergency brake?
|
||||
// (if it's supposed to be broken coupler, such event sets alarmchainflag instead when appropriate)
|
||||
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
||||
*/
|
||||
|| ( true == s_CAtestebrake ) ) {
|
||||
dpMainValve = dpMainValve + PF( 0, PipePress, 0.15 ) * dt;
|
||||
}
|
||||
// 0.2*Spg
|
||||
Pipe->Flow(-dpMainValve);
|
||||
Pipe->Flow(-(PipePress)*0.001 * dt);
|
||||
|
||||
Reference in New Issue
Block a user