18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 13:15:02 +01:00

feat: line breaker before the pantographs, Cntrl.PantRequiresMain (#68)

New optional .fiz key Cntrl.PantRequiresMain (default No, every existing
vehicle unchanged). With Yes, as on Czech-built locomotives:
- the line breaker closes on the low voltage circuits, without traction
  voltage, and the undervoltage trip doesn't open it (overvoltage and the
  other trips still do);
- a pantograph valve opens and stays open only while the vehicle's line
  breaker is closed, so opening it drops the pantographs.

The AI (TController::PrepareEngine) closes the line breaker before raising
the pantographs for such a vehicle; the line breaker steps moved into
TController::close_line_breaker(). test::start_up() follows the same order.

Game data: to use it, PantRequiresMain=Yes goes on the Cntrl. line of
dynamic/pkp/ep05_v2/ep05.fiz, ep05v1.fiz and dynamic/cd/181_v2/181_cz1.fiz,
18x_pl.fiz (left for later, not part of this change). (#68)
This commit is contained in:
jerrrrycho
2026-11-07 19:18:37 +01:00
parent 939e42b611
commit 5a20f86fd0
6 changed files with 164 additions and 15 deletions

View File

@@ -2679,6 +2679,20 @@ void TController::SetDriverPsyche() {
}
}
// closes the line breaker, or starts the engine, the relays reset first
void TController::close_line_breaker()
{
cue_action( driver_hint::mastercontrollersetzerospeed );
// consist-wide ground relay reset
cue_action( driver_hint::maincircuitgroundreset );
cue_action( driver_hint::tractionnmotoroverloadreset );
if( mvOccupied->EngineType == TEngineType::DieselEngine ) {
// specjalnie dla SN61 żeby nie zgasł
cue_action( driver_hint::mastercontrollersetidle );
}
cue_action( driver_hint::linebreakerclose );
}
bool TController::PrepareEngine()
{ // odpalanie silnika
// HACK: don't immediately activate inert vehicle in case the simulation is about to replace us with human driver
@@ -2702,6 +2716,13 @@ bool TController::PrepareEngine()
}
}
if( mvControlling->PantographsRequireMains
&& IsAnyLineBreakerOpen ) {
// the pantographs rise only through the closed line breaker, which closes without their voltage
PrepareDirection();
close_line_breaker();
}
if( mvPantographUnit->EnginePowerSource.SourceType == TPowerSource::CurrentCollector
&& mvPantographUnit->EnginePowerSource.CollectorParameters.CollectorsNo > 0 ) {
// if our pantograph unit isn't a pantograph-devoid fallback
@@ -2756,15 +2777,7 @@ bool TController::PrepareEngine()
}
if( IsAnyLineBreakerOpen ) {
// activate main circuit or engine
cue_action( driver_hint::mastercontrollersetzerospeed );
// consist-wide ground relay reset
cue_action( driver_hint::maincircuitgroundreset );
cue_action( driver_hint::tractionnmotoroverloadreset );
if( mvOccupied->EngineType == TEngineType::DieselEngine ) {
// specjalnie dla SN61 żeby nie zgasł
cue_action( driver_hint::mastercontrollersetidle );
}
cue_action( driver_hint::linebreakerclose );
close_line_breaker();
}
else {
// main circuit or engine is on, set up vehicle devices and controls