17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 23:40:29 +01:00

Add engine voltage parameter

This commit is contained in:
2026-09-06 00:59:46 +02:00
parent 40df8e84f6
commit be48b6f013
3 changed files with 3 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ state_registry::state_registry()
add( "hv_current_1", value_type::float32, "A", -5000.0, 5000.0, []( state_snapshot const &s ) { return make_value( s, value_type::float32, s.train.hv_current[ 0 ], s.electric ); } );
add( "hv_current_2", value_type::float32, "A", -5000.0, 5000.0, []( state_snapshot const &s ) { return make_value( s, value_type::float32, s.train.hv_current[ 1 ], s.electric ); } );
add( "hv_current_3", value_type::float32, "A", -5000.0, 5000.0, []( state_snapshot const &s ) { return make_value( s, value_type::float32, s.train.hv_current[ 2 ], s.electric ); } );
add( "engine_voltage", value_type::float64, "V", 0, 40000.0, []( state_snapshot const &s ) { return make_value( s, value_type::float64, s.train.enginevoltage, s.electric ); } );
add( "lv_voltage", value_type::float32, "V", 0.0, 200.0, []( state_snapshot const &s ) { return make_value( s, value_type::float32, s.train.lv_voltage ); } );
add( "distance", value_type::float64, "m", {}, {}, []( state_snapshot const &s ) { return make_value( s, value_type::float64, s.train.distance ); } );

View File

@@ -953,6 +953,7 @@ TTrain::state_t TTrain::get_state() const
static_cast<float>(mvPantographUnit->PantPress),
fHVoltage,
{fHCurrent[mvControlled->TrainType & dt_EZT ? 0 : 1], fHCurrent[2], fHCurrent[3]},
mvOccupied->EngineVoltage,
ggLVoltage.GetValue(),
mvOccupied->DistCounter,
static_cast<std::uint8_t>(RadioChannel()),

View File

@@ -108,6 +108,7 @@ class TTrain {
float pantograph_pressure;
float hv_voltage;
std::array<float, 3> hv_current;
double enginevoltage;
float lv_voltage;
double distance;
std::uint8_t radio_channel;