18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 11:47:06 +01:00

refactor(physics): the line breaker, the line contactors, the relays and the converter as components

The main circuit of physics::Vehicle becomes components, with English names
(physics/components/maincircuit.h):

  lineBreaker (LineBreaker)     Mains closed, MainsInitTime(Countdown)
                                initTime / initCountdown, MainsStart start,
                                JointEngineStart jointStart,
                                PantographsRequireMains pantographsRequireIt,
                                LineBreakerClosesOnlyAtNoPowerPos
                                closesOnlyAtNoPower,
                                EmergencyBrakeMainOffPressure emergencyOffPressure
  lineContactors (LineContactors) StLinFlag closed, StLinSwitchOff forcedOpen,
                                StLinSwitchType switchType,
                                LineContactorsInterlock interlock,
                                LastRelayTime lastSwitchTime
  protection (ProtectionRelays) NoVoltRelay noVoltage, OvervoltageRelay
                                overvoltage, GroundRelay(Start) ground(Start),
                                ControlPressureSwitch pressureSwitch,
                                HasControlPressureSwitch hasPressureSwitch,
                                PressureSwitchBrakeCylinder
                                pressureSwitchWatchesCylinders
  converter (PowerConverter)    the Converter* fields: start, startDelay(Timer),
                                allow(Local), running, overloadRelayStart,
                                overloadRelayOffWithLineBreaker; ConvOvldFlag
                                overloaded, ConvSwitchType switchType

The long comments of the fields went with them into the header. Where the
loading of the .fiz has using enum start_t, the member is this->converter:
the enumerator start_t::converter would hide it there.

No string literal changed (checked over all the changed files).

No change in behaviour: 1149/1149 tests, golden traces exact against staging
62f7a29b.
This commit is contained in:
2026-11-29 02:50:50 +01:00
parent 5e56a91515
commit 1bea280010
53 changed files with 632 additions and 586 deletions
+5 -5
View File
@@ -181,7 +181,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
Action,
[this](float const /*Parameter*/) {
auto const &device { occupied->OilPump };
return device.start_type != start_t::manual || device.is_enabled == true || device.is_active == true || occupied->Mains; } );
return device.start_type != start_t::manual || device.is_enabled == true || device.is_active == true || occupied->lineBreaker.closed; } );
break;
}
case driver_hint::oilpumpoff: {
@@ -334,7 +334,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
[]( TDynamicObject * Vehicle ) {
auto *vehicle { Vehicle->physics };
if( vehicle->LineContactorsHeldByLocalConverterSwitch() ) {
vehicle->ConverterAllowLocal = true; } } );
vehicle->converter.allowLocal = true; } } );
}
remove_hint( driver_hint::converteroff );
hint(
@@ -362,7 +362,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const /*Parameter*/) {
return occupied->ConverterOverloadRelayStart != start_t::manual || occupied->ConvOvldFlag == false; } );
return occupied->converter.overloadRelayStart != start_t::manual || occupied->converter.overloaded == false; } );
break;
}
case driver_hint::maincircuitgroundreset: {
@@ -372,7 +372,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const /*Parameter*/) {
return occupied->GroundRelayStart != start_t::manual || occupied->GroundRelay == true; } );
return occupied->protection.groundStart != start_t::manual || occupied->protection.ground == true; } );
break;
}
case driver_hint::tractionnmotoroverloadreset: {
@@ -406,7 +406,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
Action,
[this](float const /*Parameter*/) {
// TBD, TODO: replace with consist-wide flag set true if any line breaker is closed?
return mvControlling->Mains == false; } );
return mvControlling->lineBreaker.closed == false; } );
break;
}
// compressor