mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 13:39:18 +02:00
reformat: remove redundant qualifiers
This commit is contained in:
@@ -222,7 +222,7 @@ void eu07_application::DiscordRPCService()
|
||||
while (!glfwWindowShouldClose(m_windows.front()) && !m_modestack.empty() && !Global.applicationQuitOrder)
|
||||
{
|
||||
const auto currentMode = m_modestack.top();
|
||||
if (currentMode == mode::launcher)
|
||||
if (currentMode == launcher)
|
||||
{
|
||||
// in launcher mode
|
||||
|
||||
@@ -236,7 +236,7 @@ void eu07_application::DiscordRPCService()
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // update RPC every 5 secs
|
||||
continue;
|
||||
}
|
||||
else if (currentMode == mode::scenarioloader)
|
||||
else if (currentMode == scenarioloader)
|
||||
{
|
||||
std::string rpcScnName = Global.SceneryFile;
|
||||
if (rpcScnName[0] == '$')
|
||||
@@ -261,7 +261,7 @@ void eu07_application::DiscordRPCService()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (currentMode != mode::driver)
|
||||
if (currentMode != driver)
|
||||
continue;
|
||||
|
||||
// Discord RPC updater
|
||||
@@ -1009,7 +1009,7 @@ void eu07_application::init_debug()
|
||||
void eu07_application::init_console()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
HWND consoleWnd = ::GetConsoleWindow();
|
||||
HWND consoleWnd = GetConsoleWindow();
|
||||
const bool hadConsole = consoleWnd != nullptr;
|
||||
|
||||
if (Global.ShowSystemConsole)
|
||||
@@ -1019,7 +1019,7 @@ void eu07_application::init_console()
|
||||
// no console inherited (e.g. WINDOWS subsystem build, or launched
|
||||
// detached) -- create one and wire stdio to it so printf in
|
||||
// utilities/Logs.cpp actually reaches the user
|
||||
if (::AllocConsole())
|
||||
if (AllocConsole())
|
||||
{
|
||||
FILE *fp = nullptr;
|
||||
freopen_s(&fp, "CONOUT$", "w", stdout);
|
||||
@@ -1031,7 +1031,7 @@ void eu07_application::init_console()
|
||||
std::cerr.clear();
|
||||
std::clog.clear();
|
||||
std::cin.clear();
|
||||
consoleWnd = ::GetConsoleWindow();
|
||||
consoleWnd = GetConsoleWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1047,7 +1047,7 @@ void eu07_application::init_console()
|
||||
// as text ("←[32m" etc). Open CONOUT$ directly to get the real screen
|
||||
// buffer handle, then flip VT on it.
|
||||
auto enable_vt = [](const char *devName) {
|
||||
const HANDLE h = ::CreateFileA(
|
||||
const HANDLE h = CreateFileA(
|
||||
devName,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
@@ -1058,11 +1058,11 @@ void eu07_application::init_console()
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
DWORD mode = 0;
|
||||
if (::GetConsoleMode(h, &mode))
|
||||
if (GetConsoleMode(h, &mode))
|
||||
{
|
||||
::SetConsoleMode(h, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
||||
SetConsoleMode(h, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
||||
}
|
||||
::CloseHandle(h);
|
||||
CloseHandle(h);
|
||||
};
|
||||
// CONOUT$ is the console's active screen buffer; enabling VT on it
|
||||
// affects everything that ends up being written there, regardless of
|
||||
@@ -1071,9 +1071,9 @@ void eu07_application::init_console()
|
||||
|
||||
if (consoleWnd)
|
||||
{
|
||||
::ShowWindow(consoleWnd, SW_SHOW);
|
||||
ShowWindow(consoleWnd, SW_SHOW);
|
||||
// give the console a recognisable title
|
||||
::SetConsoleTitleA("MaSzyna log");
|
||||
SetConsoleTitleA("MaSzyna log");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1081,7 +1081,7 @@ void eu07_application::init_console()
|
||||
// user wants no console window -- hide whatever we have
|
||||
if (consoleWnd)
|
||||
{
|
||||
::ShowWindow(consoleWnd, SW_HIDE);
|
||||
ShowWindow(consoleWnd, SW_HIDE);
|
||||
}
|
||||
// if we'd allocated one ourselves on a previous run path we'd FreeConsole here,
|
||||
// but on first init the console (if any) was inherited from the launcher and
|
||||
@@ -1298,7 +1298,7 @@ int eu07_application::init_glfw()
|
||||
Hwnd = glfwGetWin32Window(mainwindow);
|
||||
BaseWindowProc = (WNDPROC)::SetWindowLongPtr(Hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc);
|
||||
// switch off the topmost flag
|
||||
::SetWindowPos(Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
SetWindowPos(Hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -1431,9 +1431,9 @@ int eu07_application::init_modes()
|
||||
|
||||
// activate the default mode
|
||||
if (Global.SceneryFile.empty())
|
||||
push_mode(mode::launcher);
|
||||
push_mode(launcher);
|
||||
else
|
||||
push_mode(mode::scenarioloader);
|
||||
push_mode(scenarioloader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
bool
|
||||
pop_mode();
|
||||
bool
|
||||
push_mode( eu07_application::mode const Mode );
|
||||
push_mode( mode const Mode );
|
||||
void
|
||||
set_title( std::string const &Title );
|
||||
void
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
private:
|
||||
// types
|
||||
using modeptr_array = std::array<std::shared_ptr<application_mode>, static_cast<std::size_t>( mode::count_ )>;
|
||||
using modeptr_array = std::array<std::shared_ptr<application_mode>, static_cast<std::size_t>( count_ )>;
|
||||
using mode_stack = std::stack<mode>;
|
||||
// methods
|
||||
bool needs_ogl() const;
|
||||
|
||||
@@ -268,48 +268,48 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
}
|
||||
case driver_hint::frontpantographvalveon: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->OperatePantographValve( end::front, operation_t::enable );
|
||||
mvOccupied->OperatePantographValve( front, operation_t::enable );
|
||||
}
|
||||
remove_hint( driver_hint::frontpantographvalveoff );
|
||||
hint(
|
||||
Action,
|
||||
[ this ]( float const Parameter ) -> bool {
|
||||
return mvPantographUnit->Pantographs[end::front].valve.is_active == true || (Parameter > 0 && mvOccupied->Vel > Parameter); },
|
||||
return mvPantographUnit->Pantographs[front].valve.is_active == true || (Parameter > 0 && mvOccupied->Vel > Parameter); },
|
||||
Actionparameter );
|
||||
break;
|
||||
}
|
||||
case driver_hint::frontpantographvalveoff: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->OperatePantographValve( end::front, operation_t::disable );
|
||||
mvOccupied->OperatePantographValve( front, operation_t::disable );
|
||||
}
|
||||
remove_hint( driver_hint::frontpantographvalveon );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return mvPantographUnit->Pantographs[end::front].valve.is_active == false; } );
|
||||
return mvPantographUnit->Pantographs[front].valve.is_active == false; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::rearpantographvalveon: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->OperatePantographValve( end::rear, operation_t::enable );
|
||||
mvOccupied->OperatePantographValve( rear, operation_t::enable );
|
||||
}
|
||||
remove_hint( driver_hint::rearpantographvalveoff );
|
||||
hint(
|
||||
Action,
|
||||
[ this ]( float const Parameter ) -> bool {
|
||||
return mvPantographUnit->Pantographs[end::rear].valve.is_active == true || (Parameter > 0 && mvOccupied->Vel > Parameter); },
|
||||
return mvPantographUnit->Pantographs[rear].valve.is_active == true || (Parameter > 0 && mvOccupied->Vel > Parameter); },
|
||||
Actionparameter );
|
||||
break;
|
||||
}
|
||||
case driver_hint::rearpantographvalveoff: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->OperatePantographValve( end::rear, operation_t::disable );
|
||||
mvOccupied->OperatePantographValve( rear, operation_t::disable );
|
||||
}
|
||||
remove_hint( driver_hint::rearpantographvalveon );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return mvPantographUnit->Pantographs[end::rear].valve.is_active == false; } );
|
||||
return mvPantographUnit->Pantographs[rear].valve.is_active == false; } );
|
||||
break;
|
||||
}
|
||||
// converter
|
||||
@@ -338,7 +338,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
// relays
|
||||
case driver_hint::primaryconverteroverloadreset: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->RelayReset( relay_t::primaryconverteroverload );
|
||||
mvOccupied->RelayReset( primaryconverteroverload );
|
||||
}
|
||||
hint(
|
||||
Action,
|
||||
@@ -348,7 +348,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
}
|
||||
case driver_hint::maincircuitgroundreset: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->RelayReset( relay_t::maincircuitground );
|
||||
mvOccupied->RelayReset( maincircuitground );
|
||||
}
|
||||
hint(
|
||||
Action,
|
||||
@@ -358,7 +358,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
}
|
||||
case driver_hint::tractionnmotoroverloadreset: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->RelayReset( relay_t::tractionnmotoroverload );
|
||||
mvOccupied->RelayReset( tractionnmotoroverload );
|
||||
}
|
||||
hint(
|
||||
Action,
|
||||
@@ -415,27 +415,27 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
}
|
||||
case driver_hint::frontmotorblowerson: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->MotorBlowersSwitchOff( false, end::front );
|
||||
mvOccupied->MotorBlowersSwitch( true, end::front );
|
||||
mvOccupied->MotorBlowersSwitchOff( false, front );
|
||||
mvOccupied->MotorBlowersSwitch( true, front );
|
||||
}
|
||||
remove_hint( driver_hint::frontmotorblowersoff );
|
||||
hint(
|
||||
Action,
|
||||
[this]( float const Parameter ) -> bool {
|
||||
auto const &device { mvOccupied->MotorBlowers[ end::front ] };
|
||||
auto const &device { mvOccupied->MotorBlowers[ front ] };
|
||||
return device.start_type != start_t::manual || (device.is_enabled == true && device.is_disabled == false); } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::rearmotorblowerson: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->MotorBlowersSwitchOff( false, end::rear );
|
||||
mvOccupied->MotorBlowersSwitch( true, end::rear );
|
||||
mvOccupied->MotorBlowersSwitchOff( false, rear );
|
||||
mvOccupied->MotorBlowersSwitch( true, rear );
|
||||
}
|
||||
remove_hint( driver_hint::rearmotorblowersoff );
|
||||
hint(
|
||||
Action,
|
||||
[this]( float const Parameter ) -> bool {
|
||||
auto const &device { mvOccupied->MotorBlowers[ end::rear ] };
|
||||
auto const &device { mvOccupied->MotorBlowers[ rear ] };
|
||||
return device.start_type != start_t::manual || (device.is_enabled == true && device.is_disabled == false); } );
|
||||
break;
|
||||
}
|
||||
@@ -1049,94 +1049,94 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
// consist doors
|
||||
case driver_hint::doorrightopen: {
|
||||
if( AIControllFlag
|
||||
|| pVehicle->MoverParameters->Doors.open_control == control_t::conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( side::right, true );
|
||||
|| pVehicle->MoverParameters->Doors.open_control == conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( right, true );
|
||||
}
|
||||
remove_hint( driver_hint::doorrightclose );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorOpen[side::right] == true; } );
|
||||
return IsAnyDoorOpen[right] == true; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorrightclose: {
|
||||
if( AIControllFlag
|
||||
|| pVehicle->MoverParameters->Doors.open_control == control_t::conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( side::right, false );
|
||||
|| pVehicle->MoverParameters->Doors.open_control == conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( right, false );
|
||||
}
|
||||
remove_hint( driver_hint::doorrightopen );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorOpen[side::right] == false; } );
|
||||
return IsAnyDoorOpen[right] == false; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorleftopen: {
|
||||
if( AIControllFlag
|
||||
|| pVehicle->MoverParameters->Doors.open_control == control_t::conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( side::left, true );
|
||||
|| pVehicle->MoverParameters->Doors.open_control == conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( left, true );
|
||||
}
|
||||
remove_hint( driver_hint::doorleftclose );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorOpen[side::left] == true; } );
|
||||
return IsAnyDoorOpen[left] == true; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorleftclose: {
|
||||
if( AIControllFlag
|
||||
|| pVehicle->MoverParameters->Doors.open_control == control_t::conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( side::left, false );
|
||||
|| pVehicle->MoverParameters->Doors.open_control == conductor ) {
|
||||
pVehicle->MoverParameters->OperateDoors( left, false );
|
||||
}
|
||||
remove_hint( driver_hint::doorleftopen );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorOpen[side::left] == false; } );
|
||||
return IsAnyDoorOpen[left] == false; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorrightpermiton: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicle->MoverParameters->PermitDoors( side::right, true );
|
||||
pVehicle->MoverParameters->PermitDoors( right, true );
|
||||
}
|
||||
remove_hint( driver_hint::doorrightpermitoff );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorPermitActive[side::right] == true; } );
|
||||
return IsAnyDoorPermitActive[right] == true; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorrightpermitoff: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicle->MoverParameters->PermitDoors( side::right, false );
|
||||
pVehicle->MoverParameters->PermitDoors( right, false );
|
||||
}
|
||||
remove_hint( driver_hint::doorrightpermiton );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorPermitActive[side::right] == false; } );
|
||||
return IsAnyDoorPermitActive[right] == false; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorleftpermiton: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicle->MoverParameters->PermitDoors( side::left, true );
|
||||
pVehicle->MoverParameters->PermitDoors( left, true );
|
||||
}
|
||||
remove_hint( driver_hint::doorleftpermitoff );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorPermitActive[side::left] == true; } );
|
||||
return IsAnyDoorPermitActive[left] == true; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::doorleftpermitoff: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicle->MoverParameters->PermitDoors( side::left, false );
|
||||
pVehicle->MoverParameters->PermitDoors( left, false );
|
||||
}
|
||||
remove_hint( driver_hint::doorleftpermiton );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return IsAnyDoorPermitActive[side::left] == false; } );
|
||||
return IsAnyDoorPermitActive[left] == false; } );
|
||||
break;
|
||||
}
|
||||
// consist lights
|
||||
@@ -1215,30 +1215,30 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
case driver_hint::couplingadapterattach: {
|
||||
// TODO: run also for potential settings-based virtual assistant
|
||||
if( AIControllFlag ) {
|
||||
pVehicles[ end::front ]->attach_coupler_adapter( Actionparameter );
|
||||
pVehicles[ front ]->attach_coupler_adapter( Actionparameter );
|
||||
}
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
auto const &device { pVehicles[ end::front ]->MoverParameters->Couplers[ static_cast<int>( Parameter ) ] };
|
||||
auto const &device { pVehicles[ front ]->MoverParameters->Couplers[ static_cast<int>( Parameter ) ] };
|
||||
return device.type() == TCouplerType::Automatic; } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::couplingadapterremove: {
|
||||
if( AIControllFlag || Global.AITrainman ) {
|
||||
pVehicles[ end::front ]->remove_coupler_adapter( Actionparameter );
|
||||
pVehicles[ front ]->remove_coupler_adapter( Actionparameter );
|
||||
}
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
auto const &device { pVehicles[ end::front ]->MoverParameters->Couplers[ static_cast<int>( Parameter ) ] };
|
||||
auto const &device { pVehicles[ front ]->MoverParameters->Couplers[ static_cast<int>( Parameter ) ] };
|
||||
return false == device.has_adapter(); } );
|
||||
break;
|
||||
}
|
||||
// lights
|
||||
case driver_hint::headcodepc1: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicles[ end::front ]->RaLightsSet( light::headlight_left | light::headlight_right | light::headlight_upper, -1 );
|
||||
pVehicles[ front ]->RaLightsSet( headlight_left | headlight_right | headlight_upper, -1 );
|
||||
}
|
||||
remove_hint( driver_hint::headcodepc2 );
|
||||
remove_hint( driver_hint::headcodetb1 );
|
||||
@@ -1246,12 +1246,12 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return pVehicles[end::front]->has_signal_pc1_on(); } );
|
||||
return pVehicles[front]->has_signal_pc1_on(); } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::headcodepc2: {
|
||||
if( AIControllFlag ) {
|
||||
pVehicles[ end::front ]->RaLightsSet( light::redmarker_left | light::headlight_right | light::headlight_upper, -1 );
|
||||
pVehicles[ front ]->RaLightsSet( redmarker_left | headlight_right | headlight_upper, -1 );
|
||||
}
|
||||
remove_hint( driver_hint::headcodepc1 );
|
||||
remove_hint( driver_hint::headcodetb1 );
|
||||
@@ -1259,15 +1259,15 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return pVehicles[end::front]->has_signal_pc2_on(); } );
|
||||
return pVehicles[front]->has_signal_pc2_on(); } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::headcodetb1: {
|
||||
// HACK: the 'front' and 'rear' of the consist is determined by current consist direction
|
||||
// since direction shouldn't affect Tb1 light configuration, we 'counter' this behaviour by virtually swapping end vehicles
|
||||
if( AIControllFlag ) {
|
||||
if( mvOccupied->DirActive >= 0 ) { Lights( light::headlight_right, light::headlight_left ); }
|
||||
else { Lights( light::headlight_left, light::headlight_right ); }
|
||||
if( mvOccupied->DirActive >= 0 ) { Lights( headlight_right, headlight_left ); }
|
||||
else { Lights( headlight_left, headlight_right ); }
|
||||
}
|
||||
remove_hint( driver_hint::headcodepc1 );
|
||||
remove_hint( driver_hint::headcodepc2 );
|
||||
@@ -1276,22 +1276,22 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
auto const activeend { mvOccupied->CabActive >= 0 ? end::front : end::rear };
|
||||
auto const consistfront { mvOccupied->DirActive >= 0 ? end::front : end::rear };
|
||||
return pVehicles[consistfront]->has_signal_on(activeend, light::headlight_right) && pVehicles[1 - consistfront]->has_signal_on(1 - activeend, light::headlight_left); } );
|
||||
auto const activeend { mvOccupied->CabActive >= 0 ? front : rear };
|
||||
auto const consistfront { mvOccupied->DirActive >= 0 ? front : rear };
|
||||
return pVehicles[consistfront]->has_signal_on(activeend, headlight_right) && pVehicles[1 - consistfront]->has_signal_on(1 - activeend, headlight_left); } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::headcodepc5: {
|
||||
if( AIControllFlag
|
||||
|| ( Global.AITrainman && false == pVehicles[end::rear]->is_connected(pVehicle, coupling::control) ) ) {
|
||||
pVehicles[ end::rear ]->RaLightsSet( -1, light::redmarker_left | light::redmarker_right | light::rearendsignals );
|
||||
|| ( Global.AITrainman && false == pVehicles[rear]->is_connected(pVehicle, control) ) ) {
|
||||
pVehicles[ rear ]->RaLightsSet( -1, redmarker_left | redmarker_right | rearendsignals );
|
||||
}
|
||||
remove_hint( driver_hint::headcodetb1 );
|
||||
remove_hint( driver_hint::lightsoff );
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
return pVehicles[end::rear]->has_signal_pc5_on(); } );
|
||||
return pVehicles[rear]->has_signal_pc5_on(); } );
|
||||
break;
|
||||
}
|
||||
case driver_hint::lightsoff: {
|
||||
@@ -1305,8 +1305,8 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
hint(
|
||||
Action,
|
||||
[this](float const Parameter) -> bool {
|
||||
auto const activeend { mvOccupied->CabActive >= 0 ? end::front : end::rear };
|
||||
auto const consistfront { mvOccupied->DirActive >= 0 ? end::front : end::rear };
|
||||
auto const activeend { mvOccupied->CabActive >= 0 ? front : rear };
|
||||
auto const consistfront { mvOccupied->DirActive >= 0 ? front : rear };
|
||||
return pVehicles[consistfront]->has_signal_on(activeend, 0) && pVehicles[1 - consistfront]->has_signal_on(1 - activeend, 0); } );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1087,7 +1087,7 @@ void driver_mode::ExternalView()
|
||||
if (true == m_externalview)
|
||||
{
|
||||
// we're already in some external view mode, so select next one on the list
|
||||
m_externalviewmode = clamp_circular(++m_externalviewmode, static_cast<int>(view::count_));
|
||||
m_externalviewmode = clamp_circular(++m_externalviewmode, static_cast<int>(count_));
|
||||
}
|
||||
|
||||
FreeFlyModeFlag = true;
|
||||
@@ -1097,10 +1097,10 @@ void driver_mode::ExternalView()
|
||||
// configure camera placement for the selected view mode
|
||||
switch (m_externalviewmode)
|
||||
{
|
||||
case view::consistfront:
|
||||
case consistfront:
|
||||
{
|
||||
// bind camera with the vehicle
|
||||
auto *owner{vehicle->Mechanik->Vehicle(end::front)};
|
||||
auto *owner{vehicle->Mechanik->Vehicle(front)};
|
||||
|
||||
Camera.m_owner = owner;
|
||||
|
||||
@@ -1127,10 +1127,10 @@ void driver_mode::ExternalView()
|
||||
|
||||
break;
|
||||
}
|
||||
case view::consistrear:
|
||||
case consistrear:
|
||||
{
|
||||
// bind camera with the vehicle
|
||||
auto *owner{vehicle->Mechanik->Vehicle(end::rear)};
|
||||
auto *owner{vehicle->Mechanik->Vehicle(rear)};
|
||||
|
||||
Camera.m_owner = owner;
|
||||
|
||||
@@ -1156,9 +1156,9 @@ void driver_mode::ExternalView()
|
||||
Camera.Angle.z = shakeangles.first; // hustanie kamery na boki
|
||||
break;
|
||||
}
|
||||
case view::bogie:
|
||||
case bogie:
|
||||
{
|
||||
auto *owner{vehicle->Mechanik->Vehicle(end::front)};
|
||||
auto *owner{vehicle->Mechanik->Vehicle(front)};
|
||||
|
||||
Camera.m_owner = owner;
|
||||
|
||||
@@ -1185,7 +1185,7 @@ void driver_mode::ExternalView()
|
||||
|
||||
break;
|
||||
}
|
||||
case view::driveby:
|
||||
case driveby:
|
||||
{
|
||||
DistantView(false);
|
||||
break;
|
||||
|
||||
@@ -104,9 +104,9 @@ private:
|
||||
std::array<basic_event *, 10> KeyEvents { nullptr }; // eventy wyzwalane z klawiaury
|
||||
TCamera Camera;
|
||||
TCamera DebugCamera;
|
||||
int m_externalviewmode { view::consistfront }; // selected external view mode
|
||||
int m_externalviewmode { consistfront }; // selected external view mode
|
||||
bool m_externalview { true };
|
||||
std::array<view_config, view::count_> m_externalviewconfigs;
|
||||
std::array<view_config, count_> m_externalviewconfigs;
|
||||
TDynamicObject *pDynamicNearest { nullptr }; // vehicle nearest to the active camera. TODO: move to camera
|
||||
double fTime50Hz { 0.0 }; // bufor czasu dla komunikacji z PoKeys
|
||||
double const m_primaryupdaterate { 1.0 / 100.0 };
|
||||
|
||||
@@ -364,9 +364,9 @@ timetable_panel::update() {
|
||||
//odejmij lokomotywy czynne, a przynajmniej aktualną
|
||||
consistmass -= owner->pVehicle->MoverParameters->TotalMass;
|
||||
// subtract potential other half of a two-part vehicle
|
||||
auto const *previous { owner->pVehicle->Prev( coupling::permanent ) };
|
||||
auto const *previous { owner->pVehicle->Prev( permanent ) };
|
||||
if( previous != nullptr ) { consistmass -= previous->MoverParameters->TotalMass; }
|
||||
auto const *next { owner->pVehicle->Next( coupling::permanent ) };
|
||||
auto const *next { owner->pVehicle->Next( permanent ) };
|
||||
if( next != nullptr ) { consistmass -= next->MoverParameters->TotalMass; }
|
||||
}
|
||||
std::snprintf(
|
||||
@@ -781,8 +781,8 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
|
||||
mover.EngineDescription( 0 ).c_str(),
|
||||
// TODO: put wheel flat reporting in the enginedescription()
|
||||
std::string( mover.WheelFlat > 0.01 ? " Flat: " + to_string( mover.WheelFlat, 1 ) + " mm" : "" ).c_str(),
|
||||
update_vehicle_coupler( end::front ).c_str(),
|
||||
update_vehicle_coupler( end::rear ).c_str() );
|
||||
update_vehicle_coupler( front ).c_str(),
|
||||
update_vehicle_coupler( rear ).c_str() );
|
||||
|
||||
Output.emplace_back( std::string{ m_buffer.data() }, Global.UITextColor );
|
||||
|
||||
@@ -792,11 +792,11 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
|
||||
// devices
|
||||
mover.Battery ? 'B' : '.',
|
||||
mover.PantsValve.is_active ? '+' : '.',
|
||||
mover.Pantographs[end::rear].valve.is_active ? 'O' :
|
||||
mover.Pantographs[end::rear].valve.is_enabled ? 'o' :
|
||||
mover.Pantographs[rear].valve.is_active ? 'O' :
|
||||
mover.Pantographs[rear].valve.is_enabled ? 'o' :
|
||||
'.',
|
||||
mover.Pantographs[end::front].valve.is_active ? 'P' :
|
||||
mover.Pantographs[end::front].valve.is_enabled ? 'p' :
|
||||
mover.Pantographs[front].valve.is_active ? 'P' :
|
||||
mover.Pantographs[front].valve.is_enabled ? 'p' :
|
||||
'.',
|
||||
mover.PantPressLockActive ? '!' :
|
||||
mover.PantPressSwitchActive ? '*' :
|
||||
@@ -840,21 +840,21 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
|
||||
std::string( isdieselenginepowered ? STR(" oil pressure: ") + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
|
||||
// power transfers
|
||||
// 3000v
|
||||
mover.Couplers[ end::front ].power_high.voltage,
|
||||
mover.Couplers[ end::front ].power_high.current,
|
||||
std::string( mover.Couplers[ end::front ].power_high.is_local ? ":" : ":=" ).c_str(),
|
||||
mover.Couplers[ front ].power_high.voltage,
|
||||
mover.Couplers[ front ].power_high.current,
|
||||
std::string( mover.Couplers[ front ].power_high.is_local ? ":" : ":=" ).c_str(),
|
||||
mover.EngineVoltage,
|
||||
std::string( mover.Couplers[ end::rear ].power_high.is_local ? ":" : "=:" ).c_str(),
|
||||
mover.Couplers[ end::rear ].power_high.voltage,
|
||||
mover.Couplers[ end::rear ].power_high.current,
|
||||
std::string( mover.Couplers[ rear ].power_high.is_local ? ":" : "=:" ).c_str(),
|
||||
mover.Couplers[ rear ].power_high.voltage,
|
||||
mover.Couplers[ rear ].power_high.current,
|
||||
// 110v
|
||||
mover.Couplers[ end::front ].power_110v.voltage,
|
||||
mover.Couplers[ end::front ].power_110v.current,
|
||||
std::string( mover.Couplers[ end::front ].power_110v.is_local ? ":" : ":=" ).c_str(),
|
||||
mover.Couplers[ front ].power_110v.voltage,
|
||||
mover.Couplers[ front ].power_110v.current,
|
||||
std::string( mover.Couplers[ front ].power_110v.is_local ? ":" : ":=" ).c_str(),
|
||||
mover.PowerCircuits[ 1 ].first,
|
||||
std::string( mover.Couplers[ end::rear ].power_110v.is_local ? ":" : "=:" ).c_str(),
|
||||
mover.Couplers[ end::rear ].power_110v.voltage,
|
||||
mover.Couplers[ end::rear ].power_110v.current );
|
||||
std::string( mover.Couplers[ rear ].power_110v.is_local ? ":" : "=:" ).c_str(),
|
||||
mover.Couplers[ rear ].power_110v.voltage,
|
||||
mover.Couplers[ rear ].power_110v.current );
|
||||
|
||||
Output.emplace_back( m_buffer.data(), Global.UITextColor );
|
||||
|
||||
@@ -872,8 +872,8 @@ debug_panel::update_section_vehicle( std::vector<text_line> &Output ) {
|
||||
std::abs( mover.enrot ) * 60,
|
||||
std::abs( mover.nrot ) * mover.Transmision.Ratio * 60,
|
||||
mover.RventRot * 60,
|
||||
std::abs( mover.MotorBlowers[end::front].revolutions ),
|
||||
std::abs( mover.MotorBlowers[end::rear].revolutions ),
|
||||
std::abs( mover.MotorBlowers[front].revolutions ),
|
||||
std::abs( mover.MotorBlowers[rear].revolutions ),
|
||||
mover.dizel_heat.rpmw,
|
||||
mover.dizel_heat.rpmw2 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user