16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 09:59:18 +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
if (!DecBrakeLevelOld()) // T_MoverParameters::
break;
BrakePressureActual = BrakePressureTable[BrakeCtrlPos + 2]; // skopiowanie pozycji
BrakePressureActual = BrakePressureTable[BrakeCtrlPos]; // skopiowanie pozycji
/*
//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
@@ -5913,41 +5913,45 @@ bool TMoverParameters::readBPT(int ln, std::string line)
startBPT = true;
int k;
if (ln > 0) // 0 to nazwa sekcji - Cntrl. - po niej jest tablica hamulcow
{
// WriteLog("BPT: " + xline);
line = Tab2Sp(line);
xxx = TrimAndReduceSpaces(line.c_str());
x = Split(xxx);
if (ln > 0) // 0 to nazwa sekcji - Cntrl. - po niej jest tablica hamulcow
{
// WriteLog("BPT: " + xline);
line = Tab2Sp(line);
xxx = TrimAndReduceSpaces(line.c_str());
x = Split(xxx);
if (x.size() != 5)
{
WriteLog("Read BPT: wrong argument number of arguments in line " + to_string(ln - 1));
delete[] xxx;
return false;
}
if (x.size() != 5)
{
WriteLog("Read BPT: wrong argument number of arguments in line " + to_string(ln - 1));
delete[] xxx;
return false;
}
p0 = TrimSpace(x[0]);
p1 = TrimSpace(x[1]);
p2 = TrimSpace(x[2]);
p3 = TrimSpace(x[3]);
p4 = TrimSpace(x[4]);
p0 = TrimSpace(x[0]);
p1 = TrimSpace(x[1]);
p2 = TrimSpace(x[2]);
p3 = TrimSpace(x[3]);
p4 = TrimSpace(x[4]);
k = atoi(p0.c_str());
BrakePressureTable[k].PipePressureVal = atof(p1.c_str());
BrakePressureTable[k].BrakePressureVal = atof(p2.c_str());
BrakePressureTable[k].FlowSpeedVal = atof(p3.c_str());
if (p4 == "Pneumatic")
BrakePressureTable[k].BrakeType = Pneumatic;
else if (p4 == "ElectroPneumatic")
BrakePressureTable[k].BrakeType = ElectroPneumatic;
else
BrakePressureTable[k].BrakeType = Individual;
k = atoi(p0.c_str());
BrakePressureTable[k].PipePressureVal = atof(p1.c_str());
BrakePressureTable[k].BrakePressureVal = atof(p2.c_str());
BrakePressureTable[k].FlowSpeedVal = atof(p3.c_str());
if (p4 == "Pneumatic")
BrakePressureTable[k].BrakeType = Pneumatic;
else if (p4 == "ElectroPneumatic")
BrakePressureTable[k].BrakeType = ElectroPneumatic;
else
BrakePressureTable[k].BrakeType = Individual;
//-- WriteLog("BPT: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
if (k == gBCPN)
startBPT = false;
}
// WriteLog("BPTx: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
//WriteLog("BPTk: " + to_string(k) + "," + to_string(BrakePressureTable[k].PipePressureVal) +
// "," + to_string(BrakePressureTable[k].BrakePressureVal) + "," +
// to_string(BrakePressureTable[k].FlowSpeedVal) + "," + p4);
if (k == gBCPN)
startBPT = false;
}
delete[] xxx;
BPTLINE++;
return true;
@@ -6506,8 +6510,16 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
// WriteLog("DATA TEST: " + aCategory + ", " + aType + ", " + bLoadQ + ", " + bLoadAccepted + ",
// " + dAxle + ", " + dBearingType + ", " + eBrakeValve + ", " + eBM + ", " + jEnginePower + ",
// " + kEngineType + ", " + mRVent );
// WriteLog(" ");
// WriteLog(" ");
// WriteLog("BPT Table:");
// 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
// zaleznosci

View File

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