mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 16:49:18 +02:00
Merge
This commit is contained in:
@@ -158,3 +158,9 @@ TButton::play() {
|
|||||||
if( m_state == true ) { m_soundfxincrease.play(); }
|
if( m_state == true ) { m_soundfxincrease.play(); }
|
||||||
else { m_soundfxdecrease.play(); }
|
else { m_soundfxdecrease.play(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TButton::gain(float new_volume) {
|
||||||
|
m_soundfxincrease.gain(new_volume);
|
||||||
|
m_soundfxdecrease.gain(new_volume);
|
||||||
|
}
|
||||||
|
|||||||
1
Button.h
1
Button.h
@@ -36,6 +36,7 @@ public:
|
|||||||
void AssignBool(bool const *bValue);
|
void AssignBool(bool const *bValue);
|
||||||
// returns offset of submodel associated with the button from the model centre
|
// returns offset of submodel associated with the button from the model centre
|
||||||
glm::vec3 model_offset() const;
|
glm::vec3 model_offset() const;
|
||||||
|
void gain(float new_volume);
|
||||||
inline uint8_t b() { return m_state ? 1 : 0; };
|
inline uint8_t b() { return m_state ? 1 : 0; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
31
Driver.cpp
31
Driver.cpp
@@ -1183,6 +1183,7 @@ TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, doub
|
|||||||
L = std::max(0.0, std::min(L, std::abs(Par2) - fMinProximityDist - fLength));
|
L = std::max(0.0, std::min(L, std::abs(Par2) - fMinProximityDist - fLength));
|
||||||
Point.UpdateDistance(L);
|
Point.UpdateDistance(L);
|
||||||
Point.bMoved = true;
|
Point.bMoved = true;
|
||||||
|
Point.fMoved = L;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Point.iFlags = 0;
|
Point.iFlags = 0;
|
||||||
@@ -1190,7 +1191,7 @@ TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, doub
|
|||||||
}
|
}
|
||||||
// for human-driven vehicles discard the stop point if they leave it far enough behind
|
// for human-driven vehicles discard the stop point if they leave it far enough behind
|
||||||
if( ( false == AIControllFlag )
|
if( ( false == AIControllFlag )
|
||||||
&& ( Point.fDist < -1 * std::max( fLength + 100, 250.0 ) ) ) {
|
&& ( Point.fDist < -1 * std::max( fLength + 100, 250.0 ) - Point.fMoved ) ) {
|
||||||
Point.iFlags = 0; // nie liczy się już zupełnie (nie wyśle SetVelocity)
|
Point.iFlags = 0; // nie liczy się już zupełnie (nie wyśle SetVelocity)
|
||||||
Point.fVelNext = -1; // można jechać za W4
|
Point.fVelNext = -1; // można jechać za W4
|
||||||
if( ( Point.fDist <= 0.0 ) && ( eSignNext == Point.evEvent ) ) {
|
if( ( Point.fDist <= 0.0 ) && ( eSignNext == Point.evEvent ) ) {
|
||||||
@@ -1207,7 +1208,7 @@ TController::TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, doub
|
|||||||
// jeśli długość peronu ((sSpeedTable[i].evEvent->ValueGet(2)) nie podana,
|
// jeśli długość peronu ((sSpeedTable[i].evEvent->ValueGet(2)) nie podana,
|
||||||
// przyjąć odległość fMinProximityDist
|
// przyjąć odległość fMinProximityDist
|
||||||
&& ( ( iDrivigFlags & moveStopCloser ) != 0 ?
|
&& ( ( iDrivigFlags & moveStopCloser ) != 0 ?
|
||||||
Point.fDist + fLength <=
|
Point.fDist + fLength + (Point.fMoved - fMinProximityDist * 0.5f) <=
|
||||||
std::max(
|
std::max(
|
||||||
std::abs( Point.evEvent->input_value( 2 ) ),
|
std::abs( Point.evEvent->input_value( 2 ) ),
|
||||||
2.0 * fMaxProximityDist + fLength ) : // fmaxproximitydist typically equals ~50 m
|
2.0 * fMaxProximityDist + fLength ) : // fmaxproximitydist typically equals ~50 m
|
||||||
@@ -2608,7 +2609,7 @@ void TController::Lights(int head, int rear)
|
|||||||
|
|
||||||
void TController::DirectionInitial()
|
void TController::DirectionInitial()
|
||||||
{ // ustawienie kierunku po wczytaniu trainset (może jechać na wstecznym
|
{ // ustawienie kierunku po wczytaniu trainset (może jechać na wstecznym
|
||||||
mvOccupied->CabActivisation(); // załączenie rozrządu (wirtualne kabiny)
|
mvOccupied->CabActivisationAuto(); // załączenie rozrządu (wirtualne kabiny)
|
||||||
if (mvOccupied->Vel > EU07_AI_NOMOVEMENT)
|
if (mvOccupied->Vel > EU07_AI_NOMOVEMENT)
|
||||||
{ // jeśli na starcie jedzie
|
{ // jeśli na starcie jedzie
|
||||||
iDirection = iDirectionOrder =
|
iDirection = iDirectionOrder =
|
||||||
@@ -2762,6 +2763,7 @@ bool TController::PrepareEngine()
|
|||||||
ReactionTime = ( mvOccupied->Vel < 5 ? PrepareTime : EasyReactionTime ); // react faster with rolling start
|
ReactionTime = ( mvOccupied->Vel < 5 ? PrepareTime : EasyReactionTime ); // react faster with rolling start
|
||||||
|
|
||||||
cue_action( driver_hint::batteryon );
|
cue_action( driver_hint::batteryon );
|
||||||
|
cue_action( driver_hint::cabactivation);
|
||||||
cue_action( driver_hint::radioon );
|
cue_action( driver_hint::radioon );
|
||||||
|
|
||||||
if( has_diesel_engine() ) {
|
if( has_diesel_engine() ) {
|
||||||
@@ -4043,7 +4045,7 @@ void TController::SpeedCntrl(double DesiredSpeed)
|
|||||||
void TController::SetTimeControllers()
|
void TController::SetTimeControllers()
|
||||||
{
|
{
|
||||||
// TBD, TODO: rework this method to use hint system and regardless of driver type
|
// TBD, TODO: rework this method to use hint system and regardless of driver type
|
||||||
if( false == AIControllFlag ) { return; }
|
if( false == AIControllFlag || 0 == mvOccupied->CabActive ) { return; }
|
||||||
|
|
||||||
//1. Check the type of Main Brake Handle
|
//1. Check the type of Main Brake Handle
|
||||||
if( BrakeSystem == TBrakeSystem::Pneumatic || ForcePNBrake )
|
if( BrakeSystem == TBrakeSystem::Pneumatic || ForcePNBrake )
|
||||||
@@ -4256,7 +4258,7 @@ void TController::SetTimeControllers()
|
|||||||
void TController::CheckTimeControllers()
|
void TController::CheckTimeControllers()
|
||||||
{
|
{
|
||||||
// TODO: rework this method to use hint system and regardless of driver type
|
// TODO: rework this method to use hint system and regardless of driver type
|
||||||
if( false == AIControllFlag ) { return; }
|
if( false == AIControllFlag || 0 == mvControlling->CabActive ) { return; }
|
||||||
|
|
||||||
//1. Check the type of Main Brake Handle
|
//1. Check the type of Main Brake Handle
|
||||||
if( BrakeSystem == TBrakeSystem::ElectroPneumatic && mvOccupied->Handle->TimeEP && !ForcePNBrake )
|
if( BrakeSystem == TBrakeSystem::ElectroPneumatic && mvOccupied->Handle->TimeEP && !ForcePNBrake )
|
||||||
@@ -5699,6 +5701,7 @@ void TController::TakeControl( bool const Aidriver, bool const Forcevehiclecheck
|
|||||||
{ // teraz AI prowadzi
|
{ // teraz AI prowadzi
|
||||||
AIControllFlag = AIdriver;
|
AIControllFlag = AIdriver;
|
||||||
pVehicle->Controller = AIdriver;
|
pVehicle->Controller = AIdriver;
|
||||||
|
mvOccupied->CabActivisation(true);
|
||||||
iDirection = 0; // kierunek jazdy trzeba dopiero zgadnąć
|
iDirection = 0; // kierunek jazdy trzeba dopiero zgadnąć
|
||||||
TableClear(); // ponowne utworzenie tabelki, bo człowiek mógł pojechać niezgodnie z sygnałami
|
TableClear(); // ponowne utworzenie tabelki, bo człowiek mógł pojechać niezgodnie z sygnałami
|
||||||
if( action() != TAction::actSleep ) {
|
if( action() != TAction::actSleep ) {
|
||||||
@@ -6002,6 +6005,17 @@ void
|
|||||||
TController::determine_consist_state() {
|
TController::determine_consist_state() {
|
||||||
// ABu-160305 testowanie gotowości do jazdy
|
// ABu-160305 testowanie gotowości do jazdy
|
||||||
// Ra: przeniesione z DynObj, skład użytkownika też jest testowany, żeby mu przekazać, że ma odhamować
|
// Ra: przeniesione z DynObj, skład użytkownika też jest testowany, żeby mu przekazać, że ma odhamować
|
||||||
|
|
||||||
|
if (mvOccupied->CabActive == 0 && mvOccupied->Power24vIsAvailable)
|
||||||
|
{
|
||||||
|
cue_action( locale::string::driver_hint_cabactivation );
|
||||||
|
}
|
||||||
|
else if (!mvOccupied->AutomaticCabActivation
|
||||||
|
&& ( (mvOccupied->CabActive == -mvOccupied->CabOccupied) || (!mvOccupied->CabMaster) || (!mvOccupied->Power24vIsAvailable) ) )
|
||||||
|
{
|
||||||
|
cue_action( locale::string::driver_hint_cabdeactivation );
|
||||||
|
}
|
||||||
|
|
||||||
int index = double(BrakeAccTableSize) * (mvOccupied->Vel / mvOccupied->Vmax);
|
int index = double(BrakeAccTableSize) * (mvOccupied->Vel / mvOccupied->Vmax);
|
||||||
index = std::min(BrakeAccTableSize, std::max(1, index));
|
index = std::min(BrakeAccTableSize, std::max(1, index));
|
||||||
fBrake_a0[0] = fBrake_a0[index];
|
fBrake_a0[0] = fBrake_a0[index];
|
||||||
@@ -6020,6 +6034,7 @@ TController::determine_consist_state() {
|
|||||||
mvOccupied->PipePress < std::max( 3.9, mvOccupied->BrakePressureActual.PipePressureVal ) + 0.1 );
|
mvOccupied->PipePress < std::max( 3.9, mvOccupied->BrakePressureActual.PipePressureVal ) + 0.1 );
|
||||||
fAccGravity = 0.0; // przyspieszenie wynikające z pochylenia
|
fAccGravity = 0.0; // przyspieszenie wynikające z pochylenia
|
||||||
IsAnyCouplerStretched = false;
|
IsAnyCouplerStretched = false;
|
||||||
|
IsAnyDoorOnlyOpen[ side::right ] = IsAnyDoorOnlyOpen[ side::left ] = false;
|
||||||
IsAnyDoorOpen[ side::right ] = IsAnyDoorOpen[ side::left ] = false;
|
IsAnyDoorOpen[ side::right ] = IsAnyDoorOpen[ side::left ] = false;
|
||||||
IsAnyDoorPermitActive[ side::right ] = IsAnyDoorPermitActive[ side::left ] = false;
|
IsAnyDoorPermitActive[ side::right ] = IsAnyDoorPermitActive[ side::left ] = false;
|
||||||
ConsistShade = 0.0;
|
ConsistShade = 0.0;
|
||||||
@@ -6072,13 +6087,17 @@ TController::determine_consist_state() {
|
|||||||
|| ( vehicle->Couplers[ end::rear ].stretch_duration > 0.0 );
|
|| ( vehicle->Couplers[ end::rear ].stretch_duration > 0.0 );
|
||||||
// check door state
|
// check door state
|
||||||
{
|
{
|
||||||
auto const switchsides { p->DirectionGet() != iDirection };
|
auto const switchsides{ p->DirectionGet() != (iDirection == 0 ? mvOccupied->CabOccupied : iDirection) };
|
||||||
auto const &rightdoor { vehicle->Doors.instances[ ( switchsides ? side::left : side::right ) ] };
|
auto const &rightdoor { vehicle->Doors.instances[ ( switchsides ? side::left : side::right ) ] };
|
||||||
auto const &leftdoor { vehicle->Doors.instances[ ( switchsides ? side::right : side::left ) ] };
|
auto const &leftdoor { vehicle->Doors.instances[ ( switchsides ? side::right : side::left ) ] };
|
||||||
if( vehicle->Doors.close_control != control_t::autonomous ) {
|
if( vehicle->Doors.close_control != control_t::autonomous ) {
|
||||||
IsAnyDoorOpen[ side::right ] |= ( false == rightdoor.is_closed );
|
IsAnyDoorOpen[ side::right ] |= ( false == rightdoor.is_closed );
|
||||||
IsAnyDoorOpen[ side::left ] |= ( false == leftdoor.is_closed );
|
IsAnyDoorOpen[ side::left ] |= ( false == leftdoor.is_closed );
|
||||||
}
|
}
|
||||||
|
if (vehicle->Doors.close_control != control_t::autonomous) {
|
||||||
|
IsAnyDoorOnlyOpen[ side::right ] |= ( false == rightdoor.is_door_closed );
|
||||||
|
IsAnyDoorOnlyOpen[ side::left ] |= ( false == leftdoor.is_door_closed );
|
||||||
|
}
|
||||||
if( vehicle->Doors.permit_needed ) {
|
if( vehicle->Doors.permit_needed ) {
|
||||||
IsAnyDoorPermitActive[ side::right ] |= rightdoor.open_permit;
|
IsAnyDoorPermitActive[ side::right ] |= rightdoor.open_permit;
|
||||||
IsAnyDoorPermitActive[ side::left ] |= leftdoor.open_permit;
|
IsAnyDoorPermitActive[ side::left ] |= leftdoor.open_permit;
|
||||||
|
|||||||
2
Driver.h
2
Driver.h
@@ -154,6 +154,7 @@ class TSpeedPos
|
|||||||
double fSectionVelocityDist{ 0.0 }; // długość ograniczenia prędkości
|
double fSectionVelocityDist{ 0.0 }; // długość ograniczenia prędkości
|
||||||
int iFlags{ spNone }; // flagi typu wpisu do tabelki
|
int iFlags{ spNone }; // flagi typu wpisu do tabelki
|
||||||
bool bMoved{ false }; // czy przesunięty (dotyczy punktu zatrzymania w peronie)
|
bool bMoved{ false }; // czy przesunięty (dotyczy punktu zatrzymania w peronie)
|
||||||
|
double fMoved{ 0.0 }; // ile przesunięty (dotyczy punktu zatrzymania w peronie)
|
||||||
Math3D::vector3 vPos; // współrzędne XYZ do liczenia odległości
|
Math3D::vector3 vPos; // współrzędne XYZ do liczenia odległości
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@@ -603,6 +604,7 @@ private:
|
|||||||
TDynamicObject *pVehicles[ 2 ]; // skrajne pojazdy w składzie (niekoniecznie bezpośrednio sterowane)
|
TDynamicObject *pVehicles[ 2 ]; // skrajne pojazdy w składzie (niekoniecznie bezpośrednio sterowane)
|
||||||
bool DoesAnyDoorNeedOpening{ false };
|
bool DoesAnyDoorNeedOpening{ false };
|
||||||
bool IsAnyDoorOpen[ 2 ]; // state of door in the consist
|
bool IsAnyDoorOpen[ 2 ]; // state of door in the consist
|
||||||
|
bool IsAnyDoorOnlyOpen[ 2 ]; // state of door in the consist regardless of step
|
||||||
bool IsAnyDoorPermitActive[ 2 ]; // state of door permit in the consist
|
bool IsAnyDoorPermitActive[ 2 ]; // state of door permit in the consist
|
||||||
bool IsAnyLineBreakerOpen{ false }; // state of line breaker in all powered vehicles under control
|
bool IsAnyLineBreakerOpen{ false }; // state of line breaker in all powered vehicles under control
|
||||||
bool IsAnyConverterOverloadRelayOpen{ false }; // state of converter overload relays in all vehicles under control
|
bool IsAnyConverterOverloadRelayOpen{ false }; // state of converter overload relays in all vehicles under control
|
||||||
|
|||||||
30
DynObj.cpp
30
DynObj.cpp
@@ -3922,7 +3922,9 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mirrors
|
// mirrors
|
||||||
if( MoverParameters->Vel > MoverParameters->MirrorVelClose ) {
|
if( (MoverParameters->Vel > MoverParameters->MirrorVelClose)
|
||||||
|
|| (MoverParameters->CabActive == 0) && (activation::mirrors)
|
||||||
|
|| (MoverParameters->MirrorForbidden) ) {
|
||||||
// automatically fold mirrors when above velocity threshold
|
// automatically fold mirrors when above velocity threshold
|
||||||
if( dMirrorMoveL > 0.0 ) {
|
if( dMirrorMoveL > 0.0 ) {
|
||||||
dMirrorMoveL = std::max(
|
dMirrorMoveL = std::max(
|
||||||
@@ -3959,6 +3961,26 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
toggle_lights();
|
toggle_lights();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MoverParameters->InactiveCabPantsCheck)
|
||||||
|
{
|
||||||
|
auto p = FindPantographCarrier();
|
||||||
|
bool isAnyPantUp = false;
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
for each (auto item in p->MoverParameters->Pantographs)
|
||||||
|
{
|
||||||
|
isAnyPantUp |= item.is_active;
|
||||||
|
}
|
||||||
|
if (isAnyPantUp)
|
||||||
|
{
|
||||||
|
MoverParameters->OperatePantographValve(end::front, operation_t::enable);
|
||||||
|
MoverParameters->OperatePantographValve(end::rear, operation_t::enable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MoverParameters->InactiveCabPantsCheck = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (MoverParameters->DerailReason > 0)
|
if (MoverParameters->DerailReason > 0)
|
||||||
{
|
{
|
||||||
switch (MoverParameters->DerailReason)
|
switch (MoverParameters->DerailReason)
|
||||||
@@ -6893,11 +6915,13 @@ void TDynamicObject::Damage(char flag)
|
|||||||
void TDynamicObject::SetLights() {
|
void TDynamicObject::SetLights() {
|
||||||
|
|
||||||
auto const isfrontcaboccupied { MoverParameters->CabOccupied * DirectionGet() >= 0 };
|
auto const isfrontcaboccupied { MoverParameters->CabOccupied * DirectionGet() >= 0 };
|
||||||
|
int const automaticmarkers { MoverParameters->CabActive == 0 && ( MoverParameters->InactiveCabFlag & activation::redmarkers )
|
||||||
|
? light::redmarker_left + light::redmarker_right : 0 };
|
||||||
int const front { ( isfrontcaboccupied ? end::front : end::rear ) };
|
int const front { ( isfrontcaboccupied ? end::front : end::rear ) };
|
||||||
int const rear { 1 - front };
|
int const rear { 1 - front };
|
||||||
auto const lightpos { MoverParameters->LightsPos - 1 };
|
auto const lightpos { MoverParameters->LightsPos - 1 };
|
||||||
auto const frontlights { MoverParameters->Lights[ front ][ lightpos ] };
|
auto const frontlights { automaticmarkers > 0 ? automaticmarkers : MoverParameters->Lights[ front ][ lightpos ] };
|
||||||
auto const rearlights { MoverParameters->Lights[ rear ][ lightpos ] };
|
auto const rearlights { automaticmarkers > 0 ? automaticmarkers : MoverParameters->Lights[ rear ][ lightpos ] };
|
||||||
auto *vehicle { GetFirstDynamic( MoverParameters->CabOccupied >= 0 ? end::front : end::rear, coupling::control ) };
|
auto *vehicle { GetFirstDynamic( MoverParameters->CabOccupied >= 0 ? end::front : end::rear, coupling::control ) };
|
||||||
while( vehicle != nullptr ) {
|
while( vehicle != nullptr ) {
|
||||||
// set lights on given side if there's no coupling with another vehicle, turn them off otherwise
|
// set lights on given side if there's no coupling with another vehicle, turn them off otherwise
|
||||||
|
|||||||
@@ -256,6 +256,18 @@ enum relay_t {
|
|||||||
electrodynamicbrakesoverload = 1 << 7,
|
electrodynamicbrakesoverload = 1 << 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// functions during activation/deactivation
|
||||||
|
enum activation {
|
||||||
|
emergencybrake = 1 << 0,
|
||||||
|
mirrors = 1 << 1,
|
||||||
|
pantographsup = 1 << 2,
|
||||||
|
redmarkers = 1 << 3,
|
||||||
|
doorpermition = 1 << 4,
|
||||||
|
springbrakeon = 1 << 5,
|
||||||
|
springbrakeoff = 1 << 6,
|
||||||
|
neutraldirection = 1 << 7,
|
||||||
|
};
|
||||||
|
|
||||||
//szczególne typy pojazdów (inna obsługa) dla zmiennej TrainType
|
//szczególne typy pojazdów (inna obsługa) dla zmiennej TrainType
|
||||||
//zamienione na flagi bitowe, aby szybko wybierać grupę (np. EZT+SZT)
|
//zamienione na flagi bitowe, aby szybko wybierać grupę (np. EZT+SZT)
|
||||||
// TODO: convert to enums, they're used as specific checks anyway
|
// TODO: convert to enums, they're used as specific checks anyway
|
||||||
@@ -903,6 +915,7 @@ private:
|
|||||||
float step_position { 0.f }; // current shift of the movable step from the retracted position
|
float step_position { 0.f }; // current shift of the movable step from the retracted position
|
||||||
// ld outputs
|
// ld outputs
|
||||||
bool is_closed { true }; // the door is fully closed
|
bool is_closed { true }; // the door is fully closed
|
||||||
|
bool is_door_closed { true }; // the door is fully closed, step doesn't matter
|
||||||
bool is_closing { false }; // the door is currently closing
|
bool is_closing { false }; // the door is currently closing
|
||||||
bool is_opening { false }; // the door is currently opening
|
bool is_opening { false }; // the door is currently opening
|
||||||
bool is_open { false }; // the door is fully open
|
bool is_open { false }; // the door is fully open
|
||||||
@@ -1367,6 +1380,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
double MirrorMaxShift { 90.0 };
|
double MirrorMaxShift { 90.0 };
|
||||||
double MirrorVelClose { 5.0 };
|
double MirrorVelClose { 5.0 };
|
||||||
|
bool MirrorForbidden{ false }; /*czy jest pozwolenie na otworzenie lusterek (przycisk)*/
|
||||||
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
||||||
bool SpeedCtrl = false; /*czy jest tempomat*/
|
bool SpeedCtrl = false; /*czy jest tempomat*/
|
||||||
speed_control SpeedCtrlUnit; /*parametry tempomatu*/
|
speed_control SpeedCtrlUnit; /*parametry tempomatu*/
|
||||||
@@ -1459,6 +1473,7 @@ public:
|
|||||||
std::array<cooling_fan, 2> MotorBlowers;
|
std::array<cooling_fan, 2> MotorBlowers;
|
||||||
door_data Doors;
|
door_data Doors;
|
||||||
float DoorsOpenWithPermitAfter { -1.f }; // remote open if permit button is held for specified time. NOTE: separate from door data as its cab control thing
|
float DoorsOpenWithPermitAfter { -1.f }; // remote open if permit button is held for specified time. NOTE: separate from door data as its cab control thing
|
||||||
|
int DoorsPermitLightBlinking { 0 }; //when the doors permit signal light is blinking
|
||||||
|
|
||||||
int BrakeCtrlPos = -2; /*nastawa hamulca zespolonego*/
|
int BrakeCtrlPos = -2; /*nastawa hamulca zespolonego*/
|
||||||
double BrakeCtrlPosR = 0.0; /*nastawa hamulca zespolonego - plynna dla FV4a*/
|
double BrakeCtrlPosR = 0.0; /*nastawa hamulca zespolonego - plynna dla FV4a*/
|
||||||
@@ -1523,6 +1538,11 @@ public:
|
|||||||
int MainCtrlMaxDirChangePos { 0 }; // can't change reverser state with master controller set above this position
|
int MainCtrlMaxDirChangePos { 0 }; // can't change reverser state with master controller set above this position
|
||||||
int CabActive = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
int CabActive = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||||
int CabOccupied = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład) // TODO: move to TController
|
int CabOccupied = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład) // TODO: move to TController
|
||||||
|
bool CabMaster = false; //czy pojazd jest nadrzędny w składzie
|
||||||
|
inline bool IsCabMaster() { return ((CabActive == CabOccupied) && CabMaster); } //czy aktualna kabina jest na pewno tą, z której można sterować
|
||||||
|
bool AutomaticCabActivation = true; //czy zmostkowany rozrzad przelacza sie sam przy zmianie kabiny
|
||||||
|
int InactiveCabFlag = 0; //co sie dzieje przy dezaktywacji kabiny
|
||||||
|
bool InactiveCabPantsCheck = false; //niech DynamicObject sprawdzi pantografy
|
||||||
double LastSwitchingTime = 0.0; /*czas ostatniego przelaczania czegos*/
|
double LastSwitchingTime = 0.0; /*czas ostatniego przelaczania czegos*/
|
||||||
int WarningSignal = 0; // 0: nie trabi, 1,2,4: trabi
|
int WarningSignal = 0; // 0: nie trabi, 1,2,4: trabi
|
||||||
bool DepartureSignal = false; /*sygnal odjazdu*/
|
bool DepartureSignal = false; /*sygnal odjazdu*/
|
||||||
@@ -1728,6 +1748,8 @@ public:
|
|||||||
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
|
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
|
||||||
bool CabActivisation( bool const Enforce = false );
|
bool CabActivisation( bool const Enforce = false );
|
||||||
bool CabDeactivisation( bool const Enforce = false );
|
bool CabDeactivisation( bool const Enforce = false );
|
||||||
|
bool CabActivisationAuto( bool const Enforce = false );
|
||||||
|
bool CabDeactivisationAuto( bool const Enforce = false );
|
||||||
|
|
||||||
/*! funkcje zwiekszajace/zmniejszajace nastawniki*/
|
/*! funkcje zwiekszajace/zmniejszajace nastawniki*/
|
||||||
/*! glowny nastawnik:*/
|
/*! glowny nastawnik:*/
|
||||||
|
|||||||
@@ -697,7 +697,9 @@ bool TMoverParameters::DirectionForward()
|
|||||||
{
|
{
|
||||||
if( false == EIMDirectionChangeAllow() ) { return false; }
|
if( false == EIMDirectionChangeAllow() ) { return false; }
|
||||||
|
|
||||||
if ((MainCtrlPosNo > 0) && (DirActive < 1))
|
if ((MainCtrlPosNo > 0)
|
||||||
|
&& (DirActive < 1)
|
||||||
|
&& ( (CabActive != 0) || ( (InactiveCabFlag & activation::neutraldirection) == 0) ) )
|
||||||
{
|
{
|
||||||
++DirActive;
|
++DirActive;
|
||||||
DirAbsolute = DirActive * CabActive;
|
DirAbsolute = DirActive * CabActive;
|
||||||
@@ -2848,9 +2850,21 @@ bool TMoverParameters::CabActivisation( bool const Enforce )
|
|||||||
{
|
{
|
||||||
CabActive = CabOccupied; // sterowanie jest z kabiny z obsadą
|
CabActive = CabOccupied; // sterowanie jest z kabiny z obsadą
|
||||||
DirAbsolute = DirActive * CabActive;
|
DirAbsolute = DirActive * CabActive;
|
||||||
|
CabMaster = true;
|
||||||
SecuritySystem.set_enabled(true); // activate the alerter TODO: make it part of control based cab selection
|
SecuritySystem.set_enabled(true); // activate the alerter TODO: make it part of control based cab selection
|
||||||
SendCtrlToNext("CabActivisation", 1, CabActive);
|
SendCtrlToNext("CabActivisation", 1, CabActive);
|
||||||
|
SendCtrlToNext("Direction", DirAbsolute, CabActive);
|
||||||
|
if (InactiveCabFlag & activation::springbrakeoff)
|
||||||
|
{
|
||||||
|
SpringBrakeActivate(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::CabActivisationAuto(bool const Enforce)
|
||||||
|
{
|
||||||
|
bool OK = AutomaticCabActivation ? CabActivisation(Enforce) : false;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2862,11 +2876,31 @@ bool TMoverParameters::CabDeactivisation( bool const Enforce )
|
|||||||
{
|
{
|
||||||
bool OK = false;
|
bool OK = false;
|
||||||
|
|
||||||
OK = Enforce || (CabActive == CabOccupied); // o ile obsada jest w kabinie ze sterowaniem
|
OK = Enforce || IsCabMaster(); // o ile obsada jest w kabinie ze sterowaniem
|
||||||
if (OK)
|
if (OK)
|
||||||
{
|
{
|
||||||
|
if (InactiveCabFlag & activation::springbrakeon)
|
||||||
|
{
|
||||||
|
SpringBrakeActivate(true);
|
||||||
|
}
|
||||||
|
if (InactiveCabFlag & activation::pantographsup)
|
||||||
|
{
|
||||||
|
InactiveCabPantsCheck = true;
|
||||||
|
}
|
||||||
|
if (InactiveCabFlag & activation::doorpermition)
|
||||||
|
{
|
||||||
|
PermitDoors(side::right, true, range_t::consist);
|
||||||
|
PermitDoors(side::left, true, range_t::consist);
|
||||||
|
}
|
||||||
|
if (InactiveCabFlag & activation::neutraldirection)
|
||||||
|
{
|
||||||
|
DirActive = 0;
|
||||||
|
SendCtrlToNext("Direction", 0, CabActive);
|
||||||
|
}
|
||||||
|
|
||||||
CabActive = 0;
|
CabActive = 0;
|
||||||
DirAbsolute = DirActive * CabActive;
|
DirAbsolute = DirActive * CabActive;
|
||||||
|
CabMaster = false;
|
||||||
DepartureSignal = false; // nie buczeć z nieaktywnej kabiny
|
DepartureSignal = false; // nie buczeć z nieaktywnej kabiny
|
||||||
SecuritySystem.set_enabled(false); // deactivate alerter TODO: make it part of control based cab selection
|
SecuritySystem.set_enabled(false); // deactivate alerter TODO: make it part of control based cab selection
|
||||||
|
|
||||||
@@ -2875,6 +2909,12 @@ bool TMoverParameters::CabDeactivisation( bool const Enforce )
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::CabDeactivisationAuto(bool const Enforce)
|
||||||
|
{
|
||||||
|
bool OK = AutomaticCabActivation ? CabDeactivisation(Enforce) : false;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// Q: 20160710
|
// Q: 20160710
|
||||||
// Siła napędzająca drezynę po naciśnięciu wajhy
|
// Siła napędzająca drezynę po naciśnięciu wajhy
|
||||||
@@ -3155,7 +3195,9 @@ bool TMoverParameters::DirectionBackward(void)
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((MainCtrlPosNo > 0) && (DirActive > -1))
|
if ((MainCtrlPosNo > 0)
|
||||||
|
&& (DirActive > -1)
|
||||||
|
&& ( (CabActive != 0) || ( (InactiveCabFlag & activation::neutraldirection) == 0) ) )
|
||||||
{
|
{
|
||||||
if (EngineType == TEngineType::WheelsDriven)
|
if (EngineType == TEngineType::WheelsDriven)
|
||||||
--CabActive;
|
--CabActive;
|
||||||
@@ -4466,6 +4508,8 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
// (if it's supposed to be broken coupler, such event sets alarmchainflag instead when appropriate)
|
// (if it's supposed to be broken coupler, such event sets alarmchainflag instead when appropriate)
|
||||||
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
||||||
*/
|
*/
|
||||||
|
|| ( ( 0 == CabActive )
|
||||||
|
&& ( InactiveCabFlag & activation::emergencybrake ) )
|
||||||
|| ( ( SpringBrakeDriveEmergencyVel >= 0 )
|
|| ( ( SpringBrakeDriveEmergencyVel >= 0 )
|
||||||
&& ( Vel > SpringBrakeDriveEmergencyVel )
|
&& ( Vel > SpringBrakeDriveEmergencyVel )
|
||||||
&& ( SpringBrake.IsActive ) ) ) {
|
&& ( SpringBrake.IsActive ) ) ) {
|
||||||
@@ -7214,9 +7258,12 @@ void TMoverParameters::CheckEIMIC(double dt)
|
|||||||
BrakeLevelSet(UniCtrlList[MainCtrlPosNo].mode); //bottom clamping
|
BrakeLevelSet(UniCtrlList[MainCtrlPosNo].mode); //bottom clamping
|
||||||
if (BrakeCtrlPos > UniCtrlList[0].mode)
|
if (BrakeCtrlPos > UniCtrlList[0].mode)
|
||||||
BrakeLevelSet(UniCtrlList[0].mode); //top clamping
|
BrakeLevelSet(UniCtrlList[0].mode); //top clamping
|
||||||
|
if (IsCabMaster())
|
||||||
|
{
|
||||||
while (BrakeCtrlPos > UniCtrlList[MainCtrlPos].mode) DecMainCtrl(1); //find nearest position
|
while (BrakeCtrlPos > UniCtrlList[MainCtrlPos].mode) DecMainCtrl(1); //find nearest position
|
||||||
while (BrakeCtrlPos < UniCtrlList[MainCtrlPos].mode) IncMainCtrl(1); //find nearest position
|
while (BrakeCtrlPos < UniCtrlList[MainCtrlPos].mode) IncMainCtrl(1); //find nearest position
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else //controller was moved
|
else //controller was moved
|
||||||
BrakeLevelSet(UniCtrlList[MainCtrlPos].mode);
|
BrakeLevelSet(UniCtrlList[MainCtrlPos].mode);
|
||||||
}
|
}
|
||||||
@@ -7266,7 +7313,8 @@ void TMoverParameters::CheckEIMIC(double dt)
|
|||||||
auto const eimicpowerenabled {
|
auto const eimicpowerenabled {
|
||||||
( ( true == Mains ) || ( Power == 0.0 ) )
|
( ( true == Mains ) || ( Power == 0.0 ) )
|
||||||
&& ( !SpringBrake.IsActive || !SpringBrakeCutsOffDrive )
|
&& ( !SpringBrake.IsActive || !SpringBrakeCutsOffDrive )
|
||||||
&& ( !LockPipe ) };
|
&& ( !LockPipe )
|
||||||
|
&& ( DirAbsolute != 0 ) };
|
||||||
auto const eimicdoorenabled {
|
auto const eimicdoorenabled {
|
||||||
(SpringBrake.IsActive && ReleaseParkingBySpringBrakeWhenDoorIsOpen)
|
(SpringBrake.IsActive && ReleaseParkingBySpringBrakeWhenDoorIsOpen)
|
||||||
};
|
};
|
||||||
@@ -8538,6 +8586,7 @@ TMoverParameters::update_doors( double const Deltatime ) {
|
|||||||
door.is_closed =
|
door.is_closed =
|
||||||
( door.position <= 0.f )
|
( door.position <= 0.f )
|
||||||
&& ( door.step_position <= 0.f );
|
&& ( door.step_position <= 0.f );
|
||||||
|
door.is_door_closed = (door.position <= 0.f);
|
||||||
|
|
||||||
door.local_open = door.local_open && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
door.local_open = door.local_open && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
||||||
door.remote_open = ( door.remote_open || Doors.remote_only ) && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
door.remote_open = ( door.remote_open || Doors.remote_only ) && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
||||||
@@ -10138,6 +10187,7 @@ void TMoverParameters::LoadFIZ_Doors( std::string const &line ) {
|
|||||||
extract_value( MirrorVelClose, "MirrorVelClose", line, "");
|
extract_value( MirrorVelClose, "MirrorVelClose", line, "");
|
||||||
|
|
||||||
extract_value( DoorsOpenWithPermitAfter, "DoorOpenWithPermit", line, "" );
|
extract_value( DoorsOpenWithPermitAfter, "DoorOpenWithPermit", line, "" );
|
||||||
|
extract_value( DoorsPermitLightBlinking, "DoorsPermitLightBlinking", line, "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMoverParameters::LoadFIZ_BuffCoupl( std::string const &line, int const Index ) {
|
void TMoverParameters::LoadFIZ_BuffCoupl( std::string const &line, int const Index ) {
|
||||||
@@ -10413,6 +10463,9 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
|||||||
0;
|
0;
|
||||||
extract_value( BackwardsBranchesAllowed, "BackwardsBranchesAllowed", line, "" );
|
extract_value( BackwardsBranchesAllowed, "BackwardsBranchesAllowed", line, "" );
|
||||||
|
|
||||||
|
extract_value( AutomaticCabActivation, "AutomaticCabActivation", line, "" );
|
||||||
|
extract_value( InactiveCabFlag, "InactiveCabFlag", line, "" );
|
||||||
|
|
||||||
extract_value( StopBrakeDecc, "SBD", line, "" );
|
extract_value( StopBrakeDecc, "SBD", line, "" );
|
||||||
extract_value( ReleaseParkingBySpringBrake, "ReleaseParkingBySpringBrake", line, "" );
|
extract_value( ReleaseParkingBySpringBrake, "ReleaseParkingBySpringBrake", line, "" );
|
||||||
extract_value( ReleaseParkingBySpringBrakeWhenDoorIsOpen, "ReleaseParkingBySpringBrakeWhenDoorIsOpen", line, "" );
|
extract_value( ReleaseParkingBySpringBrakeWhenDoorIsOpen, "ReleaseParkingBySpringBrakeWhenDoorIsOpen", line, "" );
|
||||||
@@ -11917,6 +11970,7 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
DirAbsolute = DirActive * CabActive;
|
DirAbsolute = DirActive * CabActive;
|
||||||
|
CabMaster = false;
|
||||||
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
|
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
|
||||||
}
|
}
|
||||||
else if (Command == "AutoRelaySwitch")
|
else if (Command == "AutoRelaySwitch")
|
||||||
|
|||||||
175
Train.cpp
175
Train.cpp
@@ -273,6 +273,9 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
|||||||
{ user_command::batterytoggle, &TTrain::OnCommand_batterytoggle },
|
{ user_command::batterytoggle, &TTrain::OnCommand_batterytoggle },
|
||||||
{ user_command::batteryenable, &TTrain::OnCommand_batteryenable },
|
{ user_command::batteryenable, &TTrain::OnCommand_batteryenable },
|
||||||
{ user_command::batterydisable, &TTrain::OnCommand_batterydisable },
|
{ user_command::batterydisable, &TTrain::OnCommand_batterydisable },
|
||||||
|
{ user_command::cabactivationtoggle, &TTrain::OnCommand_cabactivationtoggle },
|
||||||
|
{ user_command::cabactivationenable, &TTrain::OnCommand_cabactivationenable },
|
||||||
|
{ user_command::cabactivationdisable, &TTrain::OnCommand_cabactivationdisable },
|
||||||
{ user_command::pantographcompressorvalvetoggle, &TTrain::OnCommand_pantographcompressorvalvetoggle },
|
{ user_command::pantographcompressorvalvetoggle, &TTrain::OnCommand_pantographcompressorvalvetoggle },
|
||||||
{ user_command::pantographcompressorvalveenable, &TTrain::OnCommand_pantographcompressorvalveenable },
|
{ user_command::pantographcompressorvalveenable, &TTrain::OnCommand_pantographcompressorvalveenable },
|
||||||
{ user_command::pantographcompressorvalvedisable, &TTrain::OnCommand_pantographcompressorvalvedisable },
|
{ user_command::pantographcompressorvalvedisable, &TTrain::OnCommand_pantographcompressorvalvedisable },
|
||||||
@@ -400,6 +403,7 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
|||||||
{ user_command::doorcloseall, &TTrain::OnCommand_doorcloseall },
|
{ user_command::doorcloseall, &TTrain::OnCommand_doorcloseall },
|
||||||
{ user_command::doorsteptoggle, &TTrain::OnCommand_doorsteptoggle },
|
{ user_command::doorsteptoggle, &TTrain::OnCommand_doorsteptoggle },
|
||||||
{ user_command::doormodetoggle, &TTrain::OnCommand_doormodetoggle },
|
{ user_command::doormodetoggle, &TTrain::OnCommand_doormodetoggle },
|
||||||
|
{ user_command::mirrorstoggle, &TTrain::OnCommand_mirrorstoggle },
|
||||||
{ user_command::nearestcarcouplingincrease, &TTrain::OnCommand_nearestcarcouplingincrease },
|
{ user_command::nearestcarcouplingincrease, &TTrain::OnCommand_nearestcarcouplingincrease },
|
||||||
{ user_command::nearestcarcouplingdisconnect, &TTrain::OnCommand_nearestcarcouplingdisconnect },
|
{ user_command::nearestcarcouplingdisconnect, &TTrain::OnCommand_nearestcarcouplingdisconnect },
|
||||||
{ user_command::nearestcarcoupleradapterattach, &TTrain::OnCommand_nearestcarcoupleradapterattach },
|
{ user_command::nearestcarcoupleradapterattach, &TTrain::OnCommand_nearestcarcoupleradapterattach },
|
||||||
@@ -624,6 +628,8 @@ dictionary_source *TTrain::GetTrainState( dictionary_source const &Extraparamete
|
|||||||
|
|
||||||
dict->insert( "name", DynamicObject->asName );
|
dict->insert( "name", DynamicObject->asName );
|
||||||
dict->insert( "cab", mvOccupied->CabOccupied );
|
dict->insert( "cab", mvOccupied->CabOccupied );
|
||||||
|
dict->insert( "cabactive", mvOccupied->CabActive );
|
||||||
|
dict->insert( "master", mvOccupied->CabMaster );
|
||||||
// basic systems state data
|
// basic systems state data
|
||||||
dict->insert( "battery", mvOccupied->Power24vIsAvailable );
|
dict->insert( "battery", mvOccupied->Power24vIsAvailable );
|
||||||
dict->insert( "linebreaker", mvControlled->Mains );
|
dict->insert( "linebreaker", mvControlled->Mains );
|
||||||
@@ -699,6 +705,8 @@ dictionary_source *TTrain::GetTrainState( dictionary_source const &Extraparamete
|
|||||||
dict->insert( "radio_volume", Global.RadioVolume );
|
dict->insert( "radio_volume", Global.RadioVolume );
|
||||||
dict->insert( "door_lock", mvOccupied->Doors.lock_enabled );
|
dict->insert( "door_lock", mvOccupied->Doors.lock_enabled );
|
||||||
dict->insert( "door_step", mvOccupied->Doors.step_enabled );
|
dict->insert( "door_step", mvOccupied->Doors.step_enabled );
|
||||||
|
dict->insert( "door_permit_left", mvOccupied->Doors.instances[side::left].open_permit );
|
||||||
|
dict->insert( "door_permit_right", mvOccupied->Doors.instances[side::right].open_permit );
|
||||||
// movement data
|
// movement data
|
||||||
dict->insert( "velocity", std::abs( mvOccupied->Vel ) );
|
dict->insert( "velocity", std::abs( mvOccupied->Vel ) );
|
||||||
dict->insert( "tractionforce", std::abs( mvOccupied->Ft ) );
|
dict->insert( "tractionforce", std::abs( mvOccupied->Ft ) );
|
||||||
@@ -2354,6 +2362,65 @@ void TTrain::OnCommand_batterydisable( TTrain *Train, command_data const &Comman
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_cabactivationtoggle(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
if (Command.action != GLFW_REPEAT) {
|
||||||
|
// keep the switch from flipping back and forth if key is held down
|
||||||
|
if (0 == Train->mvOccupied->CabActive) {
|
||||||
|
// turn on
|
||||||
|
OnCommand_cabactivationenable(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//turn off
|
||||||
|
OnCommand_cabactivationdisable(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_cabactivationenable(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// visual feedback
|
||||||
|
if (Train->ggCabActivationButton.type() == TGaugeType::push) {
|
||||||
|
Train->ggCabActivationButton.UpdateValue(1.0f, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
Train->mvOccupied->CabActivisation();
|
||||||
|
|
||||||
|
// side-effects
|
||||||
|
if (Train->mvOccupied->LightsPosNo > 0) {
|
||||||
|
Train->Dynamic()->SetLights();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
|
if (Train->ggCabActivationButton.type() == TGaugeType::push) {
|
||||||
|
// return the switch to neutral position
|
||||||
|
Train->ggCabActivationButton.UpdateValue(0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_cabactivationdisable(TTrain *Train, command_data const &Command) {
|
||||||
|
// TBD, TODO: ewentualnie zablokować z FIZ, np. w samochodach się nie odłącza akumulatora
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// visual feedback
|
||||||
|
if (Train->ggCabActivationButton.type() == TGaugeType::push) {
|
||||||
|
Train->ggCabActivationButton.UpdateValue(0.0f, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
Train->mvOccupied->CabDeactivisation();
|
||||||
|
if ((Train->mvOccupied->LightsPosNo > 0) && (Train->mvOccupied->InactiveCabFlag & activation::redmarkers)) {
|
||||||
|
Train->Dynamic()->SetLights();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
|
if (Train->ggCabActivationButton.type() == TGaugeType::push) {
|
||||||
|
// return the switch to neutral position
|
||||||
|
Train->ggCabActivationButton.UpdateValue(0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
// HACK: presence of pantograph selector prevents manual operation of the individual valves
|
// HACK: presence of pantograph selector prevents manual operation of the individual valves
|
||||||
@@ -5209,12 +5276,12 @@ void TTrain::OnCommand_inverterenable(TTrain *Train, command_data const &Command
|
|||||||
p = (kier ? p->Next(flag) : p->Prev(flag));
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
}
|
}
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggInverterEnableButtons[itemindex].UpdateValue(1.0, Train->dsbSwitch);
|
item.UpdateValue(1.0, Train->dsbSwitch);
|
||||||
}
|
}
|
||||||
else if (Command.action == GLFW_RELEASE) {
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
// release
|
// release
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggInverterEnableButtons[itemindex].UpdateValue(0.0, Train->dsbSwitch);
|
item.UpdateValue(0.0, Train->dsbSwitch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5246,12 +5313,12 @@ void TTrain::OnCommand_inverterdisable(TTrain *Train, command_data const &Comman
|
|||||||
p = (kier ? p->Next(flag) : p->Prev(flag));
|
p = (kier ? p->Next(flag) : p->Prev(flag));
|
||||||
}
|
}
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggInverterDisableButtons[itemindex].UpdateValue(1.0, Train->dsbSwitch);
|
item.UpdateValue(1.0, Train->dsbSwitch);
|
||||||
}
|
}
|
||||||
else if (Command.action == GLFW_RELEASE) {
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
// release
|
// release
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggInverterDisableButtons[itemindex].UpdateValue(0.0, Train->dsbSwitch);
|
item.UpdateValue(0.0, Train->dsbSwitch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5273,7 +5340,7 @@ void TTrain::OnCommand_invertertoggle(TTrain *Train, command_data const &Command
|
|||||||
{
|
{
|
||||||
p->MoverParameters->Inverters[itemindex].Activate = !p->MoverParameters->Inverters[itemindex].Activate;
|
p->MoverParameters->Inverters[itemindex].Activate = !p->MoverParameters->Inverters[itemindex].Activate;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggInverterToggleButtons[itemindex].UpdateValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0, Train->dsbSwitch);
|
item.UpdateValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0, Train->dsbSwitch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5854,6 +5921,21 @@ void TTrain::OnCommand_doormodetoggle( TTrain *Train, command_data const &Comman
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_mirrorstoggle(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
if (Command.action != GLFW_PRESS) { return; }
|
||||||
|
|
||||||
|
// only reacting to press, so the sound can loop uninterrupted
|
||||||
|
if (false == Train->mvOccupied->MirrorForbidden) {
|
||||||
|
// turn on
|
||||||
|
Train->mvOccupied->MirrorForbidden = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// turn off
|
||||||
|
Train->mvOccupied->MirrorForbidden = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
if( ( true == Command.freefly )
|
if( ( true == Command.freefly )
|
||||||
@@ -5956,6 +6038,30 @@ void TTrain::OnCommand_occupiedcarcouplingdisconnect( TTrain *Train, command_dat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_occupiedcarcouplingdisconnectback(TTrain *Train, command_data const &Command) {
|
||||||
|
|
||||||
|
// if( false == Train->m_controlmapper.contains( "couplingdisconnect_sw:" ) ) { return; }
|
||||||
|
|
||||||
|
if (Command.action == GLFW_PRESS) {
|
||||||
|
// visual feedback
|
||||||
|
Train->m_couplingdisconnectback = true;
|
||||||
|
|
||||||
|
if (Train->iCabn == 0) { return; }
|
||||||
|
|
||||||
|
if (Train->DynamicObject) {
|
||||||
|
Train->DynamicObject->uncouple( 1 - Train->cab_to_end() );
|
||||||
|
if (Train->DynamicObject->Mechanik) {
|
||||||
|
// aktualizacja flag kierunku w składzie
|
||||||
|
Train->DynamicObject->Mechanik->CheckVehicles(Disconnect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Command.action == GLFW_RELEASE) {
|
||||||
|
// visual feedback
|
||||||
|
Train->m_couplingdisconnectback = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_departureannounce( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_departureannounce( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
if( Train->ggDepartureSignalButton.SubModel == nullptr ) {
|
if( Train->ggDepartureSignalButton.SubModel == nullptr ) {
|
||||||
@@ -6417,6 +6523,20 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
m_doorpermits = (
|
m_doorpermits = (
|
||||||
DynamicObject->Mechanik->IsAnyDoorPermitActive[ side::right ]
|
DynamicObject->Mechanik->IsAnyDoorPermitActive[ side::right ]
|
||||||
|| DynamicObject->Mechanik->IsAnyDoorPermitActive[ side::left ] );
|
|| DynamicObject->Mechanik->IsAnyDoorPermitActive[ side::left ] );
|
||||||
|
m_doorspermitleft = mvOccupied->Doors.instances[(cab_to_end() == end::front ? side::left : side::right)].open_permit
|
||||||
|
&& ((simulation::Time.data().wSecond % 2 < 1)
|
||||||
|
|| (mvOccupied->DoorsPermitLightBlinking < 1)
|
||||||
|
|| ((mvOccupied->DoorsPermitLightBlinking < 2)
|
||||||
|
&& (DynamicObject->Mechanik->IsAnyDoorOpen[(cab_to_end() == end::front ? side::left : side::right)])
|
||||||
|
|| ((mvOccupied->DoorsPermitLightBlinking < 3)
|
||||||
|
&& DynamicObject->Mechanik->IsAnyDoorOnlyOpen[(cab_to_end() == end::front ? side::left : side::right)])));
|
||||||
|
m_doorspermitright = mvOccupied->Doors.instances[(cab_to_end() == end::front ? side::right : side::left)].open_permit
|
||||||
|
&& ((simulation::Time.data().wSecond % 2 < 1)
|
||||||
|
|| (mvOccupied->DoorsPermitLightBlinking < 1)
|
||||||
|
|| ((mvOccupied->DoorsPermitLightBlinking < 2)
|
||||||
|
&& (DynamicObject->Mechanik->IsAnyDoorOpen[(cab_to_end() == end::front ? side::right : side::left)])
|
||||||
|
|| ((mvOccupied->DoorsPermitLightBlinking < 3)
|
||||||
|
&& DynamicObject->Mechanik->IsAnyDoorOnlyOpen[(cab_to_end() == end::front ? side::right : side::left)])));
|
||||||
}
|
}
|
||||||
m_dirforward = ( mvControlled->DirActive > 0 );
|
m_dirforward = ( mvControlled->DirActive > 0 );
|
||||||
m_dirneutral = ( mvControlled->DirActive == 0 );
|
m_dirneutral = ( mvControlled->DirActive == 0 );
|
||||||
@@ -7056,6 +7176,7 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
btLampkaMaxSila.Turn(abs(mvControlled->Im) >= 350);
|
btLampkaMaxSila.Turn(abs(mvControlled->Im) >= 350);
|
||||||
btLampkaPrzekrMaxSila.Turn(abs(mvControlled->Im) >= 450);
|
btLampkaPrzekrMaxSila.Turn(abs(mvControlled->Im) >= 450);
|
||||||
btLampkaRadio.Turn(mvOccupied->Radio);
|
btLampkaRadio.Turn(mvOccupied->Radio);
|
||||||
|
btLampkaRadioMessage.Turn(radio_message_played);
|
||||||
btLampkaRadioStop.Turn( mvOccupied->Radio && mvOccupied->RadioStopFlag );
|
btLampkaRadioStop.Turn( mvOccupied->Radio && mvOccupied->RadioStopFlag );
|
||||||
btLampkaHamulecReczny.Turn(mvOccupied->ManualBrakePos > 0);
|
btLampkaHamulecReczny.Turn(mvOccupied->ManualBrakePos > 0);
|
||||||
// NBMX wrzesien 2003 - drzwi oraz sygnał odjazdu
|
// NBMX wrzesien 2003 - drzwi oraz sygnał odjazdu
|
||||||
@@ -7132,6 +7253,7 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
btLampkaMaxSila.Turn( false );
|
btLampkaMaxSila.Turn( false );
|
||||||
btLampkaPrzekrMaxSila.Turn( false );
|
btLampkaPrzekrMaxSila.Turn( false );
|
||||||
btLampkaRadio.Turn( false );
|
btLampkaRadio.Turn( false );
|
||||||
|
btLampkaRadioMessage.Turn( false );
|
||||||
btLampkaRadioStop.Turn( false );
|
btLampkaRadioStop.Turn( false );
|
||||||
btLampkaHamulecReczny.Turn( false );
|
btLampkaHamulecReczny.Turn( false );
|
||||||
btLampkaDoorLeft.Turn( false );
|
btLampkaDoorLeft.Turn( false );
|
||||||
@@ -7572,6 +7694,11 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
ggBatteryButton.Update();
|
ggBatteryButton.Update();
|
||||||
ggBatteryOnButton.Update();
|
ggBatteryOnButton.Update();
|
||||||
ggBatteryOffButton.Update();
|
ggBatteryOffButton.Update();
|
||||||
|
if ((ggCabActivationButton.SubModel != nullptr) && (ggCabActivationButton.type() != TGaugeType::push))
|
||||||
|
{
|
||||||
|
ggCabActivationButton.UpdateValue(mvOccupied->IsCabMaster() ? 1.0 : 0.0);
|
||||||
|
}
|
||||||
|
ggCabActivationButton.Update();
|
||||||
|
|
||||||
ggWaterPumpBreakerButton.Update();
|
ggWaterPumpBreakerButton.Update();
|
||||||
ggWaterPumpButton.Update();
|
ggWaterPumpButton.Update();
|
||||||
@@ -7997,6 +8124,7 @@ void TTrain::update_sounds_runningnoise( sound_source &Sound ) {
|
|||||||
|
|
||||||
void TTrain::update_sounds_radio() {
|
void TTrain::update_sounds_radio() {
|
||||||
|
|
||||||
|
radio_message_played = false;
|
||||||
if( false == m_radiomessages.empty() ) {
|
if( false == m_radiomessages.empty() ) {
|
||||||
// erase completed radio messages from the list
|
// erase completed radio messages from the list
|
||||||
m_radiomessages.erase(
|
m_radiomessages.erase(
|
||||||
@@ -8016,17 +8144,23 @@ void TTrain::update_sounds_radio() {
|
|||||||
Global.RadioVolume :
|
Global.RadioVolume :
|
||||||
0.0 };
|
0.0 };
|
||||||
message.second->gain( volume );
|
message.second->gain( volume );
|
||||||
|
radio_message_played |= (true == radioenabled) && (Dynamic()->Mechanik != nullptr) && (message.first == RadioChannel());
|
||||||
}
|
}
|
||||||
// radiostop
|
// radiostop
|
||||||
if( m_radiostop ) {
|
if( m_radiostop ) {
|
||||||
if( ( true == radioenabled )
|
if( ( true == radioenabled )
|
||||||
&& ( true == mvOccupied->RadioStopFlag ) ) {
|
&& ( true == mvOccupied->RadioStopFlag ) ) {
|
||||||
m_radiostop->play( sound_flags::exclusive | sound_flags::looping );
|
m_radiostop->play( sound_flags::exclusive | sound_flags::looping );
|
||||||
|
radio_message_played |= true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_radiostop->stop();
|
m_radiostop->stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (radio_message_played)
|
||||||
|
{
|
||||||
|
btLampkaRadioMessage.gain(Global.RadioVolume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::update_screens(double dt) {
|
void TTrain::update_screens(double dt) {
|
||||||
@@ -8068,17 +8202,17 @@ bool TTrain::CabChange(int iDirection)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // jeśli pojazd prowadzony ręcznie albo wcale (wagon)
|
{ // jeśli pojazd prowadzony ręcznie albo wcale (wagon)
|
||||||
mvOccupied->CabDeactivisation();
|
mvOccupied->CabDeactivisationAuto();
|
||||||
if( mvOccupied->ChangeCab( iDirection ) ) {
|
if( mvOccupied->ChangeCab( iDirection ) ) {
|
||||||
if( InitializeCab( mvOccupied->CabOccupied, mvOccupied->TypeName + ".mmd" ) ) {
|
if( InitializeCab( mvOccupied->CabOccupied, mvOccupied->TypeName + ".mmd" ) ) {
|
||||||
// zmiana kabiny w ramach tego samego pojazdu
|
// zmiana kabiny w ramach tego samego pojazdu
|
||||||
mvOccupied->CabActivisation(); // załączenie rozrządu (wirtualne kabiny)
|
mvOccupied->CabActivisationAuto(); // załączenie rozrządu (wirtualne kabiny)
|
||||||
DynamicObject->Mechanik->DirectionChange();
|
DynamicObject->Mechanik->DirectionChange();
|
||||||
return true; // udało się zmienić kabinę
|
return true; // udało się zmienić kabinę
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// aktywizacja poprzedniej, bo jeszcze nie wiadomo, czy jakiś pojazd jest
|
// aktywizacja poprzedniej, bo jeszcze nie wiadomo, czy jakiś pojazd jest
|
||||||
mvOccupied->CabActivisation();
|
mvOccupied->CabActivisationAuto();
|
||||||
}
|
}
|
||||||
return false; // ewentualna zmiana pojazdu
|
return false; // ewentualna zmiana pojazdu
|
||||||
}
|
}
|
||||||
@@ -8625,7 +8759,7 @@ TTrain::MoveToVehicle(TDynamicObject *target) {
|
|||||||
Dynamic()->Mechanik->MoveTo( target );
|
Dynamic()->Mechanik->MoveTo( target );
|
||||||
|
|
||||||
target_train->Occupied()->LimPipePress = target_train->Occupied()->PipePress;
|
target_train->Occupied()->LimPipePress = target_train->Occupied()->PipePress;
|
||||||
target_train->Occupied()->CabActivisation( true ); // załączenie rozrządu (wirtualne kabiny)
|
target_train->Occupied()->CabActivisationAuto( true ); // załączenie rozrządu (wirtualne kabiny)
|
||||||
target_train->Dynamic()->MechInside = true;
|
target_train->Dynamic()->MechInside = true;
|
||||||
if( target_train->Dynamic()->Mechanik ) {
|
if( target_train->Dynamic()->Mechanik ) {
|
||||||
target_train->Dynamic()->Controller = target_train->Dynamic()->Mechanik->AIControllFlag;
|
target_train->Dynamic()->Controller = target_train->Dynamic()->Mechanik->AIControllFlag;
|
||||||
@@ -8686,7 +8820,7 @@ TTrain::MoveToVehicle(TDynamicObject *target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Occupied()->LimPipePress = Occupied()->PipePress;
|
Occupied()->LimPipePress = Occupied()->PipePress;
|
||||||
Occupied()->CabActivisation( true ); // załączenie rozrządu (wirtualne kabiny)
|
Occupied()->CabActivisationAuto( true ); // załączenie rozrządu (wirtualne kabiny)
|
||||||
} else {
|
} else {
|
||||||
Dynamic()->bDisplayCab = false;
|
Dynamic()->bDisplayCab = false;
|
||||||
Dynamic()->ABuSetModelShake( {} );
|
Dynamic()->ABuSetModelShake( {} );
|
||||||
@@ -8862,6 +8996,7 @@ void TTrain::clear_cab_controls()
|
|||||||
ggBatteryButton.Clear();
|
ggBatteryButton.Clear();
|
||||||
ggBatteryOnButton.Clear();
|
ggBatteryOnButton.Clear();
|
||||||
ggBatteryOffButton.Clear();
|
ggBatteryOffButton.Clear();
|
||||||
|
ggCabActivationButton.Clear();
|
||||||
//-------
|
//-------
|
||||||
ggFuseButton.Clear();
|
ggFuseButton.Clear();
|
||||||
ggConverterFuseButton.Clear();
|
ggConverterFuseButton.Clear();
|
||||||
@@ -8952,6 +9087,7 @@ void TTrain::clear_cab_controls()
|
|||||||
btLampkaMaxSila.Clear();
|
btLampkaMaxSila.Clear();
|
||||||
btLampkaPrzekrMaxSila.Clear();
|
btLampkaPrzekrMaxSila.Clear();
|
||||||
btLampkaRadio.Clear();
|
btLampkaRadio.Clear();
|
||||||
|
btLampkaRadioMessage.Clear();
|
||||||
btLampkaRadioStop.Clear();
|
btLampkaRadioStop.Clear();
|
||||||
btLampkaHamulecReczny.Clear();
|
btLampkaHamulecReczny.Clear();
|
||||||
btLampkaBlokadaDrzwi.Clear();
|
btLampkaBlokadaDrzwi.Clear();
|
||||||
@@ -9037,6 +9173,11 @@ void TTrain::set_cab_controls( int const Cab ) {
|
|||||||
( ggBatteryButton.type() == TGaugeType::push ? 0.5f :
|
( ggBatteryButton.type() == TGaugeType::push ? 0.5f :
|
||||||
mvOccupied->Power24vIsAvailable ? 1.f :
|
mvOccupied->Power24vIsAvailable ? 1.f :
|
||||||
0.f ) );
|
0.f ) );
|
||||||
|
// activation
|
||||||
|
ggCabActivationButton.PutValue(
|
||||||
|
(ggCabActivationButton.type() == TGaugeType::push ? 0.5f :
|
||||||
|
mvOccupied->IsCabMaster() ? 1.f :
|
||||||
|
0.f));
|
||||||
// line breaker
|
// line breaker
|
||||||
if( ggMainButton.SubModel != nullptr ) { // instead of single main button there can be on/off pair
|
if( ggMainButton.SubModel != nullptr ) { // instead of single main button there can be on/off pair
|
||||||
ggMainButton.PutValue(
|
ggMainButton.PutValue(
|
||||||
@@ -9364,7 +9505,7 @@ void TTrain::set_cab_controls( int const Cab ) {
|
|||||||
if (itemindex < p->MoverParameters->InvertersNo)
|
if (itemindex < p->MoverParameters->InvertersNo)
|
||||||
{
|
{
|
||||||
// visual feedback
|
// visual feedback
|
||||||
ggInverterToggleButtons[itemindex].PutValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0);
|
ggInverterToggleButtons[itemstart-1].PutValue(p->MoverParameters->Inverters[itemindex].Activate ? 1.0 : 0.0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -9389,6 +9530,7 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
|
|||||||
{ "i-maxft:", btLampkaMaxSila },
|
{ "i-maxft:", btLampkaMaxSila },
|
||||||
{ "i-maxftt:", btLampkaPrzekrMaxSila },
|
{ "i-maxftt:", btLampkaPrzekrMaxSila },
|
||||||
{ "i-radio:", btLampkaRadio },
|
{ "i-radio:", btLampkaRadio },
|
||||||
|
{ "i-radiomessage:", btLampkaRadioMessage },
|
||||||
{ "i-radiostop:", btLampkaRadioStop },
|
{ "i-radiostop:", btLampkaRadioStop },
|
||||||
{ "i-manual_brake:", btLampkaHamulecReczny },
|
{ "i-manual_brake:", btLampkaHamulecReczny },
|
||||||
{ "i-door_blocked:", btLampkaBlokadaDrzwi },
|
{ "i-door_blocked:", btLampkaBlokadaDrzwi },
|
||||||
@@ -9492,8 +9634,8 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
|
|||||||
// TODO: move viable dedicated lights to the automatic light array
|
// TODO: move viable dedicated lights to the automatic light array
|
||||||
std::unordered_map<std::string, bool const *> const autolights = {
|
std::unordered_map<std::string, bool const *> const autolights = {
|
||||||
{ "i-doors:", &m_doors },
|
{ "i-doors:", &m_doors },
|
||||||
{ "i-doorpermit_left:", &mvOccupied->Doors.instances[ ( cab_to_end() == end::front ? side::left : side::right ) ].open_permit },
|
{ "i-doorpermit_left:", &m_doorspermitleft },
|
||||||
{ "i-doorpermit_right:", &mvOccupied->Doors.instances[ ( cab_to_end() == end::front ? side::right : side::left ) ].open_permit },
|
{ "i-doorpermit_right:", &m_doorspermitright },
|
||||||
{ "i-doorpermit_any:", &m_doorpermits },
|
{ "i-doorpermit_any:", &m_doorpermits },
|
||||||
{ "i-doorstep:", &mvOccupied->Doors.step_enabled },
|
{ "i-doorstep:", &mvOccupied->Doors.step_enabled },
|
||||||
{ "i-mainpipelock:", &mvOccupied->LockPipe },
|
{ "i-mainpipelock:", &mvOccupied->LockPipe },
|
||||||
@@ -9659,6 +9801,7 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
{ "battery_sw:", ggBatteryButton },
|
{ "battery_sw:", ggBatteryButton },
|
||||||
{ "batteryon_sw:", ggBatteryOnButton },
|
{ "batteryon_sw:", ggBatteryOnButton },
|
||||||
{ "batteryoff_sw:", ggBatteryOffButton },
|
{ "batteryoff_sw:", ggBatteryOffButton },
|
||||||
|
{ "cabactivation_sw:", ggCabActivationButton },
|
||||||
{ "distancecounter_sw:", ggDistanceCounterButton },
|
{ "distancecounter_sw:", ggDistanceCounterButton },
|
||||||
{ "relayreset1_bt:", ggRelayResetButtons[ 0 ] },
|
{ "relayreset1_bt:", ggRelayResetButtons[ 0 ] },
|
||||||
{ "relayreset2_bt:", ggRelayResetButtons[ 1 ] },
|
{ "relayreset2_bt:", ggRelayResetButtons[ 1 ] },
|
||||||
@@ -9738,8 +9881,8 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
{ "speedbutton7:", { ggSpeedCtrlButtons[ 7 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
{ "speedbutton7:", { ggSpeedCtrlButtons[ 7 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
||||||
{ "speedbutton8:", { ggSpeedCtrlButtons[ 8 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
{ "speedbutton8:", { ggSpeedCtrlButtons[ 8 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
||||||
{ "speedbutton9:", { ggSpeedCtrlButtons[ 9 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
{ "speedbutton9:", { ggSpeedCtrlButtons[ 9 ], &mvOccupied->SpeedCtrlUnit.IsActive } },
|
||||||
{ "doorleftpermit_sw:", { ggDoorLeftPermitButton, &mvOccupied->Doors.instances[ ( cab_to_end() == end::front ? side::left : side::right ) ].open_permit } },
|
{ "doorleftpermit_sw:", { ggDoorLeftPermitButton, &m_doorspermitleft } },
|
||||||
{ "doorrightpermit_sw:", { ggDoorRightPermitButton, &mvOccupied->Doors.instances[ ( cab_to_end() == end::front ? side::right : side::left ) ].open_permit } },
|
{ "doorrightpermit_sw:", { ggDoorRightPermitButton, &m_doorspermitright } },
|
||||||
{ "dooralloff_sw:", { ggDoorAllOffButton, &m_doors } },
|
{ "dooralloff_sw:", { ggDoorAllOffButton, &m_doors } },
|
||||||
{ "doorstep_sw:", { ggDoorStepButton, &mvOccupied->Doors.step_enabled } },
|
{ "doorstep_sw:", { ggDoorStepButton, &mvOccupied->Doors.step_enabled } },
|
||||||
{ "dirforward_bt:", { ggDirForwardButton, &m_dirforward } },
|
{ "dirforward_bt:", { ggDirForwardButton, &m_dirforward } },
|
||||||
@@ -9768,6 +9911,8 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
{ "cablight_sw:", &Cabine[ iCabn ].bLight },
|
{ "cablight_sw:", &Cabine[ iCabn ].bLight },
|
||||||
{ "springbraketoggle_bt:", &mvOccupied->SpringBrake.Activate },
|
{ "springbraketoggle_bt:", &mvOccupied->SpringBrake.Activate },
|
||||||
{ "couplingdisconnect_sw:", &m_couplingdisconnect },
|
{ "couplingdisconnect_sw:", &m_couplingdisconnect },
|
||||||
|
{ "couplingdisconnectback_sw:", &m_couplingdisconnectback },
|
||||||
|
{ "mirrors_sw:", &mvOccupied->MirrorForbidden },
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
auto lookup = autoboolgauges.find( Label );
|
auto lookup = autoboolgauges.find( Label );
|
||||||
|
|||||||
11
Train.h
11
Train.h
@@ -292,6 +292,9 @@ class TTrain {
|
|||||||
static void OnCommand_batterytoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_batterytoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_batteryenable( TTrain *Train, command_data const &Command );
|
static void OnCommand_batteryenable( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_batterydisable( TTrain *Train, command_data const &Command );
|
static void OnCommand_batterydisable( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_cabactivationtoggle(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_cabactivationenable(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_cabactivationdisable(TTrain *Train, command_data const &Command);
|
||||||
static void OnCommand_pantographcompressorvalvetoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographcompressorvalvetoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_pantographcompressorvalveenable( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographcompressorvalveenable( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_pantographcompressorvalvedisable( TTrain *Train, command_data const &Command );
|
static void OnCommand_pantographcompressorvalvedisable( TTrain *Train, command_data const &Command );
|
||||||
@@ -421,11 +424,13 @@ class TTrain {
|
|||||||
static void OnCommand_doorcloseall( TTrain *Train, command_data const &Command );
|
static void OnCommand_doorcloseall( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_doorsteptoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_doorsteptoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_doormodetoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_doormodetoggle( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_mirrorstoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command );
|
static void OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_nearestcarcouplingdisconnect( TTrain *Train, command_data const &Command );
|
static void OnCommand_nearestcarcouplingdisconnect( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_nearestcarcoupleradapterattach( TTrain *Train, command_data const &Command );
|
static void OnCommand_nearestcarcoupleradapterattach( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_nearestcarcoupleradapterremove( TTrain *Train, command_data const &Command );
|
static void OnCommand_nearestcarcoupleradapterremove( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_occupiedcarcouplingdisconnect( TTrain *Train, command_data const &Command );
|
static void OnCommand_occupiedcarcouplingdisconnect( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_occupiedcarcouplingdisconnectback( 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_hornlowactivate( 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_hornhighactivate( TTrain *Train, command_data const &Command );
|
||||||
@@ -597,6 +602,7 @@ public: // reszta może by?publiczna
|
|||||||
TGauge ggBatteryButton; // Stele 161228 hebelek baterii
|
TGauge ggBatteryButton; // Stele 161228 hebelek baterii
|
||||||
TGauge ggBatteryOnButton;
|
TGauge ggBatteryOnButton;
|
||||||
TGauge ggBatteryOffButton;
|
TGauge ggBatteryOffButton;
|
||||||
|
TGauge ggCabActivationButton; // Stele 161228 hebelek baterii
|
||||||
|
|
||||||
// NBMX wrzesien 2003 - obsluga drzwi
|
// NBMX wrzesien 2003 - obsluga drzwi
|
||||||
TGauge ggDoorLeftPermitButton;
|
TGauge ggDoorLeftPermitButton;
|
||||||
@@ -673,6 +679,7 @@ public: // reszta może by?publiczna
|
|||||||
TButton btLampkaUkrotnienie;
|
TButton btLampkaUkrotnienie;
|
||||||
TButton btLampkaHamPosp;
|
TButton btLampkaHamPosp;
|
||||||
TButton btLampkaRadio;
|
TButton btLampkaRadio;
|
||||||
|
TButton btLampkaRadioMessage;
|
||||||
TButton btLampkaRadioStop;
|
TButton btLampkaRadioStop;
|
||||||
TButton btLampkaHamowanie1zes;
|
TButton btLampkaHamowanie1zes;
|
||||||
TButton btLampkaHamowanie2zes;
|
TButton btLampkaHamowanie2zes;
|
||||||
@@ -831,6 +838,8 @@ private:
|
|||||||
float m_distancecounter { -1.f }; // distance traveled since meter was activated or -1 if inactive
|
float m_distancecounter { -1.f }; // distance traveled since meter was activated or -1 if inactive
|
||||||
double m_brakehandlecp{ 0.0 };
|
double m_brakehandlecp{ 0.0 };
|
||||||
bool m_doors{ false }; // helper, true if any door is open
|
bool m_doors{ false }; // helper, true if any door is open
|
||||||
|
bool m_doorspermitleft{ false }; // helper, true if door is open, blinking if door is pemitted
|
||||||
|
bool m_doorspermitright{ false }; // helper, true if door is open, blinking if door is pemitted
|
||||||
bool m_dirforward{ false }; // helper, true if direction set to forward
|
bool m_dirforward{ false }; // helper, true if direction set to forward
|
||||||
bool m_dirneutral{ false }; // helper, true if direction set to neutral
|
bool m_dirneutral{ false }; // helper, true if direction set to neutral
|
||||||
bool m_dirbackward{ false }; // helper, true if direction set to backward
|
bool m_dirbackward{ false }; // helper, true if direction set to backward
|
||||||
@@ -838,6 +847,7 @@ private:
|
|||||||
float m_doorpermittimers[2] = { -1.f, -1.f };
|
float m_doorpermittimers[2] = { -1.f, -1.f };
|
||||||
// ld substitute
|
// ld substitute
|
||||||
bool m_couplingdisconnect { false };
|
bool m_couplingdisconnect { false };
|
||||||
|
bool m_couplingdisconnectback { false };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
float fPress[20][6]; // cisnienia dla wszystkich czlonow
|
float fPress[20][6]; // cisnienia dla wszystkich czlonow
|
||||||
@@ -846,6 +856,7 @@ private:
|
|||||||
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||||
float fDieselParams[9][10]; // parametry dla silnikow asynchronicznych
|
float fDieselParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||||
// plays provided sound from position of the radio
|
// plays provided sound from position of the radio
|
||||||
|
bool radio_message_played;
|
||||||
void radio_message( sound_source *Message, int const Channel );
|
void radio_message( sound_source *Message, int const Channel );
|
||||||
inline auto const RadioChannel() const { return ( Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1 ); }
|
inline auto const RadioChannel() const { return ( Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1 ); }
|
||||||
inline auto &RadioChannel() { return Dynamic()->Mechanik->iRadioChannel; }
|
inline auto &RadioChannel() { return Dynamic()->Mechanik->iRadioChannel; }
|
||||||
|
|||||||
159
command.cpp
159
command.cpp
@@ -22,161 +22,7 @@ namespace simulation {
|
|||||||
command_queue Commands;
|
command_queue Commands;
|
||||||
commanddescription_sequence Commands_descriptions = {
|
commanddescription_sequence Commands_descriptions = {
|
||||||
|
|
||||||
{ "aidriverenable", command_target::vehicle, command_mode::oneoff },
|
aphcompressorvalveenable", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "aidriverdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "jointcontrollerset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mastercontrollerincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mastercontrollerincreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mastercontrollerdecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mastercontrollerdecreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mastercontrollerset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "secondcontrollerincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "secondcontrollerincreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "secondcontrollerdecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "secondcontrollerdecreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "secondcontrollerset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mucurrentindicatorothersourceactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "independentbrakeincrease", command_target::vehicle, command_mode::continuous },
|
|
||||||
{ "independentbrakeincreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "independentbrakedecrease", command_target::vehicle, command_mode::continuous },
|
|
||||||
{ "independentbrakedecreasefast", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "independentbrakeset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "independentbrakebailoff", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalbrakebutton1", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalbrakebutton2", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalbrakebutton3", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeincrease", command_target::vehicle, command_mode::continuous },
|
|
||||||
{ "trainbrakedecrease", command_target::vehicle, command_mode::continuous },
|
|
||||||
{ "trainbrakeset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakecharging", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakerelease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakefirstservice", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeservice", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakefullservice", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakehandleoff", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeemergency", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakebasepressureincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakebasepressuredecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakebasepressurereset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeoperationtoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "manualbrakeincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "manualbrakedecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "alarmchaintoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "wheelspinbrakeactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "sandboxactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "autosandboxtoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "autosandboxactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "autosandboxdeactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserdecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserforwardhigh", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserforward", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserneutral", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "reverserbackward", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumpbreakertoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumpbreakerclose", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumpbreakeropen", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumptoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumpenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterpumpdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheaterbreakertoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheaterbreakerclose", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheaterbreakeropen", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheatertoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheaterenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "waterheaterdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "watercircuitslinktoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "watercircuitslinkenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "watercircuitslinkdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "fuelpumptoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "fuelpumpenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "fuelpumpdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "oilpumptoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "oilpumpenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "oilpumpdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "linebreakertoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "linebreakeropen", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "linebreakerclose", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "convertertoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "converterenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "converterdisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "convertertogglelocal", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "converteroverloadrelayreset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressortoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressorenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressordisable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressortogglelocal", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressorpresetactivatenext", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressorpresetactivateprevious", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "compressorpresetactivatedefault", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "motoroverloadrelaythresholdtoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "motoroverloadrelaythresholdsetlow", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "motoroverloadrelaythresholdsethigh", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "motoroverloadrelayreset", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalrelayreset1", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalrelayreset2", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "universalrelayreset3", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "notchingrelaytoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "epbrakecontroltoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeoperationmodeincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "trainbrakeoperationmodedecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeactingspeedincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeactingspeeddecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeactingspeedsetcargo", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeactingspeedsetpassenger", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeactingspeedsetrapid", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeloadcompensationincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "brakeloadcompensationdecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "mubrakingindicatortoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "alerteracknowledge", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "cabsignalacknowledge", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "hornlowactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "hornhighactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "whistleactivate", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiotoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiochannelincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiochanneldecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiostopsend", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiostoptest", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiocall3send", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiovolumeincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "radiovolumedecrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "cabchangeforward", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "cabchangebackward", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "viewturn", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "movehorizontal", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "movehorizontalfast", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "movevertical", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveverticalfast", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveleft", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveright", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveforward", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveback", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "moveup", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "movedown", command_target::entity, command_mode::oneoff },
|
|
||||||
{ "nearestcarcouplingincrease", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "nearestcarcouplingdisconnect", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "nearestcarcoupleradapterattach", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "nearestcarcoupleradapterremove", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "occupiedcarcouplingdisconnect", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doortoggleleft", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doortoggleright", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorpermitleft", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorpermitright", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorpermitpresetactivatenext", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorpermitpresetactivateprevious", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "dooropenleft", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "dooropenright", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "dooropenall", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorcloseleft", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorcloseright", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorcloseall", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorsteptoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doormodetoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "departureannounce", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "doorlocktoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "pantographcompressorvalvetoggle", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "pantographcompressorvalveenable", command_target::vehicle, command_mode::oneoff },
|
|
||||||
{ "pantographcompressorvalvedisable", command_target::vehicle, command_mode::oneoff },
|
{ "pantographcompressorvalvedisable", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "pantographcompressoractivate", command_target::vehicle, command_mode::oneoff },
|
{ "pantographcompressoractivate", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "pantographtogglefront", command_target::vehicle, command_mode::oneoff },
|
{ "pantographtogglefront", command_target::vehicle, command_mode::oneoff },
|
||||||
@@ -253,6 +99,9 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "batterytoggle", command_target::vehicle, command_mode::oneoff },
|
{ "batterytoggle", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "batteryenable", command_target::vehicle, command_mode::oneoff },
|
{ "batteryenable", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "batterydisable", command_target::vehicle, command_mode::oneoff },
|
{ "batterydisable", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "cabactivationtoggle", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "cabactivationenable", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "cabactivationdisable", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "motorblowerstogglefront", command_target::vehicle, command_mode::oneoff },
|
{ "motorblowerstogglefront", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "motorblowerstogglerear", command_target::vehicle, command_mode::oneoff },
|
{ "motorblowerstogglerear", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "motorblowersdisableall", command_target::vehicle, command_mode::oneoff },
|
{ "motorblowersdisableall", command_target::vehicle, command_mode::oneoff },
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ enum class user_command {
|
|||||||
nearestcarcoupleradapterattach,
|
nearestcarcoupleradapterattach,
|
||||||
nearestcarcoupleradapterremove,
|
nearestcarcoupleradapterremove,
|
||||||
occupiedcarcouplingdisconnect,
|
occupiedcarcouplingdisconnect,
|
||||||
|
occupiedcarcouplingdisconnectback,
|
||||||
doortoggleleft,
|
doortoggleleft,
|
||||||
doortoggleright,
|
doortoggleright,
|
||||||
doorpermitleft,
|
doorpermitleft,
|
||||||
@@ -168,6 +169,7 @@ enum class user_command {
|
|||||||
doorcloseall,
|
doorcloseall,
|
||||||
doorsteptoggle,
|
doorsteptoggle,
|
||||||
doormodetoggle,
|
doormodetoggle,
|
||||||
|
mirrorstoggle,
|
||||||
departureannounce,
|
departureannounce,
|
||||||
doorlocktoggle,
|
doorlocktoggle,
|
||||||
pantographcompressorvalvetoggle,
|
pantographcompressorvalvetoggle,
|
||||||
@@ -248,6 +250,9 @@ enum class user_command {
|
|||||||
batterytoggle,
|
batterytoggle,
|
||||||
batteryenable,
|
batteryenable,
|
||||||
batterydisable,
|
batterydisable,
|
||||||
|
cabactivationtoggle,
|
||||||
|
cabactivationenable,
|
||||||
|
cabactivationdisable,
|
||||||
motorblowerstogglefront,
|
motorblowerstogglefront,
|
||||||
motorblowerstogglerear,
|
motorblowerstogglerear,
|
||||||
motorblowersdisableall,
|
motorblowersdisableall,
|
||||||
|
|||||||
@@ -101,6 +101,30 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
|||||||
return ( ( mvOccupied->BatteryStart != start_t::manual ) || ( mvOccupied->Power24vIsAvailable == false ) ); } );
|
return ( ( mvOccupied->BatteryStart != start_t::manual ) || ( mvOccupied->Power24vIsAvailable == false ) ); } );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// battery
|
||||||
|
case locale::string::driver_hint_cabactivation: {
|
||||||
|
if (AIControllFlag && mvOccupied->Power24vIsAvailable) {
|
||||||
|
mvOccupied->CabActivisation();
|
||||||
|
CheckVehicles();
|
||||||
|
}
|
||||||
|
remove_hint( locale::string::driver_hint_cabdeactivation );
|
||||||
|
hint(
|
||||||
|
Action,
|
||||||
|
[this](float const Parameter) -> bool {
|
||||||
|
return ( ( mvOccupied->AutomaticCabActivation ) || ( mvOccupied->IsCabMaster() ) ); } );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case locale::string::driver_hint_cabdeactivation: {
|
||||||
|
if (AIControllFlag) {
|
||||||
|
mvOccupied->CabDeactivisation();
|
||||||
|
}
|
||||||
|
remove_hint( locale::string::driver_hint_cabactivation );
|
||||||
|
hint(
|
||||||
|
Action,
|
||||||
|
[this](float const Parameter) -> bool {
|
||||||
|
return ( ( mvOccupied->AutomaticCabActivation ) || ( ( mvOccupied->CabMaster == false ) && ( mvOccupied->CabActive == 0 ) ) ); } );
|
||||||
|
break;
|
||||||
|
}
|
||||||
// radio
|
// radio
|
||||||
case driver_hint::radioon: {
|
case driver_hint::radioon: {
|
||||||
if( AIControllFlag ) {
|
if( AIControllFlag ) {
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ driverkeyboard_input::default_bindings() {
|
|||||||
{ user_command::doorcloseall, GLFW_KEY_SLASH | keymodifier::control },
|
{ user_command::doorcloseall, GLFW_KEY_SLASH | keymodifier::control },
|
||||||
// doorsteptoggle,
|
// doorsteptoggle,
|
||||||
{ user_command::doormodetoggle, GLFW_KEY_SLASH | keymodifier::shift | keymodifier::control },
|
{ user_command::doormodetoggle, GLFW_KEY_SLASH | keymodifier::shift | keymodifier::control },
|
||||||
|
// mirrorstoggle,
|
||||||
{ user_command::departureannounce, GLFW_KEY_SLASH },
|
{ user_command::departureannounce, GLFW_KEY_SLASH },
|
||||||
{ user_command::doorlocktoggle, GLFW_KEY_S | keymodifier::control },
|
{ user_command::doorlocktoggle, GLFW_KEY_S | keymodifier::control },
|
||||||
{ user_command::pantographcompressorvalvetoggle, GLFW_KEY_V | keymodifier::control },
|
{ user_command::pantographcompressorvalvetoggle, GLFW_KEY_V | keymodifier::control },
|
||||||
@@ -254,6 +255,9 @@ driverkeyboard_input::default_bindings() {
|
|||||||
{ user_command::batterytoggle, GLFW_KEY_J },
|
{ user_command::batterytoggle, GLFW_KEY_J },
|
||||||
// batteryenable,
|
// batteryenable,
|
||||||
// batterydisable,
|
// batterydisable,
|
||||||
|
// cabactivationtoggle,
|
||||||
|
// cabactivationenable,
|
||||||
|
// cabactivationdisable,
|
||||||
{ user_command::motorblowerstogglefront, GLFW_KEY_N | keymodifier::shift },
|
{ user_command::motorblowerstogglefront, GLFW_KEY_N | keymodifier::shift },
|
||||||
{ user_command::motorblowerstogglerear, GLFW_KEY_M | keymodifier::shift },
|
{ user_command::motorblowerstogglerear, GLFW_KEY_M | keymodifier::shift },
|
||||||
{ user_command::motorblowersdisableall, GLFW_KEY_M | keymodifier::control },
|
{ user_command::motorblowersdisableall, GLFW_KEY_M | keymodifier::control },
|
||||||
|
|||||||
@@ -704,6 +704,9 @@ drivermouse_input::default_bindings() {
|
|||||||
{ "doormode_sw:", {
|
{ "doormode_sw:", {
|
||||||
user_command::doormodetoggle,
|
user_command::doormodetoggle,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
|
{ "mirrors_sw:", {
|
||||||
|
user_command::mirrorstoggle,
|
||||||
|
user_command::none } },
|
||||||
{ "departure_signal_bt:", {
|
{ "departure_signal_bt:", {
|
||||||
user_command::departureannounce,
|
user_command::departureannounce,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
@@ -875,9 +878,15 @@ drivermouse_input::default_bindings() {
|
|||||||
{ "batteryoff_sw:", {
|
{ "batteryoff_sw:", {
|
||||||
user_command::batterydisable,
|
user_command::batterydisable,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
|
{ "cabactivation_sw:", {
|
||||||
|
user_command::cabactivationtoggle,
|
||||||
|
user_command::none } },
|
||||||
{ "couplingdisconnect_sw:",{
|
{ "couplingdisconnect_sw:",{
|
||||||
user_command::occupiedcarcouplingdisconnect,
|
user_command::occupiedcarcouplingdisconnect,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
|
{ "couplingdisconnectback_sw:",{
|
||||||
|
user_command::occupiedcarcouplingdisconnectback,
|
||||||
|
user_command::none } },
|
||||||
{ "universal0:", {
|
{ "universal0:", {
|
||||||
user_command::generictoggle0,
|
user_command::generictoggle0,
|
||||||
user_command::none } },
|
user_command::none } },
|
||||||
|
|||||||
Reference in New Issue
Block a user