mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 04:19:19 +02:00
More python dictionary entries for compressors
This commit is contained in:
committed by
tmj-fstate
parent
20b8c10e3a
commit
52dcd5bf5f
30
Train.cpp
30
Train.cpp
@@ -452,8 +452,11 @@ TTrain::TTrain() {
|
||||
bConv[ i ] = false;
|
||||
bComp[ i ][ 0 ] = false;
|
||||
bComp[ i ][ 1 ] = false;
|
||||
//bComp[ i ][ 2 ] = false;
|
||||
//bComp[ i ][ 3 ] = false;
|
||||
bHeat[ i ] = false;
|
||||
}
|
||||
bCompressors.clear();
|
||||
for( int i = 0; i < 9; ++i )
|
||||
for (int j = 0; j < 10; ++j)
|
||||
{
|
||||
@@ -598,6 +601,7 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
bPN = ( static_cast<TLSt*>( temp_ham )->GetEDBCP() > 0.2 );
|
||||
}
|
||||
dict->insert( "indir_brake", bPN );
|
||||
dict->insert( "emergency_brake", mvOccupied->AlarmChainFlag );
|
||||
dict->insert( "brake_delay_flag", mvOccupied->BrakeDelayFlag );
|
||||
dict->insert( "brake_op_mode_flag", mvOccupied->BrakeOpModeFlag );
|
||||
// other controls
|
||||
@@ -609,6 +613,7 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
dict->insert( "radio_channel", RadioChannel() );
|
||||
dict->insert( "radio_volume", Global.RadioVolume );
|
||||
dict->insert( "door_lock", mvOccupied->Doors.lock_enabled );
|
||||
dict->insert( "door_step", mvOccupied->Doors.step_enabled );
|
||||
// movement data
|
||||
dict->insert( "velocity", std::abs( mvOccupied->Vel ) );
|
||||
dict->insert( "tractionforce", std::abs( mvOccupied->Ft ) );
|
||||
@@ -644,9 +649,20 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_conv" ), bConv[ i ] );
|
||||
dict->insert( ( "eimp_u" + std::to_string( i + 1 ) + "_comp_a" ), bComp[ i ][ 0 ] );
|
||||
dict->insert( ( "eimp_u" + std::to_string( i + 1 ) + "_comp_w" ), bComp[ i ][ 1 ] );
|
||||
//dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_comp_a" ), bComp[ i ][ 2 ]);
|
||||
//dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_comp_w" ), bComp[ i ][ 3 ]);
|
||||
dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_heat" ), bHeat[ i ] );
|
||||
}
|
||||
|
||||
dict->insert( "compressors_no", (int)bCompressors.size() );
|
||||
for (int i = 0; i < bCompressors.size(); i++)
|
||||
{
|
||||
dict->insert("compressors_" + std::to_string(i + 1) + "_allow", std::get<0>(bCompressors[i]));
|
||||
dict->insert("compressors_" + std::to_string(i + 1) + "_work", std::get<1>(bCompressors[i]));
|
||||
dict->insert("compressors_" + std::to_string(i + 1) + "_car_no", std::get<2>(bCompressors[i]));
|
||||
}
|
||||
|
||||
|
||||
bool kier = (DynamicObject->DirectionGet() * mvOccupied->CabOccupied > 0);
|
||||
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->CabOccupied < 0 ? end::rear : end::front, 4);
|
||||
int in = 0;
|
||||
@@ -655,6 +671,7 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
if (p->MoverParameters->eimc[eimc_p_Pmax] > 1)
|
||||
{
|
||||
in++;
|
||||
dict->insert(("eimp_c" + std::to_string(in) + "_invno"), p->MoverParameters->InvertersNo);
|
||||
for (int j = 0; j < p->MoverParameters->InvertersNo; j++) {
|
||||
dict->insert(("eimp_c" + std::to_string(in) + "_inv" + std::to_string(j + 1) + "_act"), p->MoverParameters->Inverters[j].IsActive);
|
||||
dict->insert(("eimp_c" + std::to_string(in) + "_inv" + std::to_string(j + 1) + "_error"), p->MoverParameters->Inverters[j].Error);
|
||||
@@ -6176,8 +6193,11 @@ bool TTrain::Update( double const Deltatime )
|
||||
bConv[i] = false;
|
||||
bComp[i][0] = false;
|
||||
bComp[i][1] = false;
|
||||
//bComp[i][2] = false;
|
||||
//bComp[i][3] = false;
|
||||
bHeat[i] = false;
|
||||
}
|
||||
bCompressors.clear();
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
if (p)
|
||||
@@ -6185,7 +6205,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
fPress[i][0] = p->MoverParameters->BrakePress;
|
||||
fPress[i][1] = p->MoverParameters->PipePress;
|
||||
fPress[i][2] = p->MoverParameters->ScndPipePress;
|
||||
fPress[i][3] = p->MoverParameters->CntrlPipePress;
|
||||
fPress[i][3] = p->MoverParameters->CntrlPipePress;
|
||||
bBrakes[i][0] = p->MoverParameters->SpringBrake.IsActive;
|
||||
bBrakes[i][1] = p->MoverParameters->SpringBrake.ShuttOff;
|
||||
bDoors[i][1] = ( p->MoverParameters->Doors.instances[ side::left ].position > 0.f );
|
||||
@@ -6206,6 +6226,10 @@ bool TTrain::Update( double const Deltatime )
|
||||
if (p->MoverParameters->CompressorSpeed > 0.00001)
|
||||
{
|
||||
bComp[iUnitNo - 1][1] = (bComp[iUnitNo - 1][1] || p->MoverParameters->CompressorFlag);
|
||||
bCompressors.emplace_back(
|
||||
p->MoverParameters->CompressorAllow || (p->MoverParameters->CompressorStart == start_t::automatic),
|
||||
p->MoverParameters->CompressorFlag,
|
||||
i);
|
||||
}
|
||||
if ((in < 8) && (p->MoverParameters->eimc[eimc_p_Pmax] > 1))
|
||||
{
|
||||
@@ -6227,6 +6251,8 @@ bool TTrain::Update( double const Deltatime )
|
||||
bBatt[in] = p->MoverParameters->Battery;
|
||||
bConv[in] = p->MoverParameters->ConverterFlag;
|
||||
bHeat[in] = p->MoverParameters->Heating;
|
||||
//bComp[in][2] = (p->MoverParameters->CompressorAllow || (p->MoverParameters->CompressorStart == start_t::automatic));
|
||||
//bComp[in][3] = (p->MoverParameters->CompressorFlag);
|
||||
in++;
|
||||
iPowerNo = in;
|
||||
}
|
||||
@@ -6264,7 +6290,7 @@ bool TTrain::Update( double const Deltatime )
|
||||
fPress[i][0]
|
||||
= fPress[i][1]
|
||||
= fPress[i][2]
|
||||
= fPress[i][3]
|
||||
= fPress[i][3]
|
||||
= 0;
|
||||
bDoors[i][0]
|
||||
= bDoors[i][1]
|
||||
|
||||
Reference in New Issue
Block a user