16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 17:29:18 +02:00

pantograph PhysicalLayout fiz entry

This commit is contained in:
milek7
2021-01-18 01:10:46 +01:00
parent d096c52b5b
commit d08146ed5b
2 changed files with 12 additions and 2 deletions

View File

@@ -463,7 +463,8 @@ struct TCurrentCollector {
double InsetV; //minimalne napięcie wymagane do załączenia double InsetV; //minimalne napięcie wymagane do załączenia
double MinPress; //minimalne ciśnienie do załączenia WS double MinPress; //minimalne ciśnienie do załączenia WS
double MaxPress; //maksymalne ciśnienie za reduktorem double MaxPress; //maksymalne ciśnienie za reduktorem
bool FakePower; bool FakePower;
int PhysicalLayout;
//inline TCurrentCollector() { //inline TCurrentCollector() {
// CollectorsNo = 0; // CollectorsNo = 0;
// MinH, MaxH, CSW, MinV, MaxV = 0.0; // MinH, MaxH, CSW, MinV, MaxV = 0.0;

View File

@@ -2190,6 +2190,7 @@ void TMoverParameters::PantographsCheck( double const Timestep ) {
false ) ) ); // shouldn't ever get this far but, eh false ) ) ); // shouldn't ever get this far but, eh
} }
size_t pant_id = 0;
for( auto &pantograph : Pantographs ) { for( auto &pantograph : Pantographs ) {
auto &valve { pantograph.valve }; auto &valve { pantograph.valve };
@@ -2205,11 +2206,17 @@ void TMoverParameters::PantographsCheck( double const Timestep ) {
|| ( manualcontrol && lowvoltagepower && valve.is_enabled ) || ( manualcontrol && lowvoltagepower && valve.is_enabled )
|| ( autostart && lowvoltagepower ) ) ); // shouldn't ever get this far but, eh || ( autostart && lowvoltagepower ) ) ); // shouldn't ever get this far but, eh
auto const pantographexists { (EnginePowerSource.SourceType == TPowerSource::CurrentCollector)
&& (EnginePowerSource.CollectorParameters.PhysicalLayout & (1 << pant_id)) };
pantograph.is_active = ( pantograph.is_active = (
( valve.is_active ) ( valve.is_active )
&& ( PantsValve.is_active ) && ( PantsValve.is_active )
&& ( pantographexists )
// && ( ) // TODO: add other checks // && ( ) // TODO: add other checks
); );
pant_id++;
} }
} }
@@ -10926,7 +10933,7 @@ void TMoverParameters::LoadFIZ_PowerParamsDecode( TPowerParameters &Powerparamet
auto &collectorparameters = Powerparameters.CollectorParameters; auto &collectorparameters = Powerparameters.CollectorParameters;
collectorparameters = TCurrentCollector { 0, 0, 0, 0, 0, 0, false, 0, 0, 0, false }; collectorparameters = TCurrentCollector { 0, 0, 0, 0, 0, 0, false, 0, 0, 0, false, 0 };
extract_value( collectorparameters.CollectorsNo, "CollectorsNo", Line, "" ); extract_value( collectorparameters.CollectorsNo, "CollectorsNo", Line, "" );
extract_value( collectorparameters.MinH, "MinH", Line, "" ); extract_value( collectorparameters.MinH, "MinH", Line, "" );
@@ -10946,6 +10953,8 @@ void TMoverParameters::LoadFIZ_PowerParamsDecode( TPowerParameters &Powerparamet
// collectorparameters.MaxPress = 5.0 + 0.001 * ( Random( 50 ) - Random( 50 ) ); // collectorparameters.MaxPress = 5.0 + 0.001 * ( Random( 50 ) - Random( 50 ) );
extract_value( collectorparameters.MaxPress, "MaxPress", Line, "5.0" ); extract_value( collectorparameters.MaxPress, "MaxPress", Line, "5.0" );
extract_value( collectorparameters.FakePower, "FakePower", Line, "" ); extract_value( collectorparameters.FakePower, "FakePower", Line, "" );
if (extract_value( collectorparameters.PhysicalLayout, "PhysicalLayout", Line, "3" ))
collectorparameters.CollectorsNo = std::min(collectorparameters.PhysicalLayout, 2);
break; break;
} }
case TPowerSource::PowerCable: { case TPowerSource::PowerCable: {