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

Hamulce przestawione na map -2..10. Sprawdzanie movera

Mover sprawdzony do IncMainCtrl.
This commit is contained in:
firleju
2016-11-23 13:10:18 +01:00
parent f22117f4ea
commit 92b483cded
4 changed files with 128 additions and 130 deletions

View File

@@ -15,7 +15,7 @@ http://mozilla.org/MPL/2.0/.
#include "hamulce.h" #include "hamulce.h"
#include <string> #include <string>
#include <mctools.h> #include <mctools.h>
#include <map>
/* /*
MaSzyna EU07 locomotive simulator MaSzyna EU07 locomotive simulator
@@ -321,7 +321,7 @@ struct TBrakePressure
TBrakeSystem BrakeType; TBrakeSystem BrakeType;
}; };
typedef TBrakePressure TBrakePressureTable[MainBrakeMaxPos]; typedef std::map<int,TBrakePressure> TBrakePressureTable;
/*typy napedow*/ /*typy napedow*/

View File

@@ -23,7 +23,7 @@ http://mozilla.org/MPL/2.0/.
#include "Mover.h" #include "Mover.h"
#include "../globals.h" #include "../globals.h"
//#include "../qutils.h" //#include "../qutils.h"
#include <mctools.h> #include "mctools.h"
#include "../logs.h" #include "../logs.h"
#include "hamulce.h" #include "hamulce.h"
#include "Oerlikon_ESt.h" #include "Oerlikon_ESt.h"
@@ -37,22 +37,22 @@ http://mozilla.org/MPL/2.0/.
const double dEpsilon = 0.01; // 1cm (zależy od typu sprzęgu...) const double dEpsilon = 0.01; // 1cm (zależy od typu sprzęgu...)
const double CouplerTune = 0.1; // skalowanie tlumiennosci const double CouplerTune = 0.1; // skalowanie tlumiennosci
long Trunc(float f) inline long Trunc(float f)
{ {
return (long)f; return (long)f;
} }
long ROUND(float f) inline long ROUND(float f)
{ {
return Trunc(f + 0.5); return Trunc(f + 0.5);
} }
double sqr(double val) // SQR() zle liczylo w current() ... inline double sqr(double val) // SQR() zle liczylo w current() ...
{ {
return val * val; return val * val;
} }
double ComputeCollision(double v1, double v2, double m1, double m2, double beta, bool vc) double ComputeCollision(double &v1, double &v2, double m1, double m2, double beta, bool vc)
{ // oblicza zmiane predkosci i przyrost pedu wskutek kolizji { // oblicza zmiane predkosci i przyrost pedu wskutek kolizji
if (v1 < v2 && vc) if (v1 < v2 && vc)
return 0; return 0;
@@ -68,7 +68,7 @@ double ComputeCollision(double v1, double v2, double m1, double m2, double beta,
} }
int DirPatch(int Coupler1, int Coupler2) int DirPatch(int Coupler1, int Coupler2)
{ { // poprawka dla liczenia sil przy ustawieniu przeciwnym obiektow
return (Coupler1 != Coupler2 ? 1 : -1); return (Coupler1 != Coupler2 ? 1 : -1);
} }
@@ -317,12 +317,12 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
BrakeCtrlPosNo = 0; BrakeCtrlPosNo = 0;
LightsPosNo = 0; LightsPosNo = 0;
LightsDefPos = 1; LightsDefPos = 1;
for (k = -1; k < MainBrakeMaxPos; k++) //for (k = -1; k < MainBrakeMaxPos; k++)
{ //{
BrakePressureTable[k].PipePressureVal = 0; // BrakePressureTable[k].PipePressureVal = 0;
BrakePressureTable[k].BrakePressureVal = 0; // BrakePressureTable[k].BrakePressureVal = 0;
BrakePressureTable[k].FlowSpeedVal = 0; // BrakePressureTable[k].FlowSpeedVal = 0;
} //}
// with BrakePressureTable[-2] do {pozycja odciecia} // with BrakePressureTable[-2] do {pozycja odciecia}
{ {
@@ -1043,11 +1043,18 @@ ZN //masa
double TMoverParameters::LocalBrakeRatio(void) double TMoverParameters::LocalBrakeRatio(void)
{ {
double LBR; double LBR;
if (BrakeHandle == MHZ_EN57)
if ((BrakeOpModeFlag >= bom_EP))
LBR = Handle->GetEP(BrakeCtrlPosR);
else
LBR = 0;
else
{
if (LocalBrakePosNo > 0) if (LocalBrakePosNo > 0)
LBR = LocalBrakePos / LocalBrakePosNo; LBR = LocalBrakePos / LocalBrakePosNo;
else else
LBR = 0; LBR = 0;
}
// if (TestFlag(BrakeStatus, b_antislip)) // if (TestFlag(BrakeStatus, b_antislip))
// LBR = Max0R(LBR, PipeRatio) + 0.4; // LBR = Max0R(LBR, PipeRatio) + 0.4;
return LBR; return LBR;
@@ -1101,7 +1108,7 @@ double TMoverParameters::PipeRatio(void)
double pr; double pr;
if (DeltaPipePress > 0) if (DeltaPipePress > 0)
if (false) // SPKS!! if (false) // SPKS!! no to jak nie wchodzimy to po co branch?
{ {
if ((3 * PipePress) > (HighPipePress + LowPipePress + LowPipePress)) if ((3 * PipePress) > (HighPipePress + LowPipePress + LowPipePress))
pr = (HighPipePress - Min0R(HighPipePress, PipePress)) / pr = (HighPipePress - Min0R(HighPipePress, PipePress)) /
@@ -1109,11 +1116,11 @@ double TMoverParameters::PipeRatio(void)
else else
pr = (HighPipePress - 1.0 / 3.0 * DeltaPipePress - Max0R(LowPipePress, PipePress)) / pr = (HighPipePress - 1.0 / 3.0 * DeltaPipePress - Max0R(LowPipePress, PipePress)) /
(DeltaPipePress * 2.0 / 3.0); (DeltaPipePress * 2.0 / 3.0);
// if (not TestFlag(BrakeStatus,b_Ractive)) and (BrakeMethod and 1 = 0) and //if (not TestFlag(BrakeStatus, b_Ractive))
// TestFlag(BrakeDelays,bdelay_R) and (Power<1) and (BrakeCtrlPos<1) then // and(BrakeMethod and 1 = 0) and TestFlag(BrakeDelays, bdelay_R) and (Power < 1) and
// pr:=Min0R(0.5,pr); // (BrakeCtrlPos < 1) then pr : = Min0R(0.5, pr);
// if (Compressor>0.5) then //if (Compressor > 0.5)
// pr:=pr*1.333; //dziwny rapid wywalamy // then pr : = pr * 1.333; // dziwny rapid wywalamy
} }
else else
pr = (HighPipePress - Max0R(LowPipePress, Min0R(HighPipePress, PipePress))) / pr = (HighPipePress - Max0R(LowPipePress, Min0R(HighPipePress, PipePress))) /
@@ -1591,6 +1598,7 @@ int TMoverParameters::ShowCurrent(int AmpN)
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160710 // Q: 20160710
// zwiększenie nastawinika
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::IncMainCtrl(int CtrlSpeed) bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
@@ -1621,7 +1629,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
((CtrlSpeed > 1) && (TrainType == dt_EZT) && (ActiveDir != 0))) ((CtrlSpeed > 1) && (TrainType == dt_EZT) && (ActiveDir != 0)))
OK = (IncMainCtrl(1) && IncMainCtrl(CtrlSpeed - 1)); OK = (IncMainCtrl(1) && IncMainCtrl(CtrlSpeed - 1));
break; break;
}; }
case ElectricSeriesMotor: case ElectricSeriesMotor:
{ {
@@ -1672,7 +1680,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
{ // szybkie przejście na bezoporową { // szybkie przejście na bezoporową
while ((RList[MainCtrlPos].R > 0) && IncMainCtrl(1)) while ((RList[MainCtrlPos].R > 0) && IncMainCtrl(1))
; // tutaj ma być pętla na "pusto"
// OK:=true ; {takie chamskie, potem poprawie} <-Ra: kto miał to // OK:=true ; {takie chamskie, potem poprawie} <-Ra: kto miał to
// poprawić i po co? // poprawić i po co?
if (ActiveDir == -1) if (ActiveDir == -1)
@@ -1693,7 +1701,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
// return OK; // return OK;
break; break;
}; }
case DieselEngine: case DieselEngine:
{ {
@@ -1713,13 +1721,13 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
OK = true; OK = true;
} }
break; break;
}; }
case WheelsDriven: case WheelsDriven:
{ {
OK = AddPulseForce(CtrlSpeed); OK = AddPulseForce(CtrlSpeed);
break; break;
}; }
} // switch EngineType of } // switch EngineType of
} }
@@ -1764,6 +1772,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
// ***************************************************************************** // *****************************************************************************
// Q: 20160710 // Q: 20160710
// zmniejszenie nastawnika
// ***************************************************************************** // *****************************************************************************
bool TMoverParameters::DecMainCtrl(int CtrlSpeed) bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
{ {
@@ -1969,8 +1978,9 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160710 // Q: 20160710
// załączenie rozrządu
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::CabActivisation(void) // za³¹czenie rozrz¹du bool TMoverParameters::CabActivisation(void)
{ {
bool OK = false; bool OK = false;
@@ -1986,8 +1996,9 @@ bool TMoverParameters::CabActivisation(void) // za
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160710 // Q: 20160710
// wyłączenie rozrządu
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::CabDeactivisation(void) // wy³¹czenie rozrz¹du bool TMoverParameters::CabDeactivisation(void)
{ {
bool OK = false; bool OK = false;
@@ -2612,20 +2623,20 @@ bool TMoverParameters::DecManualBrakeLevel(int CtrlSpeed)
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160713 // Q: 20160713
// reczne przelaczanie hamulca elektrodynamicznego
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::DynamicBrakeSwitch(bool Switch) bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
{ {
int b;
bool DBS; bool DBS;
if ((DynamicBrakeType == dbrake_switch) && (MainCtrlPos == 0)) if ((DynamicBrakeType == dbrake_switch) && (MainCtrlPos == 0))
{ {
DynamicBrakeFlag = Switch; DynamicBrakeFlag = Switch;
DBS = true; DBS = true;
for (b = 0; b < 1; b++) for (int b = 0; b < 2; b++)
// with Couplers[b] do // with Couplers[b] do
if (TestFlag(Couplers[b].CouplingFlag, ctrain_controll)) if (TestFlag(Couplers[b].CouplingFlag, ctrain_controll))
Couplers[b].Connected->DynamicBrakeFlag = DynamicBrakeFlag; Couplers[b].Connected->DynamicBrakeFlag = Switch;
// end; // end;
// if (DynamicBrakeType=dbrake_passive) and (TrainType=dt_ET42) then // if (DynamicBrakeType=dbrake_passive) and (TrainType=dt_ET42) then
// begin // begin
@@ -5305,29 +5316,8 @@ std::string TMoverParameters::EngineDescription(int what)
// Q: 20160709 // Q: 20160709
// ************************************************************************************************* // *************************************************************************************************
double TMoverParameters::GetTrainsetVoltage(void) double TMoverParameters::GetTrainsetVoltage(void)
{ {//ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
double volt; return Max0R(HVCouplers[1][1], HVCouplers[0][1]);
volt = 0.0;
if (Couplers[1].Connected != NULL)
if (TestFlag(Couplers[1].CouplingFlag, ctrain_power)) // czy jest sprzêg WN
{ // najczêœciej silnikowy jest z ty³u
if (Couplers[1].Connected->PantFrontVolt != 0.0)
volt = Couplers[1].Connected->PantFrontVolt;
else if (Couplers[1].Connected->PantRearVolt != 0.0)
volt = Couplers[1].Connected->PantRearVolt;
}
if (volt == 0.0)
if (Couplers[0].Connected != NULL)
if (TestFlag(Couplers[0].CouplingFlag, ctrain_power)) // czy jest sprzêg WN
{
if (Couplers[0].Connected->PantFrontVolt != 0.0)
volt = Couplers[0].Connected->PantFrontVolt;
else if (Couplers[0].Connected->PantRearVolt != 0.0)
volt = Couplers[0].Connected->PantRearVolt;
}
// WriteLog("GTV");
return volt;
} }
// ************************************************************************************************* // *************************************************************************************************
@@ -5673,6 +5663,8 @@ bool TMoverParameters::readBPT(int ln, std::string line)
BrakePressureTable[k].BrakeType = Individual; BrakePressureTable[k].BrakeType = Individual;
//-- WriteLog("BPT: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4); //-- WriteLog("BPT: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
if (k == gBCPN)
startBPT = false;
} }
delete[] xxx; delete[] xxx;
BPTLINE++; BPTLINE++;
@@ -6210,8 +6202,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
if (issection("Cntrl.") || startBPT) if (issection("Cntrl.") || startBPT)
{ {
secBPT = true; secBPT = true;
BrakeCtrlPosNo = gBCPN; if (gBCPN > 0)
if (BrakeCtrlPosNo > 0)
readBPT(BPTLINE, xline); // np wagony nie maja BPT readBPT(BPTLINE, xline); // np wagony nie maja BPT
} }
@@ -7484,6 +7475,8 @@ double TMoverParameters::GetExternalCommand(std::string &Command)
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160714 // Q: 20160714
// GF: 20161117
// rozsyłanie komend do całego składu
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::SendCtrlBroadcast(std::string CtrlCommand, double ctrlvalue) bool TMoverParameters::SendCtrlBroadcast(std::string CtrlCommand, double ctrlvalue)
{ {
@@ -7491,11 +7484,11 @@ bool TMoverParameters::SendCtrlBroadcast(std::string CtrlCommand, double ctrlval
bool OK; bool OK;
OK = ((CtrlCommand != CommandIn.Command) && (ctrlvalue != CommandIn.Value1)); OK = ((CtrlCommand != CommandIn.Command) && (ctrlvalue != CommandIn.Value1));
// if (OK) if (OK)
// for (b=0; b<1; b++ ) for (b = 0; b < 2; b++)
// if (TestFlag(Couplers[b].CouplingFlag, ctrain_controll)) if (TestFlag(Couplers[b].CouplingFlag, ctrain_controll))
// if (Couplers[b].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, DirF(b))) if (Couplers[b].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, DirF(b)))
// OK = (Couplers[b].Connected->RunInternalCommand() || OK); OK = (Couplers[b].Connected->RunInternalCommand() || OK);
return OK; return OK;
} }
@@ -7524,6 +7517,7 @@ bool TMoverParameters::SetInternalCommand(std::string NewCommand, double NewValu
// ************************************************************************************************* // *************************************************************************************************
// Q: 20160714 // Q: 20160714
// wysyłanie komendy w kierunku dir (1=przód, -1=tył) do kolejnego pojazdu (jednego)
// ************************************************************************************************* // *************************************************************************************************
bool TMoverParameters::SendCtrlToNext(std::string CtrlCommand, double ctrlvalue, double dir) bool TMoverParameters::SendCtrlToNext(std::string CtrlCommand, double ctrlvalue, double dir)
{ {
@@ -7534,17 +7528,16 @@ bool TMoverParameters::SendCtrlToNext(std::string CtrlCommand, double ctrlvalue,
// Ra: problem jest również, jeśli AI będzie na końcu składu // Ra: problem jest również, jeśli AI będzie na końcu składu
OK = (dir != 0); // and Mains; OK = (dir != 0); // and Mains;
d = (1 + Sign(dir)) / 2; // dir=-1=>d=0, dir=1=>d=1 - wysyłanie tylko w tył d = (1 + Sign(dir)) / 2; // dir=-1=>d=0, dir=1=>d=1 - wysyłanie tylko w tył
//- if (OK) //musi byæ wybrana niezerowa kabina if (OK) // musi być wybrana niezerowa kabina
// with Couplers[d] do //w³asny sprzêg od strony (d) if (TestFlag(Couplers[d].CouplingFlag, ctrain_controll))
//- if (TestFlag(Couplers[d].CouplingFlag, ctrain_controll)) if (Couplers[d].ConnectedNr != d) // jeśli ten nastpęny jest zgodny z aktualnym
//- if (Couplers[d].ConnectedNr != d) //jeœli ten nastpêny jest zgodny z aktualnym {
//- { if (Couplers[d].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, dir))
//- if (Couplers[d].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, dir)) OK = (Couplers[d].Connected->RunInternalCommand() && OK); // tu jest rekurencja
//- OK = (Couplers[d].Connected->RunInternalCommand() && OK); //tu jest rekurencja }
//- } else // jeśli następny jest ustawiony przeciwnie, zmieniamy kierunek
//- else //jeœli nastêpny jest ustawiony przeciwnie, zmieniamy kierunek if (Couplers[d].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, -dir))
//- if (Couplers[d].Connected->SetInternalCommand(CtrlCommand, ctrlvalue, -dir)) OK = (Couplers[d].Connected->RunInternalCommand() && OK); // tu jest rekurencja
//- OK = (Couplers[d].Connected->RunInternalCommand() && OK); //tu jest rekurencja
return OK; return OK;
} }

View File

@@ -20,16 +20,16 @@ Copyright (C) 2007-2014 Maciej Cierniak
//---FUNKCJE OGOLNE--- //---FUNKCJE OGOLNE---
static double const DPL = 0.25; static double const DPL = 0.25;
double TFV4aM::pos_table[11] = { 0, 8, 1, 2, 0, 3, 6, 8, 2, 2, 2 }; double TFV4aM::pos_table[11] = { -2, 6, -1, 0, -2, 1, 4, 6, 0, 0, 0 };
double TMHZ_EN57::pos_table[11] = { 0, 12, 1, 2, 2, 4, 11, 12, 2, 2, 2 }; double TMHZ_EN57::pos_table[11] = { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
double TM394::pos_table[11] = { 0, 6, 0, 1, 2, 3, 5, 6, 1, 1, 1 }; double TM394::pos_table[11] = { -1, 5, -1, 0, 1, 2, 4, 5, 0, 0, 0 };
double TH14K1::BPT_K[6][2] = double TH14K1::BPT_K[6][2] =
{ (10, 0), (4, 1), (0, 1), (4, 0), (4, -1), (15, -1) }; { (10, 0), (4, 1), (0, 1), (4, 0), (4, -1), (15, -1) };
double TH14K1::pos_table[11] = { 0, 5, 0, 1, 2, 3, 4, 5, 1, 1, 1 }; double TH14K1::pos_table[11] = { -1, 4, -1, 0, 1, 2, 3, 4, 0, 0, 0 };
double TSt113::BPT_K[6][2] = double TSt113::BPT_K[6][2] =
{ (10, 0), (4, 1), (0, 1), (4, 0), (4, -1), (15, -1) }; { (10, 0), (4, 1), (0, 1), (4, 0), (4, -1), (15, -1) };
double TSt113::BEP_K[7] = { 0, -1, 1, 0, 0, 0, 0 }; double TSt113::BEP_K[7] = { 0, -1, 1, 0, 0, 0, 0 };
double TSt113::pos_table[11] = { 0, 6, 0, 1, 3, 4, 5, 6, 1, 1, 2 }; double TSt113::pos_table[11] = { -1, 5, -1, 0, 2, 3, 4, 5, 0, 0, 1 };
double TFVel6::pos_table[11] = { -1, 6, -1, 0, 6, 4, 4.7, 5, -1, 0, 1 }; double TFVel6::pos_table[11] = { -1, 6, -1, 0, 6, 4, 4.7, 5, -1, 0, 1 };
@@ -2121,6 +2121,10 @@ double TDriverHandle::GetPos(int i)
return 0; return 0;
} }
double TDriverHandle::GetEP(double pos)
{
return 0;
}
//---FV4a--- //---FV4a---
double TFV4a::GetPF(double i_bcp, double PP, double HP, double dt, double ep) double TFV4a::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
@@ -2133,8 +2137,8 @@ double TFV4a::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
double ActFlowSpeed; double ActFlowSpeed;
ep = PP; // SPKS!! ep = PP; // SPKS!!
LimPP = Min0R(BPT[lround(i_bcp)][1], HP); LimPP = Min0R(BPT[lround(i_bcp) + 2][1], HP);
ActFlowSpeed = BPT[lround(i_bcp)][0]; ActFlowSpeed = BPT[lround(i_bcp) + 2][0];
if ((i_bcp == i_bcpno)) if ((i_bcp == i_bcpno))
LimPP = 2.9; LimPP = 2.9;
@@ -2254,7 +2258,7 @@ double TFV4aM::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
XP = 0; // jak pusty, to pusty XP = 0; // jak pusty, to pusty
LimPP = Min0R(LPP_RP(i_bcp) + TP * 0.08 + RedAdj, HP); // pozycja + czasowy lub zasilanie LimPP = Min0R(LPP_RP(i_bcp) + TP * 0.08 + RedAdj, HP); // pozycja + czasowy lub zasilanie
ActFlowSpeed = BPT[lround(i_bcp)][0]; ActFlowSpeed = BPT[lround(i_bcp) + 2][0];
if ((EQ(i_bcp, -1))) if ((EQ(i_bcp, -1)))
pom = Min0R(HP, 5.4 + RedAdj); pom = Min0R(HP, 5.4 + RedAdj);
@@ -2311,7 +2315,7 @@ double TFV4aM::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
// jednak trzeba wydluzyc, bo // jednak trzeba wydluzyc, bo
// obecnie zle dziala // obecnie zle dziala
if ((RP < ep) && if ((RP < ep) &&
(RP < BPT[lround(i_bcpno)][1])) // jesli jestesmy ponizej cisnienia w sterujacym (2.9 bar) (RP < BPT[lround(i_bcpno) + 2][1])) // jesli jestesmy ponizej cisnienia w sterujacym (2.9 bar)
RP = RP + PF(RP, CP, 0.005) * dt; // przypisz cisnienie w PG - wydluzanie napelniania o czas RP = RP + PF(RP, CP, 0.005) * dt; // przypisz cisnienie w PG - wydluzanie napelniania o czas
// potrzebny do napelnienia PG // potrzebny do napelnienia PG
@@ -2367,9 +2371,9 @@ double TFV4aM::LPP_RP(double pos) // cisnienie z zaokraglonej pozycji;
{ {
int i_pos; int i_pos;
i_pos = lround(pos - 0.5); // zaokraglone w dol i_pos = lround(pos - 0.5) + 2; // zaokraglone w dol
return return
BPT[i_pos][1] + (BPT[i_pos + 1][1] - BPT[i_pos][1]) * (pos - i_pos); // interpolacja liniowa BPT[i_pos][1] + (BPT[i_pos + 1][1] - BPT[i_pos][1]) * (pos + 2 - i_pos); // interpolacja liniowa
} }
bool TFV4aM::EQ(double pos, double i_pos) bool TFV4aM::EQ(double pos, double i_pos)
{ {
@@ -2539,8 +2543,8 @@ double TM394::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
if (BCP < -1) if (BCP < -1)
BCP = 1; BCP = 1;
LimPP = Min0R(BPT_394[BCP][1], HP); LimPP = Min0R(BPT_394[BCP+1][1], HP);
ActFlowSpeed = BPT_394[BCP][0]; ActFlowSpeed = BPT_394[BCP+1][0];
if ((BCP == 1) || (BCP == i_bcpno)) if ((BCP == 1) || (BCP == i_bcpno))
LimPP = PP; LimPP = PP;
if ((BCP == 0)) if ((BCP == 0))
@@ -2615,14 +2619,14 @@ double TH14K1::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
BCP = lround(i_bcp); BCP = lround(i_bcp);
if (i_bcp < -1) if (i_bcp < -1)
BCP = 1; BCP = 1;
LimPP = BPT_K[BCP][1]; LimPP = BPT_K[BCP+1][1];
if (LimPP < 0) if (LimPP < 0)
LimPP = 0.5 * PP; LimPP = 0.5 * PP;
else if (LimPP > 0) else if (LimPP > 0)
LimPP = PP; LimPP = PP;
else else
LimPP = CP; LimPP = CP;
ActFlowSpeed = BPT_K[BCP][0]; ActFlowSpeed = BPT_K[BCP+1][0];
CP = CP + 6 * Min0R(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy CP = CP + 6 * Min0R(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy
@@ -2685,14 +2689,14 @@ double TSt113::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
if (BCP < -1) if (BCP < -1)
BCP = 1; BCP = 1;
LimPP = BPT_K[BCP][1]; LimPP = BPT_K[BCP+1][1];
if (LimPP < 0) if (LimPP < 0)
LimPP = 0.5 * PP; LimPP = 0.5 * PP;
else if (LimPP > 0) else if (LimPP > 0)
LimPP = PP; LimPP = PP;
else else
LimPP = CP; LimPP = CP;
ActFlowSpeed = BPT_K[BCP][0]; ActFlowSpeed = BPT_K[BCP+1][0];
CP = CP + 6 * Min0R(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy CP = CP + 6 * Min0R(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy
@@ -2738,8 +2742,8 @@ double Ttest::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
double dpMainValve; double dpMainValve;
double ActFlowSpeed; double ActFlowSpeed;
LimPP = BPT[lround(i_bcp)][1]; LimPP = BPT[lround(i_bcp)+2][1];
ActFlowSpeed = BPT[lround(i_bcp)][0]; ActFlowSpeed = BPT[lround(i_bcp)+2][0];
if ((i_bcp == i_bcpno)) if ((i_bcp == i_bcpno))
LimPP = 0.0; LimPP = 0.0;

View File

@@ -585,7 +585,8 @@ Knorr/West EP -
virtual double GetCP(); virtual double GetCP();
virtual void SetReductor(double nAdj); virtual void SetReductor(double nAdj);
virtual double GetSound(int i); virtual double GetSound(int i);
virtual double GetPos(int i); static double GetPos(int i);
double GetEP(double pos);
}; };
@@ -625,7 +626,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*/;
double GetPos(int i)/*override*/; static double GetPos(int i)/*override*/;
inline TFV4aM(void) : TDriverHandle() { } inline TFV4aM(void) : TDriverHandle() { }
}; };
@@ -649,7 +650,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*/;
double GetPos(int i)/*override*/; static double GetPos(int i)/*override*/;
double GetCP()/*override*/; double GetCP()/*override*/;
double GetEP(double pos); double GetEP(double pos);
@@ -703,7 +704,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*/;
double GetPos(int i)/*override*/; static double GetPos(int i)/*override*/;
inline TM394(void) : TDriverHandle() { } inline TM394(void) : TDriverHandle() { }
}; };
@@ -726,7 +727,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*/;
double GetPos(int i)/*override*/; static double GetPos(int i)/*override*/;
inline TH14K1(void) : TDriverHandle() { } inline TH14K1(void) : TDriverHandle() { }
}; };
@@ -746,7 +747,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*/;
double GetPos(int i)/*override*/; static double GetPos(int i)/*override*/;
void Init(double Press)/*override*/; void Init(double Press)/*override*/;
inline TSt113(void) : TH14K1() { } inline TSt113(void) : TH14K1() { }
@@ -819,7 +820,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*/;
double GetPos(int i)/*override*/; static 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*/;