mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 00:29:19 +02:00
control for overload relays, wheelspin brakes and sander, horns, radio, pantograph compressor. added basic air leaks for braking system
This commit is contained in:
@@ -87,6 +87,10 @@ bool TGauge::Load(cParser &Parser, TModel3d *md1, TModel3d *md2, double mul)
|
|||||||
>> val5;
|
>> val5;
|
||||||
val3 *= mul;
|
val3 *= mul;
|
||||||
TSubModel *sm = md1->GetFromName( str1.c_str() );
|
TSubModel *sm = md1->GetFromName( str1.c_str() );
|
||||||
|
if( val3 == 0.0 ) {
|
||||||
|
ErrorLog( "Scale of 0.0 defined for sub-model \"" + str1 + "\" in 3d model \"" + md1->NameGet() + "\". Forcing scale of 1.0 to prevent division by 0" );
|
||||||
|
val3 = 1.0;
|
||||||
|
}
|
||||||
if (sm) // jeśli nie znaleziony
|
if (sm) // jeśli nie znaleziony
|
||||||
md2 = NULL; // informacja, że znaleziony
|
md2 = NULL; // informacja, że znaleziony
|
||||||
else if (md2) // a jest podany drugi model (np. zewnętrzny)
|
else if (md2) // a jest podany drugi model (np. zewnętrzny)
|
||||||
|
|||||||
2
Logs.cpp
2
Logs.cpp
@@ -21,7 +21,7 @@ char endstring[10] = "\n";
|
|||||||
std::string filename_date() {
|
std::string filename_date() {
|
||||||
|
|
||||||
::SYSTEMTIME st;
|
::SYSTEMTIME st;
|
||||||
::GetSystemTime( &st );
|
::GetLocalTime( &st );
|
||||||
char buffer[ 256 ];
|
char buffer[ 256 ];
|
||||||
sprintf( buffer,
|
sprintf( buffer,
|
||||||
"%d%02d%02d_%02d%02d",
|
"%d%02d%02d_%02d%02d",
|
||||||
|
|||||||
@@ -2843,6 +2843,9 @@ void TMoverParameters::UpdateBrakePressure(double dt)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
void TMoverParameters::CompressorCheck(double dt)
|
void TMoverParameters::CompressorCheck(double dt)
|
||||||
{
|
{
|
||||||
|
// TODO: expose leak rate as a parameter to the .fiz file
|
||||||
|
CompressedVolume = std::max( 0.0, CompressedVolume - dt * 0.001 ); // nieszczelności: 0.001=1l/s
|
||||||
|
|
||||||
// if (CompressorSpeed>0.0) then //ten warunek został sprawdzony przy wywołaniu funkcji
|
// if (CompressorSpeed>0.0) then //ten warunek został sprawdzony przy wywołaniu funkcji
|
||||||
if (VeselVolume > 0)
|
if (VeselVolume > 0)
|
||||||
{
|
{
|
||||||
@@ -2965,6 +2968,9 @@ void TMoverParameters::CompressorCheck(double dt)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
void TMoverParameters::UpdatePipePressure(double dt)
|
void TMoverParameters::UpdatePipePressure(double dt)
|
||||||
{
|
{
|
||||||
|
// TODO: expose leak rate as a parameter to the .fiz file
|
||||||
|
PipePress = std::max( 0.0, PipePress - dt * 0.001 ); // nieszczelności: 0.001=1l/s
|
||||||
|
|
||||||
const double LBDelay = 100;
|
const double LBDelay = 100;
|
||||||
const double kL = 0.5;
|
const double kL = 0.5;
|
||||||
//double dV;
|
//double dV;
|
||||||
@@ -3139,7 +3145,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
// temp = (Handle as TFVel6).GetCP
|
// temp = (Handle as TFVel6).GetCP
|
||||||
temp = Handle->GetCP();
|
temp = Handle->GetCP();
|
||||||
else
|
else
|
||||||
temp = 0;
|
temp = 0.0;
|
||||||
Hamulec->SetEPS(temp);
|
Hamulec->SetEPS(temp);
|
||||||
SendCtrlToNext("Brake", temp,
|
SendCtrlToNext("Brake", temp,
|
||||||
CabNo); // Ra 2014-11: na tym się wysypuje, ale nie wiem, w jakich warunkach
|
CabNo); // Ra 2014-11: na tym się wysypuje, ale nie wiem, w jakich warunkach
|
||||||
@@ -3148,9 +3154,9 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
Pipe->Act();
|
Pipe->Act();
|
||||||
PipePress = Pipe->P();
|
PipePress = Pipe->P();
|
||||||
if ((BrakeStatus & 128) == 128) // jesli hamulec wyłączony
|
if ((BrakeStatus & 128) == 128) // jesli hamulec wyłączony
|
||||||
temp = 0; // odetnij
|
temp = 0.0; // odetnij
|
||||||
else
|
else
|
||||||
temp = 1; // połącz
|
temp = 1.0; // połącz
|
||||||
Pipe->Flow(temp * Hamulec->GetPF(temp * PipePress, dt, Vel) + GetDVc(dt));
|
Pipe->Flow(temp * Hamulec->GetPF(temp * PipePress, dt, Vel) + GetDVc(dt));
|
||||||
|
|
||||||
if (ASBType == 128)
|
if (ASBType == 128)
|
||||||
@@ -3162,17 +3168,17 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
Pipe->Act();
|
Pipe->Act();
|
||||||
PipePress = Pipe->P();
|
PipePress = Pipe->P();
|
||||||
|
|
||||||
dpMainValve = dpMainValve / (100 * dt); // normalizacja po czasie do syczenia;
|
dpMainValve = dpMainValve / (100.0 * dt); // normalizacja po czasie do syczenia;
|
||||||
|
|
||||||
if (PipePress < -1)
|
if (PipePress < -1.0)
|
||||||
{
|
{
|
||||||
PipePress = -1;
|
PipePress = -1.0;
|
||||||
Pipe->CreatePress(-1);
|
Pipe->CreatePress(-1.0);
|
||||||
Pipe->Act();
|
Pipe->Act();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CompressedVolume < 0)
|
if (CompressedVolume < 0.0)
|
||||||
CompressedVolume = 0;
|
CompressedVolume = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
@@ -3181,6 +3187,9 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
void TMoverParameters::UpdateScndPipePressure(double dt)
|
void TMoverParameters::UpdateScndPipePressure(double dt)
|
||||||
{
|
{
|
||||||
|
// TODO: expose leak rate as a parameter to the .fiz file
|
||||||
|
ScndPipePress = std::max( 0.0, ScndPipePress - dt * 0.001 ); // nieszczelności: 0.001=0.1l/s
|
||||||
|
|
||||||
const double Spz = 0.5067;
|
const double Spz = 0.5067;
|
||||||
TMoverParameters *c;
|
TMoverParameters *c;
|
||||||
double dv1, dv2, dV;
|
double dv1, dv2, dV;
|
||||||
|
|||||||
17
Train.h
17
Train.h
@@ -120,6 +120,7 @@ class TTrain
|
|||||||
static void OnCommand_secondcontrollerdecrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_secondcontrollerdecrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_secondcontrollerdecreasefast( TTrain *Train, command_data const &Command );
|
static void OnCommand_secondcontrollerdecreasefast( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_notchingrelaytoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_notchingrelaytoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_mucurrentindicatorsourcetoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_independentbrakeincrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_independentbrakeincrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_independentbrakeincreasefast( TTrain *Train, command_data const &Command );
|
static void OnCommand_independentbrakeincreasefast( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_independentbrakedecrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_independentbrakedecrease( TTrain *Train, command_data const &Command );
|
||||||
@@ -133,21 +134,28 @@ class TTrain
|
|||||||
static void OnCommand_trainbrakeservice( TTrain *Train, command_data const &Command );
|
static void OnCommand_trainbrakeservice( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_trainbrakefullservice( TTrain *Train, command_data const &Command );
|
static void OnCommand_trainbrakefullservice( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_trainbrakeemergency( TTrain *Train, command_data const &Command );
|
static void OnCommand_trainbrakeemergency( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_wheelspinbrakeactivate( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_sandboxactivate( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_brakeactingspeedincrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_brakeactingspeedincrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_brakeactingspeeddecrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_brakeactingspeeddecrease( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_mubrakingindicatortoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_reverserincrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_reverserincrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_reverserdecrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_reverserdecrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_alerteracknowledge( TTrain *Train, command_data const &Command );
|
static void OnCommand_alerteracknowledge( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_batterytoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_batterytoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_pantographcompressorvalvetoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_pantographcompressoractivate( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_pantographtogglefront( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographtogglefront( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_pantographtogglerear( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographtogglerear( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_pantographlowerall( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographlowerall( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_linebreakertoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_linebreakertoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_convertertoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_convertertoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_converteroverloadrelayreset( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_compressortoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_compressortoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_motorconnectorsopen( TTrain *Train, command_data const &Command );
|
static void OnCommand_motorconnectorsopen( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_motoroverloadrelaythresholdtoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_motoroverloadrelaythresholdtoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_motoroverloadrelayreset( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_heatingtoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_heatingtoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlighttoggleleft( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttoggleleft( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlighttoggleright( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttoggleright( TTrain *Train, command_data const &Command );
|
||||||
@@ -159,13 +167,17 @@ class TTrain
|
|||||||
static void OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightsdimtoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_interiorlighttoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_interiorlighttoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_interiorlightdimtoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_interiorlightdimtoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_instrumentlighttoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_instrumentlighttoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_doorlocktoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_doortoggleleft( TTrain *Train, command_data const &Command );
|
static void OnCommand_doortoggleleft( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_doortoggleright( TTrain *Train, command_data const &Command );
|
static void OnCommand_doortoggleright( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_departureannounce( TTrain *Train, command_data const &Command );
|
static void OnCommand_departureannounce( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_doorlocktoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_hornlowactivate( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_hornhighactivate( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_radiotoggle( TTrain *Train, command_data const &Command );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
TDynamicObject *DynamicObject; // przestawia zmiana pojazdu [F5]
|
TDynamicObject *DynamicObject; // przestawia zmiana pojazdu [F5]
|
||||||
@@ -222,8 +234,7 @@ public: // reszta może by?publiczna
|
|||||||
TGauge ggSandButton; // guzik piasecznicy
|
TGauge ggSandButton; // guzik piasecznicy
|
||||||
TGauge ggAntiSlipButton;
|
TGauge ggAntiSlipButton;
|
||||||
TGauge ggFuseButton;
|
TGauge ggFuseButton;
|
||||||
TGauge ggConverterFuseButton; // hunter-261211: przycisk odblokowania
|
TGauge ggConverterFuseButton; // hunter-261211: przycisk odblokowania nadmiarowego przetwornic i ogrzewania
|
||||||
// nadmiarowego przetwornic i ogrzewania
|
|
||||||
TGauge ggStLinOffButton;
|
TGauge ggStLinOffButton;
|
||||||
TGauge ggRadioButton;
|
TGauge ggRadioButton;
|
||||||
TGauge ggUpperLightButton;
|
TGauge ggUpperLightButton;
|
||||||
|
|||||||
47
command.cpp
47
command.cpp
@@ -27,6 +27,7 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "secondcontrollerincreasefast", command_target::vehicle },
|
{ "secondcontrollerincreasefast", command_target::vehicle },
|
||||||
{ "secondcontrollerdecrease", command_target::vehicle },
|
{ "secondcontrollerdecrease", command_target::vehicle },
|
||||||
{ "secondcontrollerdecreasefast", command_target::vehicle },
|
{ "secondcontrollerdecreasefast", command_target::vehicle },
|
||||||
|
{ "mucurrentindicatorsourcetoggle", command_target::vehicle },
|
||||||
{ "independentbrakeincrease", command_target::vehicle },
|
{ "independentbrakeincrease", command_target::vehicle },
|
||||||
{ "independentbrakeincreasefast", command_target::vehicle },
|
{ "independentbrakeincreasefast", command_target::vehicle },
|
||||||
{ "independentbrakedecrease", command_target::vehicle },
|
{ "independentbrakedecrease", command_target::vehicle },
|
||||||
@@ -40,30 +41,26 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "trainbrakeservice", command_target::vehicle },
|
{ "trainbrakeservice", command_target::vehicle },
|
||||||
{ "trainbrakefullservice", command_target::vehicle },
|
{ "trainbrakefullservice", command_target::vehicle },
|
||||||
{ "trainbrakeemergency", command_target::vehicle },
|
{ "trainbrakeemergency", command_target::vehicle },
|
||||||
/*
|
{ "wheelspinbrakeactivate", command_target::vehicle },
|
||||||
const int k_AntiSlipping = 21;
|
{ "sandboxactivate", command_target::vehicle },
|
||||||
const int k_Sand = 22;
|
|
||||||
*/
|
|
||||||
{ "reverserincrease", command_target::vehicle },
|
{ "reverserincrease", command_target::vehicle },
|
||||||
{ "reverserdecrease", command_target::vehicle },
|
{ "reverserdecrease", command_target::vehicle },
|
||||||
{ "linebreakertoggle", command_target::vehicle },
|
{ "linebreakertoggle", command_target::vehicle },
|
||||||
/*
|
|
||||||
const int k_Fuse = 26;
|
|
||||||
*/
|
|
||||||
{ "convertertoggle", command_target::vehicle },
|
{ "convertertoggle", command_target::vehicle },
|
||||||
|
{ "converteroverloadrelayreset", command_target::vehicle },
|
||||||
{ "compressortoggle", command_target::vehicle },
|
{ "compressortoggle", command_target::vehicle },
|
||||||
{ "motoroverloadrelaythresholdtoggle", command_target::vehicle },
|
{ "motoroverloadrelaythresholdtoggle", command_target::vehicle },
|
||||||
|
{ "motoroverloadrelayreset", command_target::vehicle },
|
||||||
{ "notchingrelaytoggle", command_target::vehicle },
|
{ "notchingrelaytoggle", command_target::vehicle },
|
||||||
{ "epbrakecontroltoggle", command_target::vehicle },
|
{ "epbrakecontroltoggle", command_target::vehicle },
|
||||||
{ "brakeactingspeedincrease", command_target::vehicle },
|
{ "brakeactingspeedincrease", command_target::vehicle },
|
||||||
{ "brakeactingspeeddecrease", command_target::vehicle },
|
{ "brakeactingspeeddecrease", command_target::vehicle },
|
||||||
/*
|
{ "mubrakingindicatortoggle", command_target::vehicle },
|
||||||
const int k_BrakeProfile = 31;
|
|
||||||
*/
|
|
||||||
{ "alerteracknowledge", command_target::vehicle },
|
{ "alerteracknowledge", command_target::vehicle },
|
||||||
|
{ "hornlowactivate", command_target::vehicle },
|
||||||
|
{ "hornhighctivate", command_target::vehicle },
|
||||||
|
{ "radiotoggle", command_target::vehicle },
|
||||||
/*
|
/*
|
||||||
const int k_Horn = 33;
|
|
||||||
const int k_Horn2 = 34;
|
|
||||||
const int k_FailedEngineCutOff = 35;
|
const int k_FailedEngineCutOff = 35;
|
||||||
*/
|
*/
|
||||||
{ "viewturn", command_target::entity },
|
{ "viewturn", command_target::entity },
|
||||||
@@ -93,6 +90,8 @@ const int k_ProgramHelp = 48;
|
|||||||
{ "doortoggleright", command_target::vehicle },
|
{ "doortoggleright", command_target::vehicle },
|
||||||
{ "departureannounce", command_target::vehicle },
|
{ "departureannounce", command_target::vehicle },
|
||||||
{ "doorlocktoggle", command_target::vehicle },
|
{ "doorlocktoggle", command_target::vehicle },
|
||||||
|
{ "pantographcompressorvalvetoggle", command_target::vehicle },
|
||||||
|
{ "pantographcompressoractivate", command_target::vehicle },
|
||||||
{ "pantographtogglefront", command_target::vehicle },
|
{ "pantographtogglefront", command_target::vehicle },
|
||||||
{ "pantographtogglerear", command_target::vehicle },
|
{ "pantographtogglerear", command_target::vehicle },
|
||||||
{ "pantographlowerall", command_target::vehicle },
|
{ "pantographlowerall", command_target::vehicle },
|
||||||
@@ -110,13 +109,8 @@ const int k_ProgramHelp = 48;
|
|||||||
{ "headlighttogglerearupper", command_target::vehicle },
|
{ "headlighttogglerearupper", command_target::vehicle },
|
||||||
{ "redmarkertogglerearleft", command_target::vehicle },
|
{ "redmarkertogglerearleft", command_target::vehicle },
|
||||||
{ "redmarkertogglerearright", command_target::vehicle },
|
{ "redmarkertogglerearright", command_target::vehicle },
|
||||||
/*
|
{ "headlightsdimtoggle", command_target::vehicle },
|
||||||
const int k_SmallCompressor = 63;
|
|
||||||
*/
|
|
||||||
{ "motorconnectorsopen", command_target::vehicle },
|
{ "motorconnectorsopen", command_target::vehicle },
|
||||||
/*
|
|
||||||
const int k_CurrentNext = 65;
|
|
||||||
*/
|
|
||||||
{ "interiorlighttoggle", command_target::vehicle },
|
{ "interiorlighttoggle", command_target::vehicle },
|
||||||
{ "interiorlightdimtoggle", command_target::vehicle },
|
{ "interiorlightdimtoggle", command_target::vehicle },
|
||||||
{ "instrumentlighttoggle", command_target::vehicle },
|
{ "instrumentlighttoggle", command_target::vehicle },
|
||||||
@@ -131,7 +125,6 @@ const int k_Active = 71;
|
|||||||
{ "batterytoggle", command_target::vehicle }
|
{ "batterytoggle", command_target::vehicle }
|
||||||
/*
|
/*
|
||||||
const int k_WalkMode = 73;
|
const int k_WalkMode = 73;
|
||||||
int const k_DimHeadlights = 74;
|
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -192,9 +185,25 @@ command_relay::post( user_command const Command, std::uint64_t const Param1, std
|
|||||||
if( Action != GLFW_RELEASE ) {
|
if( Action != GLFW_RELEASE ) {
|
||||||
// key was pressed or is still held
|
// key was pressed or is still held
|
||||||
if( false == command.name.empty() ) {
|
if( false == command.name.empty() ) {
|
||||||
|
if( false == (
|
||||||
|
( Command == user_command::moveleft )
|
||||||
|
|| ( Command == user_command::moveleftfast )
|
||||||
|
|| ( Command == user_command::moveright )
|
||||||
|
|| ( Command == user_command::moverightfast )
|
||||||
|
|| ( Command == user_command::moveforward )
|
||||||
|
|| ( Command == user_command::moveforwardfast )
|
||||||
|
|| ( Command == user_command::moveback )
|
||||||
|
|| ( Command == user_command::movebackfast )
|
||||||
|
|| ( Command == user_command::moveup )
|
||||||
|
|| ( Command == user_command::moveupfast )
|
||||||
|
|| ( Command == user_command::movedown )
|
||||||
|
|| ( Command == user_command::movedownfast )
|
||||||
|
|| ( Command == user_command::movevector )
|
||||||
|
|| ( Command == user_command::viewturn ) ) ) {
|
||||||
WriteLog( "Command issued: " + command.name );
|
WriteLog( "Command issued: " + command.name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
else {
|
else {
|
||||||
// key was released (but we don't log this)
|
// key was released (but we don't log this)
|
||||||
|
|||||||
28
command.h
28
command.h
@@ -22,6 +22,7 @@ enum class user_command {
|
|||||||
secondcontrollerincreasefast,
|
secondcontrollerincreasefast,
|
||||||
secondcontrollerdecrease,
|
secondcontrollerdecrease,
|
||||||
secondcontrollerdecreasefast,
|
secondcontrollerdecreasefast,
|
||||||
|
mucurrentindicatorsourcetoggle,
|
||||||
independentbrakeincrease,
|
independentbrakeincrease,
|
||||||
independentbrakeincreasefast,
|
independentbrakeincreasefast,
|
||||||
independentbrakedecrease,
|
independentbrakedecrease,
|
||||||
@@ -35,27 +36,26 @@ enum class user_command {
|
|||||||
trainbrakeservice,
|
trainbrakeservice,
|
||||||
trainbrakefullservice,
|
trainbrakefullservice,
|
||||||
trainbrakeemergency,
|
trainbrakeemergency,
|
||||||
/*
|
wheelspinbrakeactivate,
|
||||||
const int k_AntiSlipping = 21;
|
sandboxactivate,
|
||||||
const int k_Sand = 22;
|
|
||||||
*/
|
|
||||||
reverserincrease,
|
reverserincrease,
|
||||||
reverserdecrease,
|
reverserdecrease,
|
||||||
linebreakertoggle,
|
linebreakertoggle,
|
||||||
/*
|
|
||||||
const int k_Fuse = 26;
|
|
||||||
*/
|
|
||||||
convertertoggle,
|
convertertoggle,
|
||||||
|
converteroverloadrelayreset,
|
||||||
compressortoggle,
|
compressortoggle,
|
||||||
motoroverloadrelaythresholdtoggle,
|
motoroverloadrelaythresholdtoggle,
|
||||||
|
motoroverloadrelayreset,
|
||||||
notchingrelaytoggle,
|
notchingrelaytoggle,
|
||||||
epbrakecontroltoggle,
|
epbrakecontroltoggle,
|
||||||
brakeactingspeedincrease,
|
brakeactingspeedincrease,
|
||||||
brakeactingspeeddecrease,
|
brakeactingspeeddecrease,
|
||||||
|
mubrakingindicatortoggle,
|
||||||
alerteracknowledge,
|
alerteracknowledge,
|
||||||
|
hornlowactivate,
|
||||||
|
hornhighactivate,
|
||||||
|
radiotoggle,
|
||||||
/*
|
/*
|
||||||
const int k_Horn = 33;
|
|
||||||
const int k_Horn2 = 34;
|
|
||||||
const int k_FailedEngineCutOff = 35;
|
const int k_FailedEngineCutOff = 35;
|
||||||
*/
|
*/
|
||||||
viewturn,
|
viewturn,
|
||||||
@@ -85,6 +85,8 @@ const int k_ProgramHelp = 48;
|
|||||||
doortoggleright,
|
doortoggleright,
|
||||||
departureannounce,
|
departureannounce,
|
||||||
doorlocktoggle,
|
doorlocktoggle,
|
||||||
|
pantographcompressorvalvetoggle,
|
||||||
|
pantographcompressoractivate,
|
||||||
pantographtogglefront,
|
pantographtogglefront,
|
||||||
pantographtogglerear,
|
pantographtogglerear,
|
||||||
pantographlowerall,
|
pantographlowerall,
|
||||||
@@ -102,13 +104,8 @@ const int k_ProgramHelp = 48;
|
|||||||
headlighttogglerearupper,
|
headlighttogglerearupper,
|
||||||
redmarkertogglerearleft,
|
redmarkertogglerearleft,
|
||||||
redmarkertogglerearright,
|
redmarkertogglerearright,
|
||||||
/*
|
headlightsdimtoggle,
|
||||||
const int k_SmallCompressor = 63;
|
|
||||||
*/
|
|
||||||
motorconnectorsopen,
|
motorconnectorsopen,
|
||||||
/*
|
|
||||||
const int k_CurrentNext = 65;
|
|
||||||
*/
|
|
||||||
interiorlighttoggle,
|
interiorlighttoggle,
|
||||||
interiorlightdimtoggle,
|
interiorlightdimtoggle,
|
||||||
instrumentlighttoggle,
|
instrumentlighttoggle,
|
||||||
@@ -123,7 +120,6 @@ const int k_Active = 71;
|
|||||||
batterytoggle
|
batterytoggle
|
||||||
/*
|
/*
|
||||||
const int k_WalkMode = 73;
|
const int k_WalkMode = 73;
|
||||||
int const k_DimHeadlights = 74;
|
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ keyboard_input::default_bindings() {
|
|||||||
{ GLFW_KEY_KP_MULTIPLY },
|
{ GLFW_KEY_KP_MULTIPLY },
|
||||||
// secondcontrollerdecreasefast
|
// secondcontrollerdecreasefast
|
||||||
{ GLFW_KEY_KP_MULTIPLY | keymodifier::shift },
|
{ GLFW_KEY_KP_MULTIPLY | keymodifier::shift },
|
||||||
|
// mucurrentindicatorsourcetoggle
|
||||||
|
{ GLFW_KEY_Z | keymodifier::shift },
|
||||||
// independentbrakeincrease
|
// independentbrakeincrease
|
||||||
{ GLFW_KEY_KP_1 },
|
{ GLFW_KEY_KP_1 },
|
||||||
// independentbrakeincreasefast
|
// independentbrakeincreasefast
|
||||||
@@ -134,25 +136,26 @@ keyboard_input::default_bindings() {
|
|||||||
{ GLFW_KEY_KP_2 },
|
{ GLFW_KEY_KP_2 },
|
||||||
// trainbrakeemergency
|
// trainbrakeemergency
|
||||||
{ GLFW_KEY_KP_0 },
|
{ GLFW_KEY_KP_0 },
|
||||||
/*
|
// wheelspinbrakeactivate,
|
||||||
const int k_AntiSlipping = 21;
|
{ GLFW_KEY_KP_ENTER },
|
||||||
const int k_Sand = 22;
|
// sandboxactivate,
|
||||||
*/
|
{ GLFW_KEY_S },
|
||||||
// reverserincrease
|
// reverserincrease
|
||||||
{ GLFW_KEY_D },
|
{ GLFW_KEY_D },
|
||||||
// reverserdecrease
|
// reverserdecrease
|
||||||
{ GLFW_KEY_R },
|
{ GLFW_KEY_R },
|
||||||
// linebreakertoggle
|
// linebreakertoggle
|
||||||
{ GLFW_KEY_M },
|
{ GLFW_KEY_M },
|
||||||
/*
|
|
||||||
const int k_Fuse = 26;
|
|
||||||
*/
|
|
||||||
// convertertoggle
|
// convertertoggle
|
||||||
{ GLFW_KEY_X },
|
{ GLFW_KEY_X },
|
||||||
|
// converteroverloadrelayreset
|
||||||
|
{ GLFW_KEY_N | keymodifier::control },
|
||||||
// compressortoggle
|
// compressortoggle
|
||||||
{ GLFW_KEY_C },
|
{ GLFW_KEY_C },
|
||||||
// motoroverloadrelaythresholdtoggle
|
// motoroverloadrelaythresholdtoggle
|
||||||
{ GLFW_KEY_F },
|
{ GLFW_KEY_F },
|
||||||
|
// motoroverloadrelayreset
|
||||||
|
{ GLFW_KEY_N },
|
||||||
// notchingrelaytoggle
|
// notchingrelaytoggle
|
||||||
{ GLFW_KEY_G },
|
{ GLFW_KEY_G },
|
||||||
// epbrakecontroltoggle
|
// epbrakecontroltoggle
|
||||||
@@ -161,14 +164,17 @@ const int k_Fuse = 26;
|
|||||||
{ GLFW_KEY_B | keymodifier::shift },
|
{ GLFW_KEY_B | keymodifier::shift },
|
||||||
// brakeactingspeeddecrease
|
// brakeactingspeeddecrease
|
||||||
{ GLFW_KEY_B },
|
{ GLFW_KEY_B },
|
||||||
/*
|
// brakingindicatortoggle
|
||||||
const int k_BrakeProfile = 31;
|
{ GLFW_KEY_L | keymodifier::shift },
|
||||||
*/
|
|
||||||
// alerteracknowledge
|
// alerteracknowledge
|
||||||
{ GLFW_KEY_SPACE },
|
{ GLFW_KEY_SPACE },
|
||||||
|
// hornlowactivate
|
||||||
|
{ GLFW_KEY_A },
|
||||||
|
// hornhighactivate
|
||||||
|
{ GLFW_KEY_A | keymodifier::shift },
|
||||||
|
// radiotoggle
|
||||||
|
{ GLFW_KEY_R | keymodifier::control },
|
||||||
/*
|
/*
|
||||||
const int k_Horn = 33;
|
|
||||||
const int k_Horn2 = 34;
|
|
||||||
const int k_FailedEngineCutOff = 35;
|
const int k_FailedEngineCutOff = 35;
|
||||||
*/
|
*/
|
||||||
// viewturn
|
// viewturn
|
||||||
@@ -216,6 +222,10 @@ const int k_ProgramHelp = 48;
|
|||||||
{ GLFW_KEY_SLASH },
|
{ GLFW_KEY_SLASH },
|
||||||
// doorlocktoggle
|
// doorlocktoggle
|
||||||
{ GLFW_KEY_S | keymodifier::shift },
|
{ GLFW_KEY_S | keymodifier::shift },
|
||||||
|
// pantographcompressorvalvetoggle
|
||||||
|
{ GLFW_KEY_V | keymodifier::control },
|
||||||
|
// pantographcompressoractivate
|
||||||
|
{ GLFW_KEY_V | keymodifier::shift },
|
||||||
// pantographtogglefront
|
// pantographtogglefront
|
||||||
{ GLFW_KEY_P },
|
{ GLFW_KEY_P },
|
||||||
// pantographtogglerear
|
// pantographtogglerear
|
||||||
@@ -247,14 +257,10 @@ const int k_ProgramHelp = 48;
|
|||||||
{ GLFW_KEY_Y | keymodifier::control | keymodifier::shift },
|
{ GLFW_KEY_Y | keymodifier::control | keymodifier::shift },
|
||||||
// redmarkertogglerearright
|
// redmarkertogglerearright
|
||||||
{ GLFW_KEY_I | keymodifier::control | keymodifier::shift },
|
{ GLFW_KEY_I | keymodifier::control | keymodifier::shift },
|
||||||
/*
|
// headlightsdimtoggle
|
||||||
const int k_SmallCompressor = 63;
|
{ GLFW_KEY_L | keymodifier::control },
|
||||||
*/
|
|
||||||
// motorconnectorsopen
|
// motorconnectorsopen
|
||||||
{ GLFW_KEY_L },
|
{ GLFW_KEY_L },
|
||||||
/*
|
|
||||||
const int k_CurrentNext = 65;
|
|
||||||
*/
|
|
||||||
// interiorlighttoggle
|
// interiorlighttoggle
|
||||||
{ GLFW_KEY_APOSTROPHE },
|
{ GLFW_KEY_APOSTROPHE },
|
||||||
// interiorlightdimtoggle
|
// interiorlightdimtoggle
|
||||||
@@ -273,7 +279,6 @@ const int k_Active = 71;
|
|||||||
{ GLFW_KEY_J }
|
{ GLFW_KEY_J }
|
||||||
/*
|
/*
|
||||||
const int k_WalkMode = 73;
|
const int k_WalkMode = 73;
|
||||||
int const k_DimHeadlights = 74;
|
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ LONG CALLBACK unhandled_handler(::EXCEPTION_POINTERS* e)
|
|||||||
{
|
{
|
||||||
auto nameEnd = name + ::GetModuleFileNameA(::GetModuleHandleA(0), name, MAX_PATH);
|
auto nameEnd = name + ::GetModuleFileNameA(::GetModuleHandleA(0), name, MAX_PATH);
|
||||||
::SYSTEMTIME t;
|
::SYSTEMTIME t;
|
||||||
::GetSystemTime(&t);
|
::GetLocalTime(&t);
|
||||||
wsprintfA(nameEnd - strlen(".exe"),
|
wsprintfA(nameEnd - strlen(".exe"),
|
||||||
"_crashdump_%4d%02d%02d_%02d%02d%02d.dmp",
|
"_crashdump_%4d%02d%02d_%02d%02d%02d.dmp",
|
||||||
t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond);
|
t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond);
|
||||||
|
|||||||
Reference in New Issue
Block a user