mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 12:49:18 +02:00
Merge remote-tracking branch 'youby/master' into sim
This commit is contained in:
36
Driver.cpp
36
Driver.cpp
@@ -1095,7 +1095,7 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
|||||||
bool
|
bool
|
||||||
TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, double const Signaldistance ) {
|
TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, double const Signaldistance ) {
|
||||||
// stop points are irrelevant when not in one of the basic modes
|
// stop points are irrelevant when not in one of the basic modes
|
||||||
if( ( OrderCurrentGet() & ( /*Shunt | Loose_shunt |*/ Obey_train | Bank ) ) == 0 ) { return true; }
|
if( ( OrderCurrentGet() & ( Shunt | Loose_shunt | Obey_train | Bank ) ) == 0 ) { return true; }
|
||||||
// jeśli przystanek, trzeba obsłużyć wg rozkładu
|
// jeśli przystanek, trzeba obsłużyć wg rozkładu
|
||||||
iDrivigFlags |= moveStopPointFound;
|
iDrivigFlags |= moveStopPointFound;
|
||||||
// first 19 chars of the command is expected to be "PassengerStopPoint:" so we skip them
|
// first 19 chars of the command is expected to be "PassengerStopPoint:" so we skip them
|
||||||
@@ -1338,9 +1338,13 @@ TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, doub
|
|||||||
}
|
}
|
||||||
return true; // nie analizować prędkości
|
return true; // nie analizować prędkości
|
||||||
} // koniec startu z zatrzymania
|
} // koniec startu z zatrzymania
|
||||||
else {
|
else {
|
||||||
cue_action( driver_hint::waitdeparturetime );
|
cue_action(driver_hint::waitdeparturetime);
|
||||||
}
|
if (TrainParams.IsTimeToGo(simulation::Time.data().wHour, simulation::Time.data().wMinute + simulation::Time.data().wSecond*0.0167 + 0.1)) { //if is less than 6 sec to departure
|
||||||
|
iDrivigFlags |= moveGuardOpenDoor;
|
||||||
|
GuardOpenDoor();
|
||||||
|
}
|
||||||
|
}
|
||||||
} // koniec obsługi początkowych stacji
|
} // koniec obsługi początkowych stacji
|
||||||
else {
|
else {
|
||||||
// jeśli dojechaliśmy do końca rozkładu
|
// jeśli dojechaliśmy do końca rozkładu
|
||||||
@@ -6918,6 +6922,7 @@ TController::UpdateObeyTrain() {
|
|||||||
&& ( VelDesired > 0.0 ) ) {
|
&& ( VelDesired > 0.0 ) ) {
|
||||||
// komunikat od kierownika tu, bo musi być wolna droga i odczekany czas stania
|
// komunikat od kierownika tu, bo musi być wolna droga i odczekany czas stania
|
||||||
iDrivigFlags &= ~moveGuardSignal; // tylko raz nadać
|
iDrivigFlags &= ~moveGuardSignal; // tylko raz nadać
|
||||||
|
iDrivigFlags &= ~moveGuardOpenDoor; // nie trzeba już otwierać drzwi
|
||||||
if( false == tsGuardSignal.empty() ) {
|
if( false == tsGuardSignal.empty() ) {
|
||||||
tsGuardSignal.stop();
|
tsGuardSignal.stop();
|
||||||
// w zasadzie to powinien mieć flagę, czy jest dźwiękiem radiowym, czy bezpośrednim
|
// w zasadzie to powinien mieć flagę, czy jest dźwiękiem radiowym, czy bezpośrednim
|
||||||
@@ -7011,6 +7016,29 @@ TController::UpdateConnect() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TController::GuardOpenDoor() {
|
||||||
|
if ((iDrivigFlags & moveGuardOpenDoor) != 0) {
|
||||||
|
auto *vehicle{ pVehicles[end::front] };
|
||||||
|
while (vehicle != nullptr && vehicle->MoverParameters->Doors.range == 0) {
|
||||||
|
vehicle = vehicle->Next();
|
||||||
|
}
|
||||||
|
if (vehicle->MoverParameters->Doors.range > 0) {
|
||||||
|
auto const lewe = (vehicle->DirectionGet() > 0) ? 1 : 2;
|
||||||
|
auto const prawe = 3 - lewe;
|
||||||
|
if (m_lastexchangeplatforms & lewe) {
|
||||||
|
vehicle->MoverParameters->OperateDoors(side::left, true, range_t::local);
|
||||||
|
}
|
||||||
|
if (m_lastexchangeplatforms & prawe) {
|
||||||
|
vehicle->MoverParameters->OperateDoors(side::right, true, range_t::local);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
iDrivigFlags &= ~moveGuardOpenDoor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
TController::unit_count( int const Threshold ) const {
|
TController::unit_count( int const Threshold ) const {
|
||||||
|
|
||||||
|
|||||||
4
Driver.h
4
Driver.h
@@ -74,7 +74,8 @@ enum TMovementStatus
|
|||||||
moveDoorOpened = 0x20000, // drzwi zostały otwarte - doliczyć czas na zamknięcie
|
moveDoorOpened = 0x20000, // drzwi zostały otwarte - doliczyć czas na zamknięcie
|
||||||
movePushPull = 0x40000, // zmiana czoła przez zmianę kabiny - nie odczepiać przy zmianie kierunku
|
movePushPull = 0x40000, // zmiana czoła przez zmianę kabiny - nie odczepiać przy zmianie kierunku
|
||||||
moveSignalFound = 0x80000, // na drodze skanowania został znaleziony semafor
|
moveSignalFound = 0x80000, // na drodze skanowania został znaleziony semafor
|
||||||
moveStopPointFound = 0x100000 // stop point detected ahead
|
moveStopPointFound = 0x100000, // stop point detected ahead
|
||||||
|
moveGuardOpenDoor = 0x200000 // time for opening a door before departure
|
||||||
/*
|
/*
|
||||||
moveSemaphorWasElapsed = 0x100000, // minięty został semafor
|
moveSemaphorWasElapsed = 0x100000, // minięty został semafor
|
||||||
moveTrainInsideStation = 0x200000, // pociąg między semaforem a rozjazdami lub następnym semaforem
|
moveTrainInsideStation = 0x200000, // pociąg między semaforem a rozjazdami lub następnym semaforem
|
||||||
@@ -335,6 +336,7 @@ private:
|
|||||||
void UpdateChangeDirection();
|
void UpdateChangeDirection();
|
||||||
void UpdateLooseShunt();
|
void UpdateLooseShunt();
|
||||||
void UpdateObeyTrain();
|
void UpdateObeyTrain();
|
||||||
|
void GuardOpenDoor();
|
||||||
void pick_optimal_speed( double const Range );
|
void pick_optimal_speed( double const Range );
|
||||||
void adjust_desired_speed_for_obstacles();
|
void adjust_desired_speed_for_obstacles();
|
||||||
void adjust_desired_speed_for_limits();
|
void adjust_desired_speed_for_limits();
|
||||||
|
|||||||
@@ -1318,6 +1318,7 @@ public:
|
|||||||
int InvertersNo = 0; // number of inverters
|
int InvertersNo = 0; // number of inverters
|
||||||
double InvertersRatio = 0.0;
|
double InvertersRatio = 0.0;
|
||||||
std::vector<inverter> Inverters; //all inverters
|
std::vector<inverter> Inverters; //all inverters
|
||||||
|
int InverterControlCouplerFlag = 4; //which coupling flag is necessary to controll inverters
|
||||||
/* -dla pojazdów z blendingiem EP/ED (MED) */
|
/* -dla pojazdów z blendingiem EP/ED (MED) */
|
||||||
double MED_Vmax = 0; // predkosc maksymalna dla obliczen chwilowej sily hamowania EP w MED
|
double MED_Vmax = 0; // predkosc maksymalna dla obliczen chwilowej sily hamowania EP w MED
|
||||||
double MED_Vmin = 0; // predkosc minimalna dla obliczen chwilowej sily hamowania EP w MED
|
double MED_Vmin = 0; // predkosc minimalna dla obliczen chwilowej sily hamowania EP w MED
|
||||||
|
|||||||
@@ -10854,7 +10854,8 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
extract_value( eimc[ eimc_p_abed ], "abed", Input, "" );
|
extract_value( eimc[ eimc_p_abed ], "abed", Input, "" );
|
||||||
extract_value( eimc[ eimc_p_eped ], "edep", Input, "" );
|
extract_value( eimc[ eimc_p_eped ], "edep", Input, "" );
|
||||||
extract_value( EIMCLogForce, "eimclf", Input, "" );
|
extract_value( EIMCLogForce, "eimclf", Input, "" );
|
||||||
extract_value( InvertersNo, "InvNo", Input, "");
|
extract_value( InvertersNo, "InvNo", Input, "" );
|
||||||
|
extract_value( InverterControlCouplerFlag, "InvCtrCplFlag", Input, "" );
|
||||||
|
|
||||||
extract_value( Flat, "Flat", Input, "");
|
extract_value( Flat, "Flat", Input, "");
|
||||||
|
|
||||||
|
|||||||
294
Train.cpp
294
Train.cpp
@@ -90,6 +90,9 @@ bool TTrain::screen_entry::deserialize_mapping( cParser &Input ) {
|
|||||||
else if( key == "target:" ) {
|
else if( key == "target:" ) {
|
||||||
target = Input.getToken<std::string>();
|
target = Input.getToken<std::string>();
|
||||||
}
|
}
|
||||||
|
else if (key == "updatetime:") {
|
||||||
|
updatetime = Input.getToken<int>();
|
||||||
|
}
|
||||||
else if( key == "parameters:" ) {
|
else if( key == "parameters:" ) {
|
||||||
parameters = dictionary_source( Input.getToken<std::string>() );
|
parameters = dictionary_source( Input.getToken<std::string>() );
|
||||||
}
|
}
|
||||||
@@ -451,6 +454,42 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
|||||||
{ user_command::speedcontrolbutton7, &TTrain::OnCommand_speedcontrolbutton },
|
{ user_command::speedcontrolbutton7, &TTrain::OnCommand_speedcontrolbutton },
|
||||||
{ user_command::speedcontrolbutton8, &TTrain::OnCommand_speedcontrolbutton },
|
{ user_command::speedcontrolbutton8, &TTrain::OnCommand_speedcontrolbutton },
|
||||||
{ user_command::speedcontrolbutton9, &TTrain::OnCommand_speedcontrolbutton },
|
{ user_command::speedcontrolbutton9, &TTrain::OnCommand_speedcontrolbutton },
|
||||||
|
{ user_command::inverterenable1, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable2, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable3, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable4, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable5, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable6, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable7, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable8, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable9, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable10, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable11, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterenable12, &TTrain::OnCommand_inverterenable },
|
||||||
|
{ user_command::inverterdisable1, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable2, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable3, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable4, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable5, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable6, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable7, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable8, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable9, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable10, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable11, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::inverterdisable12, &TTrain::OnCommand_inverterdisable },
|
||||||
|
{ user_command::invertertoggle1, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle2, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle3, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle4, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle5, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle6, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle7, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle8, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle9, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle10, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle11, &TTrain::OnCommand_invertertoggle },
|
||||||
|
{ user_command::invertertoggle12, &TTrain::OnCommand_invertertoggle },
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<std::string> const TTrain::fPress_labels = {
|
std::vector<std::string> const TTrain::fPress_labels = {
|
||||||
@@ -500,7 +539,7 @@ TTrain::TTrain() {
|
|||||||
|
|
||||||
for ( int i = 0; i < 20; ++i )
|
for ( int i = 0; i < 20; ++i )
|
||||||
{
|
{
|
||||||
for ( int j = 0; j < 4; ++j )
|
for ( int j = 0; j < 6; ++j )
|
||||||
fPress[i][j] = 0.0;
|
fPress[i][j] = 0.0;
|
||||||
bBrakes[i][0] = bBrakes[i][1] = false;
|
bBrakes[i][0] = bBrakes[i][1] = false;
|
||||||
}
|
}
|
||||||
@@ -650,6 +689,11 @@ dictionary_source *TTrain::GetTrainState( dictionary_source const &Extraparamete
|
|||||||
dict->insert( "distance_counter", m_distancecounter );
|
dict->insert( "distance_counter", m_distancecounter );
|
||||||
dict->insert( "pantpress", std::abs( mvPantographUnit->PantPress ) );
|
dict->insert( "pantpress", std::abs( mvPantographUnit->PantPress ) );
|
||||||
dict->insert( "universal3", InstrumentLightActive );
|
dict->insert( "universal3", InstrumentLightActive );
|
||||||
|
for (auto idx = 0; idx < ggUniversals.size(); idx++) {
|
||||||
|
if (idx != 3) {
|
||||||
|
dict->insert("universal" + std::to_string(idx), (ggUniversals[idx].GetValue() > 0.5));
|
||||||
|
}
|
||||||
|
}
|
||||||
dict->insert( "radio", mvOccupied->Radio );
|
dict->insert( "radio", mvOccupied->Radio );
|
||||||
dict->insert( "radio_channel", RadioChannel() );
|
dict->insert( "radio_channel", RadioChannel() );
|
||||||
dict->insert( "radio_volume", Global.RadioVolume );
|
dict->insert( "radio_volume", Global.RadioVolume );
|
||||||
@@ -671,7 +715,7 @@ dictionary_source *TTrain::GetTrainState( dictionary_source const &Extraparamete
|
|||||||
char const *TXTT[ 10 ] = { "fd", "fdt", "fdb", "pd", "pdt", "pdb", "itothv", "1", "2", "3" };
|
char const *TXTT[ 10 ] = { "fd", "fdt", "fdb", "pd", "pdt", "pdb", "itothv", "1", "2", "3" };
|
||||||
char const *TXTC[ 10 ] = { "fr", "frt", "frb", "pr", "prt", "prb", "im", "vm", "ihv", "uhv" };
|
char const *TXTC[ 10 ] = { "fr", "frt", "frb", "pr", "prt", "prb", "im", "vm", "ihv", "uhv" };
|
||||||
char const *TXTD[ 10 ] = { "enrot", "nrot", "fill_des", "fill_real", "clutch_des", "clutch_real", "water_temp", "oil_press", "engine_temp", "retarder_fill" };
|
char const *TXTD[ 10 ] = { "enrot", "nrot", "fill_des", "fill_real", "clutch_des", "clutch_real", "water_temp", "oil_press", "engine_temp", "retarder_fill" };
|
||||||
char const *TXTP[ 4 ] = { "bc", "bp", "sp", "cp" };
|
char const *TXTP[ 6 ] = { "bc", "bp", "sp", "cp", "rp", "mass" };
|
||||||
char const *TXTB[ 2 ] = { "spring_active", "spring_shutoff" };
|
char const *TXTB[ 2 ] = { "spring_active", "spring_shutoff" };
|
||||||
for( int j = 0; j < 10; ++j )
|
for( int j = 0; j < 10; ++j )
|
||||||
dict->insert( ( "eimp_t_" + std::string( TXTT[ j ] ) ), fEIMParams[ 0 ][ j ] );
|
dict->insert( ( "eimp_t_" + std::string( TXTT[ j ] ) ), fEIMParams[ 0 ][ j ] );
|
||||||
@@ -724,7 +768,7 @@ dictionary_source *TTrain::GetTrainState( dictionary_source const &Extraparamete
|
|||||||
p = (kier ? p->Next(4) : p->Prev(4));
|
p = (kier ? p->Next(4) : p->Prev(4));
|
||||||
}
|
}
|
||||||
for( int i = 0; i < 20; ++i ) {
|
for( int i = 0; i < 20; ++i ) {
|
||||||
for( int j = 0; j < 4; ++j ) {
|
for( int j = 0; j < 6; ++j ) {
|
||||||
dict->insert( ( "eimp_pn" + std::to_string( i + 1 ) + "_" + TXTP[ j ] ), fPress[ i ][ j ] );
|
dict->insert( ( "eimp_pn" + std::to_string( i + 1 ) + "_" + TXTP[ j ] ), fPress[ i ][ j ] );
|
||||||
}
|
}
|
||||||
for ( int j = 0; j < 2; ++j) {
|
for ( int j = 0; j < 2; ++j) {
|
||||||
@@ -5137,7 +5181,113 @@ void TTrain::OnCommand_speedcontrolbutton(TTrain *Train, command_data const &Com
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void TTrain::OnCommand_doorlocktoggle( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_inverterenable(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
auto itemindex = static_cast<int>(Command.command) - static_cast<int>(user_command::inverterenable1);
|
||||||
|
auto &item = Train->ggInverterEnableButtons[itemindex];
|
||||||
|
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
bool kier = (Train->DynamicObject->DirectionGet() * Train->mvOccupied->CabOccupied > 0);
|
||||||
|
int flag = Train->DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
||||||
|
TDynamicObject *p = Train->DynamicObject->GetFirstDynamic(Train->mvOccupied->CabOccupied < 0 ? end::rear : end::front, flag);
|
||||||
|
while (p)
|
||||||
|
{
|
||||||
|
if (p->MoverParameters->eimc[eimc_p_Pmax] > 1)
|
||||||
|
{
|
||||||
|
if (itemindex < p->MoverParameters->InvertersNo)
|
||||||
|
{
|
||||||
|
p->MoverParameters->Inverters[itemindex].Activate = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemindex -= p->MoverParameters->InvertersNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
|
}
|
||||||
|
// visual feedback
|
||||||
|
Train->ggInverterEnableButtons[itemindex].UpdateValue(1.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
|
// release
|
||||||
|
// visual feedback
|
||||||
|
Train->ggInverterEnableButtons[itemindex].UpdateValue(0.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TTrain::OnCommand_inverterdisable(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
auto itemindex = static_cast<int>(Command.command) - static_cast<int>(user_command::inverterdisable1);
|
||||||
|
auto &item = Train->ggInverterDisableButtons[itemindex];
|
||||||
|
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
bool kier = (Train->DynamicObject->DirectionGet() * Train->mvOccupied->CabOccupied > 0);
|
||||||
|
int flag = Train->DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
||||||
|
TDynamicObject *p = Train->DynamicObject->GetFirstDynamic(Train->mvOccupied->CabOccupied < 0 ? end::rear : end::front, flag);
|
||||||
|
while (p)
|
||||||
|
{
|
||||||
|
if (p->MoverParameters->eimc[eimc_p_Pmax] > 1)
|
||||||
|
{
|
||||||
|
if (itemindex < p->MoverParameters->InvertersNo)
|
||||||
|
{
|
||||||
|
p->MoverParameters->Inverters[itemindex].Activate = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemindex -= p->MoverParameters->InvertersNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
|
}
|
||||||
|
// visual feedback
|
||||||
|
Train->ggInverterDisableButtons[itemindex].UpdateValue(1.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
|
// release
|
||||||
|
// visual feedback
|
||||||
|
Train->ggInverterDisableButtons[itemindex].UpdateValue(0.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TTrain::OnCommand_invertertoggle(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
auto itemindex = static_cast<int>(Command.command) - static_cast<int>(user_command::invertertoggle1);
|
||||||
|
auto &item = Train->ggInverterToggleButtons[itemindex];
|
||||||
|
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
bool kier = (Train->DynamicObject->DirectionGet() * Train->mvOccupied->CabOccupied > 0);
|
||||||
|
int flag = Train->DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
||||||
|
TDynamicObject *p = Train->DynamicObject->GetFirstDynamic(Train->mvOccupied->CabOccupied < 0 ? end::rear : end::front, flag);
|
||||||
|
while (p)
|
||||||
|
{
|
||||||
|
if (p->MoverParameters->eimc[eimc_p_Pmax] > 1)
|
||||||
|
{
|
||||||
|
if (itemindex < p->MoverParameters->InvertersNo)
|
||||||
|
{
|
||||||
|
p->MoverParameters->Inverters[itemindex].Activate = !p->MoverParameters->Inverters[itemindex].Activate;
|
||||||
|
// visual feedback
|
||||||
|
Train->ggInverterToggleButtons[itemindex].UpdateValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0, Train->dsbSwitch);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemindex -= p->MoverParameters->InvertersNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TTrain::OnCommand_doorlocktoggle(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
if( Train->ggDoorSignallingButton.SubModel == nullptr ) {
|
if( Train->ggDoorSignallingButton.SubModel == nullptr ) {
|
||||||
if( Command.action == GLFW_PRESS ) {
|
if( Command.action == GLFW_PRESS ) {
|
||||||
@@ -6410,9 +6560,11 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
fPress[i][0] = p->MoverParameters->BrakePress;
|
fPress[i][0] = p->MoverParameters->BrakePress;
|
||||||
fPress[i][1] = p->MoverParameters->PipePress;
|
fPress[i][1] = p->MoverParameters->PipePress;
|
||||||
fPress[i][2] = p->MoverParameters->ScndPipePress;
|
fPress[i][2] = p->MoverParameters->ScndPipePress;
|
||||||
fPress[i][3] = p->MoverParameters->CntrlPipePress;
|
fPress[i][3] = p->MoverParameters->CntrlPipePress;
|
||||||
bBrakes[i][0] = p->MoverParameters->SpringBrake.IsActive;
|
fPress[i][4] = p->MoverParameters->Hamulec->GetBRP();
|
||||||
bBrakes[i][1] = p->MoverParameters->SpringBrake.ShuttOff;
|
fPress[i][5] = (p->MoverParameters->TotalMass - p->MoverParameters->Mred) * 0.001;
|
||||||
|
bBrakes[i][0] = p->MoverParameters->SpringBrake.IsActive;
|
||||||
|
bBrakes[i][1] = p->MoverParameters->SpringBrake.ShuttOff;
|
||||||
bDoors[i][1] = ( p->MoverParameters->Doors.instances[ side::left ].position > 0.f );
|
bDoors[i][1] = ( p->MoverParameters->Doors.instances[ side::left ].position > 0.f );
|
||||||
bDoors[i][2] = ( p->MoverParameters->Doors.instances[ side::right ].position > 0.f );
|
bDoors[i][2] = ( p->MoverParameters->Doors.instances[ side::right ].position > 0.f );
|
||||||
bDoors[i][3] = ( p->MoverParameters->Doors.instances[ side::left ].step_position > 0.f );
|
bDoors[i][3] = ( p->MoverParameters->Doors.instances[ side::left ].step_position > 0.f );
|
||||||
@@ -6499,6 +6651,8 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
= fPress[i][1]
|
= fPress[i][1]
|
||||||
= fPress[i][2]
|
= fPress[i][2]
|
||||||
= fPress[i][3]
|
= fPress[i][3]
|
||||||
|
= fPress[i][4]
|
||||||
|
= fPress[i][5]
|
||||||
= 0;
|
= 0;
|
||||||
bDoors[i][0]
|
bDoors[i][0]
|
||||||
= bDoors[i][1]
|
= bDoors[i][1]
|
||||||
@@ -7395,6 +7549,15 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
for( auto &universal : ggUniversals ) {
|
for( auto &universal : ggUniversals ) {
|
||||||
universal.Update();
|
universal.Update();
|
||||||
}
|
}
|
||||||
|
for (auto &item : ggInverterEnableButtons) {
|
||||||
|
item.Update();
|
||||||
|
}
|
||||||
|
for (auto &item : ggInverterDisableButtons) {
|
||||||
|
item.Update();
|
||||||
|
}
|
||||||
|
for (auto &item : ggInverterToggleButtons) {
|
||||||
|
item.Update();
|
||||||
|
}
|
||||||
for( auto &relayresetbutton : ggRelayResetButtons ) {
|
for( auto &relayresetbutton : ggRelayResetButtons ) {
|
||||||
relayresetbutton.Update();
|
relayresetbutton.Update();
|
||||||
}
|
}
|
||||||
@@ -7458,9 +7621,9 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// screens
|
// screens
|
||||||
fScreenTimer += Deltatime;
|
|
||||||
if (!FreeFlyModeFlag && simulation::Train == this) // don't bother if we're outside
|
if (!FreeFlyModeFlag && simulation::Train == this) // don't bother if we're outside
|
||||||
update_screens();
|
update_screens(Deltatime);
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
update_sounds( Deltatime );
|
update_sounds( Deltatime );
|
||||||
@@ -7867,17 +8030,22 @@ void TTrain::update_sounds_radio() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::update_screens() {
|
void TTrain::update_screens(double dt) {
|
||||||
if (fScreenTimer > std::max(Global.PythonScreenUpdateRate, ScreenUpdateRate) * 0.001f) {
|
for (auto &screen : m_screens) {
|
||||||
fScreenTimer = 0.f;
|
if (screen.updatetimecounter >= 0)
|
||||||
for (auto const &screen : m_screens) {
|
screen.updatetimecounter += dt;
|
||||||
auto state_dict = GetTrainState(screen.parameters);
|
|
||||||
|
|
||||||
state_dict->insert("touches", *screen.touch_list);
|
if (screen.updatetimecounter <= screen.updatetime)
|
||||||
screen.touch_list->clear();
|
continue;
|
||||||
|
|
||||||
Application.request({ screen.script, state_dict, screen.rt } );
|
screen.updatetimecounter = screen.updatetime > 0 ? 0 : -1;
|
||||||
}
|
|
||||||
|
auto state_dict = GetTrainState(screen.parameters);
|
||||||
|
|
||||||
|
state_dict->insert("touches", *screen.touch_list);
|
||||||
|
screen.touch_list->clear();
|
||||||
|
|
||||||
|
Application.request({ screen.script, state_dict, screen.rt } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8285,6 +8453,18 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
|
|||||||
// && ( token != "cab1definition:" )
|
// && ( token != "cab1definition:" )
|
||||||
// && ( token != "cab2definition:" )
|
// && ( token != "cab2definition:" )
|
||||||
&& ( token != "cab0definition:" ) );
|
&& ( token != "cab0definition:" ) );
|
||||||
|
for (auto &screen : m_screens)
|
||||||
|
{
|
||||||
|
if (screen.updatetime > 0) {
|
||||||
|
screen.updatetime = std::max((int)screen.updatetime, Global.PythonScreenUpdateRate) * 0.001;
|
||||||
|
}
|
||||||
|
if (screen.updatetime == 0) {
|
||||||
|
screen.updatetime = std::max(Global.PythonScreenUpdateRate, ScreenUpdateRate) * 0.001;
|
||||||
|
}
|
||||||
|
if (screen.updatetime < -1) {
|
||||||
|
screen.updatetime = -screen.updatetime * 0.001;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -8556,7 +8736,7 @@ TTrain::clamp_inside( Math3D::vector3 const &Point ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TTrain::screenentry_sequence& TTrain::get_screens() {
|
const TTrain::screenentry_sequence& TTrain::get_screens() {
|
||||||
update_screens();
|
update_screens(Timer::GetDeltaTime());
|
||||||
return m_screens;
|
return m_screens;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8660,6 +8840,15 @@ void TTrain::clear_cab_controls()
|
|||||||
for( auto &universal : ggUniversals ) {
|
for( auto &universal : ggUniversals ) {
|
||||||
universal.Clear();
|
universal.Clear();
|
||||||
}
|
}
|
||||||
|
for (auto &item : ggInverterEnableButtons) {
|
||||||
|
item.Clear();
|
||||||
|
}
|
||||||
|
for (auto &item : ggInverterDisableButtons) {
|
||||||
|
item.Clear();
|
||||||
|
}
|
||||||
|
for (auto &item : ggInverterToggleButtons) {
|
||||||
|
item.Clear();
|
||||||
|
}
|
||||||
for( auto &relayresetbutton : ggRelayResetButtons ) {
|
for( auto &relayresetbutton : ggRelayResetButtons ) {
|
||||||
relayresetbutton.Clear();
|
relayresetbutton.Clear();
|
||||||
}
|
}
|
||||||
@@ -9159,6 +9348,35 @@ void TTrain::set_cab_controls( int const Cab ) {
|
|||||||
}
|
}
|
||||||
// radio
|
// radio
|
||||||
ggRadioVolumeSelector.PutValue( Global.RadioVolume );
|
ggRadioVolumeSelector.PutValue( Global.RadioVolume );
|
||||||
|
|
||||||
|
//finding each inverter - not so optimal, but action ins performed only during changing cabin
|
||||||
|
bool kier = (DynamicObject->DirectionGet() * mvOccupied->CabOccupied > 0);
|
||||||
|
int flag = DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
||||||
|
int itemstart = 0;
|
||||||
|
for (auto &item : ggInverterToggleButtons) //for each button
|
||||||
|
{
|
||||||
|
int itemindex = itemstart;
|
||||||
|
itemstart++;
|
||||||
|
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->CabOccupied < 0 ? end::rear : end::front, flag);
|
||||||
|
while (p)
|
||||||
|
{
|
||||||
|
if (p->MoverParameters->eimc[eimc_p_Pmax] > 1)
|
||||||
|
{
|
||||||
|
if (itemindex < p->MoverParameters->InvertersNo)
|
||||||
|
{
|
||||||
|
// visual feedback
|
||||||
|
ggInverterToggleButtons[itemindex].PutValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemindex -= p->MoverParameters->InvertersNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we reset all indicators, as they're set during the update pass
|
// we reset all indicators, as they're set during the update pass
|
||||||
// TODO: when cleaning up break setting indicator state into a separate function, so we can reuse it
|
// TODO: when cleaning up break setting indicator state into a separate function, so we can reuse it
|
||||||
@@ -9455,7 +9673,43 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
{ "universal6:", ggUniversals[ 6 ] },
|
{ "universal6:", ggUniversals[ 6 ] },
|
||||||
{ "universal7:", ggUniversals[ 7 ] },
|
{ "universal7:", ggUniversals[ 7 ] },
|
||||||
{ "universal8:", ggUniversals[ 8 ] },
|
{ "universal8:", ggUniversals[ 8 ] },
|
||||||
{ "universal9:", ggUniversals[ 9 ] }
|
{ "universal9:", ggUniversals[ 9 ] },
|
||||||
|
{ "inverterenable1_bt:", ggInverterEnableButtons[0] },
|
||||||
|
{ "inverterenable2_bt:", ggInverterEnableButtons[1] },
|
||||||
|
{ "inverterenable3_bt:", ggInverterEnableButtons[2] },
|
||||||
|
{ "inverterenable4_bt:", ggInverterEnableButtons[3] },
|
||||||
|
{ "inverterenable5_bt:", ggInverterEnableButtons[4] },
|
||||||
|
{ "inverterenable6_bt:", ggInverterEnableButtons[5] },
|
||||||
|
{ "inverterenable7_bt:", ggInverterEnableButtons[6] },
|
||||||
|
{ "inverterenable8_bt:", ggInverterEnableButtons[7] },
|
||||||
|
{ "inverterenable9_bt:", ggInverterEnableButtons[8] },
|
||||||
|
{ "inverterenable10_bt:", ggInverterEnableButtons[9] },
|
||||||
|
{ "inverterenable11_bt:", ggInverterEnableButtons[10] },
|
||||||
|
{ "inverterenable12_bt:", ggInverterEnableButtons[11] },
|
||||||
|
{ "inverterdisable1_bt:", ggInverterDisableButtons[0] },
|
||||||
|
{ "inverterdisable2_bt:", ggInverterDisableButtons[1] },
|
||||||
|
{ "inverterdisable3_bt:", ggInverterDisableButtons[2] },
|
||||||
|
{ "inverterdisable4_bt:", ggInverterDisableButtons[3] },
|
||||||
|
{ "inverterdisable5_bt:", ggInverterDisableButtons[4] },
|
||||||
|
{ "inverterdisable6_bt:", ggInverterDisableButtons[5] },
|
||||||
|
{ "inverterdisable7_bt:", ggInverterDisableButtons[6] },
|
||||||
|
{ "inverterdisable8_bt:", ggInverterDisableButtons[7] },
|
||||||
|
{ "inverterdisable9_bt:", ggInverterDisableButtons[8] },
|
||||||
|
{ "inverterdisable10_bt:", ggInverterDisableButtons[9] },
|
||||||
|
{ "inverterdisable11_bt:", ggInverterDisableButtons[10] },
|
||||||
|
{ "inverterdisable12_bt:", ggInverterDisableButtons[11] },
|
||||||
|
{ "invertertoggle1_bt:", ggInverterToggleButtons[0] },
|
||||||
|
{ "invertertoggle2_bt:", ggInverterToggleButtons[1] },
|
||||||
|
{ "invertertoggle3_bt:", ggInverterToggleButtons[2] },
|
||||||
|
{ "invertertoggle4_bt:", ggInverterToggleButtons[3] },
|
||||||
|
{ "invertertoggle5_bt:", ggInverterToggleButtons[4] },
|
||||||
|
{ "invertertoggle6_bt:", ggInverterToggleButtons[5] },
|
||||||
|
{ "invertertoggle7_bt:", ggInverterToggleButtons[6] },
|
||||||
|
{ "invertertoggle8_bt:", ggInverterToggleButtons[7] },
|
||||||
|
{ "invertertoggle9_bt:", ggInverterToggleButtons[8] },
|
||||||
|
{ "invertertoggle10_bt:", ggInverterToggleButtons[9] },
|
||||||
|
{ "invertertoggle11_bt:", ggInverterToggleButtons[10] },
|
||||||
|
{ "invertertoggle12_bt:", ggInverterToggleButtons[11] },
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
auto const lookup { gauges.find( Label ) };
|
auto const lookup { gauges.find( Label ) };
|
||||||
|
|||||||
13
Train.h
13
Train.h
@@ -129,6 +129,8 @@ class TTrain {
|
|||||||
|
|
||||||
std::string script;
|
std::string script;
|
||||||
std::string target;
|
std::string target;
|
||||||
|
double updatetime = 0;
|
||||||
|
double updatetimecounter = 0;
|
||||||
std::shared_ptr<python_rt> rt;
|
std::shared_ptr<python_rt> rt;
|
||||||
std::shared_ptr<python_screen_viewer> viewer;
|
std::shared_ptr<python_screen_viewer> viewer;
|
||||||
std::shared_ptr<std::vector<glm::vec2>> touch_list;
|
std::shared_ptr<std::vector<glm::vec2>> touch_list;
|
||||||
@@ -216,7 +218,7 @@ class TTrain {
|
|||||||
inline
|
inline
|
||||||
end cab_to_end() const {
|
end cab_to_end() const {
|
||||||
return cab_to_end( iCabn ); }
|
return cab_to_end( iCabn ); }
|
||||||
void update_screens();
|
void update_screens(double dt);
|
||||||
|
|
||||||
// command handlers
|
// command handlers
|
||||||
// NOTE: we're currently using universal handlers and static handler map but it may be beneficial to have these implemented on individual class instance basis
|
// NOTE: we're currently using universal handlers and static handler map but it may be beneficial to have these implemented on individual class instance basis
|
||||||
@@ -455,6 +457,9 @@ class TTrain {
|
|||||||
static void OnCommand_speedcontrolpowerincrease(TTrain *Train, command_data const &Command);
|
static void OnCommand_speedcontrolpowerincrease(TTrain *Train, command_data const &Command);
|
||||||
static void OnCommand_speedcontrolpowerdecrease(TTrain *Train, command_data const &Command);
|
static void OnCommand_speedcontrolpowerdecrease(TTrain *Train, command_data const &Command);
|
||||||
static void OnCommand_speedcontrolbutton(TTrain *Train, command_data const &Command);
|
static void OnCommand_speedcontrolbutton(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_inverterenable(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_inverterdisable(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_invertertoggle(TTrain *Train, command_data const &Command);
|
||||||
|
|
||||||
|
|
||||||
// members
|
// members
|
||||||
@@ -576,6 +581,9 @@ public: // reszta może by?publiczna
|
|||||||
|
|
||||||
std::array<TGauge, 10> ggUniversals; // NOTE: temporary arrangement until we have dynamically built control table
|
std::array<TGauge, 10> ggUniversals; // NOTE: temporary arrangement until we have dynamically built control table
|
||||||
std::array<TGauge, 3> ggRelayResetButtons; // NOTE: temporary arrangement until we have dynamically built control table
|
std::array<TGauge, 3> ggRelayResetButtons; // NOTE: temporary arrangement until we have dynamically built control table
|
||||||
|
std::array<TGauge, 12> ggInverterEnableButtons; // NOTE: temporary arrangement until we have dynamically built control table
|
||||||
|
std::array<TGauge, 12> ggInverterDisableButtons; // NOTE: temporary arrangement until we have dynamically built control table
|
||||||
|
std::array<TGauge, 12> ggInverterToggleButtons; // NOTE: temporary arrangement until we have dynamically built control table
|
||||||
|
|
||||||
TGauge ggInstrumentLightButton;
|
TGauge ggInstrumentLightButton;
|
||||||
TGauge ggDashboardLightButton;
|
TGauge ggDashboardLightButton;
|
||||||
@@ -788,7 +796,6 @@ private:
|
|||||||
float fHaslerTimer;
|
float fHaslerTimer;
|
||||||
float fConverterTimer; // hunter-261211: dla przekaznika
|
float fConverterTimer; // hunter-261211: dla przekaznika
|
||||||
float fMainRelayTimer; // hunter-141211: zalaczanie WSa z opoznieniem
|
float fMainRelayTimer; // hunter-141211: zalaczanie WSa z opoznieniem
|
||||||
float fScreenTimer { 0.f };
|
|
||||||
int ScreenUpdateRate { 0 }; // vehicle specific python screen update rate override
|
int ScreenUpdateRate { 0 }; // vehicle specific python screen update rate override
|
||||||
|
|
||||||
// McZapkie-240302 - przyda sie do tachometru
|
// McZapkie-240302 - przyda sie do tachometru
|
||||||
@@ -833,7 +840,7 @@ private:
|
|||||||
bool m_couplingdisconnect { false };
|
bool m_couplingdisconnect { false };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
float fPress[20][4]; // cisnienia dla wszystkich czlonow
|
float fPress[20][6]; // cisnienia dla wszystkich czlonow
|
||||||
bool bBrakes[20][2]; // zalaczenie i dzialanie hamulcow
|
bool bBrakes[20][2]; // zalaczenie i dzialanie hamulcow
|
||||||
static std::vector<std::string> const fPress_labels;
|
static std::vector<std::string> const fPress_labels;
|
||||||
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||||
|
|||||||
36
command.cpp
36
command.cpp
@@ -280,6 +280,42 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "speedcontrolbutton7", command_target::vehicle, command_mode::oneoff },
|
{ "speedcontrolbutton7", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "speedcontrolbutton8", command_target::vehicle, command_mode::oneoff },
|
{ "speedcontrolbutton8", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "speedcontrolbutton9", command_target::vehicle, command_mode::oneoff },
|
{ "speedcontrolbutton9", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable1", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable2", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable3", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable4", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable5", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable6", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable7", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable8", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable9", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable10", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable11", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterenable12", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable1", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable2", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable3", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable4", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable5", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable6", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable7", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable8", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable9", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable10", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable11", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "inverterdisable12", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle1", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle2", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle3", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle4", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle5", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle6", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle7", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle8", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle9", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle10", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle11", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "invertertoggle12", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "globalradiostop", command_target::simulation, command_mode::oneoff },
|
{ "globalradiostop", command_target::simulation, command_mode::oneoff },
|
||||||
{ "timejump", command_target::simulation, command_mode::oneoff },
|
{ "timejump", command_target::simulation, command_mode::oneoff },
|
||||||
{ "timejumplarge", command_target::simulation, command_mode::oneoff },
|
{ "timejumplarge", command_target::simulation, command_mode::oneoff },
|
||||||
|
|||||||
37
command.h
37
command.h
@@ -275,7 +275,42 @@ enum class user_command {
|
|||||||
speedcontrolbutton7,
|
speedcontrolbutton7,
|
||||||
speedcontrolbutton8,
|
speedcontrolbutton8,
|
||||||
speedcontrolbutton9,
|
speedcontrolbutton9,
|
||||||
|
inverterenable1,
|
||||||
|
inverterenable2,
|
||||||
|
inverterenable3,
|
||||||
|
inverterenable4,
|
||||||
|
inverterenable5,
|
||||||
|
inverterenable6,
|
||||||
|
inverterenable7,
|
||||||
|
inverterenable8,
|
||||||
|
inverterenable9,
|
||||||
|
inverterenable10,
|
||||||
|
inverterenable11,
|
||||||
|
inverterenable12,
|
||||||
|
inverterdisable1,
|
||||||
|
inverterdisable2,
|
||||||
|
inverterdisable3,
|
||||||
|
inverterdisable4,
|
||||||
|
inverterdisable5,
|
||||||
|
inverterdisable6,
|
||||||
|
inverterdisable7,
|
||||||
|
inverterdisable8,
|
||||||
|
inverterdisable9,
|
||||||
|
inverterdisable10,
|
||||||
|
inverterdisable11,
|
||||||
|
inverterdisable12,
|
||||||
|
invertertoggle1,
|
||||||
|
invertertoggle2,
|
||||||
|
invertertoggle3,
|
||||||
|
invertertoggle4,
|
||||||
|
invertertoggle5,
|
||||||
|
invertertoggle6,
|
||||||
|
invertertoggle7,
|
||||||
|
invertertoggle8,
|
||||||
|
invertertoggle9,
|
||||||
|
invertertoggle10,
|
||||||
|
invertertoggle11,
|
||||||
|
invertertoggle12,
|
||||||
globalradiostop,
|
globalradiostop,
|
||||||
timejump,
|
timejump,
|
||||||
timejumplarge,
|
timejumplarge,
|
||||||
|
|||||||
@@ -951,6 +951,115 @@ drivermouse_input::default_bindings() {
|
|||||||
{ "speedbutton9:",{
|
{ "speedbutton9:",{
|
||||||
user_command::speedcontrolbutton9,
|
user_command::speedcontrolbutton9,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
|
{ "inverterenable1_bt:",{
|
||||||
|
user_command::inverterenable1,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable2_bt:",{
|
||||||
|
user_command::inverterenable2,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable3_bt:",{
|
||||||
|
user_command::inverterenable3,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable4_bt:",{
|
||||||
|
user_command::inverterenable4,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable5_bt:",{
|
||||||
|
user_command::inverterenable5,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable6_bt:",{
|
||||||
|
user_command::inverterenable6,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable7_bt:",{
|
||||||
|
user_command::inverterenable7,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable8_bt:",{
|
||||||
|
user_command::inverterenable8,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable9_bt:",{
|
||||||
|
user_command::inverterenable9,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable10_bt:",{
|
||||||
|
user_command::inverterenable10,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable11_bt:",{
|
||||||
|
user_command::inverterenable11,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterenable12_bt:",{
|
||||||
|
user_command::inverterenable12,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable1_bt:",{
|
||||||
|
user_command::inverterdisable1,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable2_bt:",{
|
||||||
|
user_command::inverterdisable2,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable3_bt:",{
|
||||||
|
user_command::inverterdisable3,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable4_bt:",{
|
||||||
|
user_command::inverterdisable4,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable5_bt:",{
|
||||||
|
user_command::inverterdisable5,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable6_bt:",{
|
||||||
|
user_command::inverterdisable6,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable7_bt:",{
|
||||||
|
user_command::inverterdisable7,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable8_bt:",{
|
||||||
|
user_command::inverterdisable8,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable9_bt:",{
|
||||||
|
user_command::inverterdisable9,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable10_bt:",{
|
||||||
|
user_command::inverterdisable10,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable11_bt:",{
|
||||||
|
user_command::inverterdisable11,
|
||||||
|
user_command::none } },
|
||||||
|
{ "inverterdisable12_bt:",{
|
||||||
|
user_command::inverterdisable12,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle1_bt:",{
|
||||||
|
user_command::invertertoggle1,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle2_bt:",{
|
||||||
|
user_command::invertertoggle2,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle3_bt:",{
|
||||||
|
user_command::invertertoggle3,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle4_bt:",{
|
||||||
|
user_command::invertertoggle4,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle5_bt:",{
|
||||||
|
user_command::invertertoggle5,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle6_bt:",{
|
||||||
|
user_command::invertertoggle6,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle7_bt:",{
|
||||||
|
user_command::invertertoggle7,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle8_bt:",{
|
||||||
|
user_command::invertertoggle8,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle9_bt:",{
|
||||||
|
user_command::invertertoggle9,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle10_bt:",{
|
||||||
|
user_command::invertertoggle10,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle11_bt:",{
|
||||||
|
user_command::invertertoggle11,
|
||||||
|
user_command::none } },
|
||||||
|
{ "invertertoggle12_bt:",{
|
||||||
|
user_command::invertertoggle12,
|
||||||
|
user_command::none } },
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user