mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Parameters of DieselEngine for Python dictionary
This commit is contained in:
committed by
tmj-fstate
parent
06f099dca1
commit
39596c76ba
47
Train.cpp
47
Train.cpp
@@ -389,8 +389,11 @@ TTrain::TTrain() {
|
||||
bHeat[ i ] = false;
|
||||
}
|
||||
for( int i = 0; i < 9; ++i )
|
||||
for( int j = 0; j < 10; ++j )
|
||||
fEIMParams[ i ][ j ] = 0.0;
|
||||
for (int j = 0; j < 10; ++j)
|
||||
{
|
||||
fEIMParams[i][j] = 0.0;
|
||||
fDieselParams[i][j] = 0.0;
|
||||
}
|
||||
|
||||
for( int i = 0; i < 20; ++i )
|
||||
for( int j = 0; j < 3; ++j )
|
||||
@@ -493,6 +496,7 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
// induction motor state data
|
||||
char const *TXTT[ 10 ] = { "fd", "fdt", "fdb", "pd", "pdt", "pdb", "itothv", "1", "2", "3" };
|
||||
char const *TXTC[ 10 ] = { "fr", "frt", "frb", "pr", "prt", "prb", "im", "vm", "ihv", "uhv" };
|
||||
char const *TXTD[ 10 ] = { "enrot", "nrot", "fill_des", "fill_real", "clutch_des", "clutch_real", "water_temp", "oil_press", "res1", "res2" };
|
||||
char const *TXTP[ 3 ] = { "bc", "bp", "sp" };
|
||||
for( int j = 0; j < 10; ++j )
|
||||
dict->insert( ( "eimp_t_" + std::string( TXTT[ j ] ) ), fEIMParams[ 0 ][ j ] );
|
||||
@@ -500,6 +504,9 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
for( int j = 0; j < 10; ++j )
|
||||
dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_" + std::string( TXTC[ j ] ) ), fEIMParams[ i + 1 ][ j ] );
|
||||
|
||||
for (int j = 0; j < 10; ++j)
|
||||
dict->insert(("diesel_param_" + std::to_string(i + 1) + "_" + std::string(TXTD[j])), fDieselParams[i + 1][j]);
|
||||
|
||||
dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_ms" ), bMains[ i ] );
|
||||
dict->insert( ( "eimp_c" + std::to_string( i + 1 ) + "_cv" ), fCntVol[ i ] );
|
||||
dict->insert( ( "eimp_u" + std::to_string( i + 1 ) + "_pf" ), bPants[ i ][ 0 ] );
|
||||
@@ -5319,6 +5326,27 @@ bool TTrain::Update( double const Deltatime )
|
||||
in++;
|
||||
iPowerNo = in;
|
||||
}
|
||||
if ((in < 8) && (p->MoverParameters->EngineType==TEngineType::DieselEngine))
|
||||
{
|
||||
fDieselParams[1 + in][0] = p->MoverParameters->enrot*60;
|
||||
fDieselParams[1 + in][1] = p->MoverParameters->nrot;
|
||||
fDieselParams[1 + in][2] = p->MoverParameters->RList[p->MoverParameters->MainCtrlPos].R;
|
||||
fDieselParams[1 + in][3] = p->MoverParameters->dizel_fill;
|
||||
fDieselParams[1 + in][4] = p->MoverParameters->RList[p->MoverParameters->MainCtrlPos].Mn;
|
||||
fDieselParams[1 + in][5] = p->MoverParameters->dizel_engage;
|
||||
fDieselParams[1 + in][6] = p->MoverParameters->dizel_heat.Twy;
|
||||
fDieselParams[1 + in][7] = p->MoverParameters->OilPump.pressure;
|
||||
//fDieselParams[1 + in][8] = p->MoverParameters->
|
||||
//fDieselParams[1 + in][9] = p->MoverParameters->
|
||||
bMains[in] = p->MoverParameters->Mains;
|
||||
fCntVol[in] = p->MoverParameters->BatteryVoltage;
|
||||
bFuse[in] = p->MoverParameters->FuseFlag;
|
||||
bBatt[in] = p->MoverParameters->Battery;
|
||||
bConv[in] = p->MoverParameters->ConverterFlag;
|
||||
bHeat[in] = p->MoverParameters->Heating;
|
||||
in++;
|
||||
iPowerNo = in;
|
||||
}
|
||||
// p = p->NextC(4); //prev
|
||||
if ((kier ? p->NextC(128) : p->PrevC(128)) != (kier ? p->NextC(4) : p->PrevC(4)))
|
||||
iUnitNo++;
|
||||
@@ -5361,16 +5389,11 @@ bool TTrain::Update( double const Deltatime )
|
||||
|
||||
for (int i = in; i < 8; i++)
|
||||
{
|
||||
fEIMParams[1 + i][0] = 0;
|
||||
fEIMParams[1 + i][1] = 0;
|
||||
fEIMParams[1 + i][2] = 0;
|
||||
fEIMParams[1 + i][3] = 0;
|
||||
fEIMParams[1 + i][4] = 0;
|
||||
fEIMParams[1 + i][5] = 0;
|
||||
fEIMParams[1 + i][6] = 0;
|
||||
fEIMParams[1 + i][7] = 0;
|
||||
fEIMParams[1 + i][8] = 0;
|
||||
fEIMParams[1 + i][9] = 0;
|
||||
for (int j = 0; j <= 9; j++)
|
||||
{
|
||||
fEIMParams[1 + i][j] = 0;
|
||||
fDieselParams[1 + i][j] = 0;
|
||||
}
|
||||
}
|
||||
#ifdef _WIN32
|
||||
if (Global.iFeedbackMode == 4) {
|
||||
|
||||
1
Train.h
1
Train.h
@@ -675,6 +675,7 @@ private:
|
||||
float fPress[20][3]; // cisnienia dla wszystkich czlonow
|
||||
static std::vector<std::string> const fPress_labels;
|
||||
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||
float fDieselParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||
int RadioChannel() const { return iRadioChannel; };
|
||||
// plays provided sound from position of the radio
|
||||
void radio_message( sound_source *Message, int const Channel );
|
||||
|
||||
Reference in New Issue
Block a user