16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 08:09:19 +02:00

Poprawione odczytywanie pozycji w BPT

This commit is contained in:
firleju
2016-12-05 23:09:42 +01:00
parent 6e853665a9
commit 49edb9a56e
2 changed files with 55 additions and 42 deletions

View File

@@ -771,7 +771,7 @@ void TMoverParameters::BrakeLevelSet(double b)
while ((x < BrakeCtrlPos) && (BrakeCtrlPos >= -1)) // jeśli zmniejszyło się o 1 while ((x < BrakeCtrlPos) && (BrakeCtrlPos >= -1)) // jeśli zmniejszyło się o 1
if (!DecBrakeLevelOld()) // T_MoverParameters:: if (!DecBrakeLevelOld()) // T_MoverParameters::
break; break;
BrakePressureActual = BrakePressureTable[BrakeCtrlPos + 2]; // skopiowanie pozycji BrakePressureActual = BrakePressureTable[BrakeCtrlPos]; // skopiowanie pozycji
/* /*
//youBy: obawiam sie, ze tutaj to nie dziala :P //youBy: obawiam sie, ze tutaj to nie dziala :P
//Ra 2014-03: było tak zrobione, że działało - po każdej zmianie pozycji była wywoływana ta //Ra 2014-03: było tak zrobione, że działało - po każdej zmianie pozycji była wywoływana ta
@@ -5913,41 +5913,45 @@ bool TMoverParameters::readBPT(int ln, std::string line)
startBPT = true; startBPT = true;
int k; int k;
if (ln > 0) // 0 to nazwa sekcji - Cntrl. - po niej jest tablica hamulcow if (ln > 0) // 0 to nazwa sekcji - Cntrl. - po niej jest tablica hamulcow
{ {
// WriteLog("BPT: " + xline); // WriteLog("BPT: " + xline);
line = Tab2Sp(line); line = Tab2Sp(line);
xxx = TrimAndReduceSpaces(line.c_str()); xxx = TrimAndReduceSpaces(line.c_str());
x = Split(xxx); x = Split(xxx);
if (x.size() != 5) if (x.size() != 5)
{ {
WriteLog("Read BPT: wrong argument number of arguments in line " + to_string(ln - 1)); WriteLog("Read BPT: wrong argument number of arguments in line " + to_string(ln - 1));
delete[] xxx; delete[] xxx;
return false; return false;
} }
p0 = TrimSpace(x[0]); p0 = TrimSpace(x[0]);
p1 = TrimSpace(x[1]); p1 = TrimSpace(x[1]);
p2 = TrimSpace(x[2]); p2 = TrimSpace(x[2]);
p3 = TrimSpace(x[3]); p3 = TrimSpace(x[3]);
p4 = TrimSpace(x[4]); p4 = TrimSpace(x[4]);
k = atoi(p0.c_str()); k = atoi(p0.c_str());
BrakePressureTable[k].PipePressureVal = atof(p1.c_str()); BrakePressureTable[k].PipePressureVal = atof(p1.c_str());
BrakePressureTable[k].BrakePressureVal = atof(p2.c_str()); BrakePressureTable[k].BrakePressureVal = atof(p2.c_str());
BrakePressureTable[k].FlowSpeedVal = atof(p3.c_str()); BrakePressureTable[k].FlowSpeedVal = atof(p3.c_str());
if (p4 == "Pneumatic") if (p4 == "Pneumatic")
BrakePressureTable[k].BrakeType = Pneumatic; BrakePressureTable[k].BrakeType = Pneumatic;
else if (p4 == "ElectroPneumatic") else if (p4 == "ElectroPneumatic")
BrakePressureTable[k].BrakeType = ElectroPneumatic; BrakePressureTable[k].BrakeType = ElectroPneumatic;
else else
BrakePressureTable[k].BrakeType = Individual; BrakePressureTable[k].BrakeType = Individual;
//-- WriteLog("BPT: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4); // WriteLog("BPTx: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
if (k == gBCPN) //WriteLog("BPTk: " + to_string(k) + "," + to_string(BrakePressureTable[k].PipePressureVal) +
startBPT = false; // "," + to_string(BrakePressureTable[k].BrakePressureVal) + "," +
} // to_string(BrakePressureTable[k].FlowSpeedVal) + "," + p4);
if (k == gBCPN)
startBPT = false;
}
delete[] xxx; delete[] xxx;
BPTLINE++; BPTLINE++;
return true; return true;
@@ -6506,8 +6510,16 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
// WriteLog("DATA TEST: " + aCategory + ", " + aType + ", " + bLoadQ + ", " + bLoadAccepted + ", // WriteLog("DATA TEST: " + aCategory + ", " + aType + ", " + bLoadQ + ", " + bLoadAccepted + ",
// " + dAxle + ", " + dBearingType + ", " + eBrakeValve + ", " + eBM + ", " + jEnginePower + ", // " + dAxle + ", " + dBearingType + ", " + eBrakeValve + ", " + eBM + ", " + jEnginePower + ",
// " + kEngineType + ", " + mRVent ); // " + kEngineType + ", " + mRVent );
// WriteLog(" "); // WriteLog("BPT Table:");
// WriteLog(" "); // string str;
// for (TBrakePressureTable::iterator it = BrakePressureTable.begin();
// it != BrakePressureTable.end(); ++it)
// {
// str = to_string(it->first) + " " + to_string(it->second.PipePressureVal) + " " +
// to_string(it->second.BrakePressureVal) + " " +
// to_string(it->second.FlowSpeedVal);
// WriteLog(str);
// } // WriteLog(" ");
// Operacje na zebranych parametrach - przypisywanie do wlasciwych zmiennych i ustawianie // Operacje na zebranych parametrach - przypisywanie do wlasciwych zmiennych i ustawianie
// zaleznosci // zaleznosci

View File

@@ -37,7 +37,7 @@ Knorr/West EP -
#include "friction.h" // Pascal unit #include "friction.h" // Pascal unit
#include "mctools.h" // Pascal unit #include "mctools.h" // Pascal unit
//#include <array>
@@ -622,7 +622,8 @@ Knorr/West EP -
double RedAdj; //dostosowanie reduktora cisnienia (krecenie kapturkiem) double RedAdj; //dostosowanie reduktora cisnienia (krecenie kapturkiem)
// Sounds: array[0..4] of real; //wielkosci przeplywow dla dzwiekow // Sounds: array[0..4] of real; //wielkosci przeplywow dla dzwiekow
bool Fala; bool Fala;
// const double pos_table[11] = { -2, 6, -1, 0, -2, 1, 4, 6, 0, 0, 0 }; //double pos_table[];
// double *pos_table; // = { -2, 6, -1, 0, -2, 1, 4, 6, 0, 0, 0 };
static double pos_table[11]; static double pos_table[11];
double LPP_RP(double pos); double LPP_RP(double pos);
bool EQ(double pos, double i_pos); bool EQ(double pos, double i_pos);
@@ -631,7 +632,7 @@ Knorr/West EP -
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
void SetReductor(double nAdj)/*override*/; void SetReductor(double nAdj)/*override*/;
double GetSound(int i)/*override*/; double GetSound(int i)/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
inline TFV4aM(void) : TDriverHandle() { } inline TFV4aM(void) : TDriverHandle() { }
}; };
@@ -655,7 +656,7 @@ Knorr/West EP -
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
void SetReductor(double nAdj)/*override*/; void SetReductor(double nAdj)/*override*/;
double GetSound(int i)/*override*/; double GetSound(int i)/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
double GetEP(double pos); double GetEP(double pos);
@@ -709,7 +710,7 @@ Knorr/West EP -
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
void SetReductor(double nAdj)/*override*/; void SetReductor(double nAdj)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
inline TM394(void) : TDriverHandle() { } inline TM394(void) : TDriverHandle() { }
}; };
@@ -732,7 +733,7 @@ Knorr/West EP -
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
void SetReductor(double nAdj)/*override*/; void SetReductor(double nAdj)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
inline TH14K1(void) : TDriverHandle() { } inline TH14K1(void) : TDriverHandle() { }
}; };
@@ -752,7 +753,7 @@ Knorr/West EP -
public: public:
double GetPF(double i_bcp, double PP, double HP, double dt, double ep)/*override*/; double GetPF(double i_bcp, double PP, double HP, double dt, double ep)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
inline TSt113(void) : TH14K1() { } inline TSt113(void) : TH14K1() { }
@@ -825,7 +826,7 @@ Knorr/West EP -
public: public:
double GetPF(double i_bcp, double PP, double HP, double dt, double ep)/*override*/; double GetPF(double i_bcp, double PP, double HP, double dt, double ep)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
static double GetPos(int i)/*override*/; double GetPos(int i)/*override*/;
double GetSound(int i)/*override*/; double GetSound(int i)/*override*/;
void Init(double Press)/*override*/; void Init(double Press)/*override*/;