mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 16:49:18 +02:00
1. Poprawione asynchrony.
2. Możliwość zdefiniowania koloru tła ekranu ładowania w eu07.ini. 3. Dodanie logowania ruchu ramek WM_COPYDATA do oddzielnego pliku. 4. Dodana ramka skrócona aktywnych AI. 5. Dodana ramka sterowania uszkodzeniami pojazdów. 6. Dodanie kręciołka od świateł (w tym trakcja wielokrotna). 7. Rozbudowa asynchronów, m.in. tempomat, zadawanie siły (w kN), przeciwpoślizg, czyste ED itd. 8. Dodanie animacji drtzwi odskokowo-przesuwnych. 9. Dodanie możliwości uszkadzania pojazdów (EN57). 10. Uruchomienie sprzęgu WN, zwłaszcza w asynchronach - do przejrzenia logowanie braków napięcia. 11. Wyłączanie radiostopu przez wyłączanie radia, a nie przez ruch zaworem maszynisty. 12. Usunięcie wyłącznika ciśnieniowego w EN57 (proteza, trzeba zrobić wpis na to). 13. Wstępna wersja hamowania rekuperacyjnego wraz z przechodzeniem na hamowanie oporowe. 14. Cała masa nowych zmiennych stanu dostępna dla ekranu (Pythona). 15. Nowa stara smuga z dawnego SPKSu. 16. Inne, które mogłem zapomnieć lub nie uszczegółowić. 17. Poprawione wyświetlanie haslera
This commit is contained in:
22
Driver.cpp
22
Driver.cpp
@@ -2386,7 +2386,11 @@ bool TController::IncBrake()
|
|||||||
mvOccupied->BrakeReleaser(0);
|
mvOccupied->BrakeReleaser(0);
|
||||||
break;
|
break;
|
||||||
case ElectroPneumatic:
|
case ElectroPneumatic:
|
||||||
if (mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos(bh_EPB))
|
if (mvOccupied->EngineType == ElectricInductionMotor)
|
||||||
|
{
|
||||||
|
OK = mvOccupied->IncLocalBrakeLevel(1);
|
||||||
|
}
|
||||||
|
else if (mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos(bh_EPB))
|
||||||
{
|
{
|
||||||
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPB));
|
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPB));
|
||||||
if (mvOccupied->Handle->GetPos(bh_EPR) - mvOccupied->Handle->GetPos(bh_EPN) < 0.1)
|
if (mvOccupied->Handle->GetPos(bh_EPR) - mvOccupied->Handle->GetPos(bh_EPN) < 0.1)
|
||||||
@@ -2423,7 +2427,11 @@ bool TController::DecBrake()
|
|||||||
Need_BrakeRelease = true;
|
Need_BrakeRelease = true;
|
||||||
break;
|
break;
|
||||||
case ElectroPneumatic:
|
case ElectroPneumatic:
|
||||||
if (mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos(bh_EPR))
|
if (mvOccupied->EngineType == ElectricInductionMotor)
|
||||||
|
{
|
||||||
|
OK = mvOccupied->DecLocalBrakeLevel(1);
|
||||||
|
}
|
||||||
|
else if (mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos(bh_EPR))
|
||||||
{
|
{
|
||||||
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPR));
|
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPR));
|
||||||
if (mvOccupied->Handle->GetPos(bh_EPR) - mvOccupied->Handle->GetPos(bh_EPN) < 0.1)
|
if (mvOccupied->Handle->GetPos(bh_EPR) - mvOccupied->Handle->GetPos(bh_EPN) < 0.1)
|
||||||
@@ -2527,6 +2535,14 @@ bool TController::IncSpeed()
|
|||||||
OK = mvControlling->IncScndCtrl(1);
|
OK = mvControlling->IncScndCtrl(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ElectricInductionMotor:
|
||||||
|
if (!mvControlling->FuseFlag)
|
||||||
|
if (Ready || (iDrivigFlags & movePress) || (mvOccupied->ShuntMode)) //{(BrakePress<=0.01*MaxBrakePress)}
|
||||||
|
{
|
||||||
|
OK = mvControlling->IncMainCtrl(1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
break;
|
||||||
case WheelsDriven:
|
case WheelsDriven:
|
||||||
if (!mvControlling->CabNo)
|
if (!mvControlling->CabNo)
|
||||||
mvControlling->CabActivisation();
|
mvControlling->CabActivisation();
|
||||||
@@ -2577,6 +2593,7 @@ bool TController::DecSpeed(bool force)
|
|||||||
break;
|
break;
|
||||||
case Dumb:
|
case Dumb:
|
||||||
case DieselElectric:
|
case DieselElectric:
|
||||||
|
case ElectricInductionMotor:
|
||||||
OK = mvControlling->DecScndCtrl(2);
|
OK = mvControlling->DecScndCtrl(2);
|
||||||
if (!OK)
|
if (!OK)
|
||||||
OK = mvControlling->DecMainCtrl(2 + (mvControlling->MainCtrlPos / 2));
|
OK = mvControlling->DecMainCtrl(2 + (mvControlling->MainCtrlPos / 2));
|
||||||
@@ -2740,6 +2757,7 @@ void TController::SpeedSet()
|
|||||||
break;
|
break;
|
||||||
case Dumb:
|
case Dumb:
|
||||||
case DieselElectric:
|
case DieselElectric:
|
||||||
|
case ElectricInductionMotor:
|
||||||
break;
|
break;
|
||||||
// WheelsDriven :
|
// WheelsDriven :
|
||||||
// begin
|
// begin
|
||||||
|
|||||||
4
Driver.h
4
Driver.h
@@ -207,6 +207,10 @@ class TController
|
|||||||
TAction eAction; // aktualny stan
|
TAction eAction; // aktualny stan
|
||||||
bool HelpMeFlag; // wystawiane True jesli cos niedobrego sie dzieje
|
bool HelpMeFlag; // wystawiane True jesli cos niedobrego sie dzieje
|
||||||
public:
|
public:
|
||||||
|
inline TAction GetAction()
|
||||||
|
{
|
||||||
|
return eAction;
|
||||||
|
}
|
||||||
bool AIControllFlag; // rzeczywisty/wirtualny maszynista
|
bool AIControllFlag; // rzeczywisty/wirtualny maszynista
|
||||||
int iRouteWanted; // oczekiwany kierunek jazdy (0-stop,1-lewo,2-prawo,3-prosto) np. odpala
|
int iRouteWanted; // oczekiwany kierunek jazdy (0-stop,1-lewo,2-prawo,3-prosto) np. odpala
|
||||||
// migacz lub czeka na stan zwrotnicy
|
// migacz lub czeka na stan zwrotnicy
|
||||||
|
|||||||
308
DynObj.cpp
308
DynObj.cpp
@@ -139,7 +139,7 @@ void TAnim::Parovoz(){
|
|||||||
// animowanie tłoka i rozrządu parowozu
|
// animowanie tłoka i rozrządu parowozu
|
||||||
};
|
};
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
TDynamicObject *__fastcall TDynamicObject::FirstFind(int &coupler_nr)
|
TDynamicObject * TDynamicObject::FirstFind(int &coupler_nr)
|
||||||
{ // szukanie skrajnego połączonego pojazdu w pociagu
|
{ // szukanie skrajnego połączonego pojazdu w pociagu
|
||||||
// od strony sprzegu (coupler_nr) obiektu (start)
|
// od strony sprzegu (coupler_nr) obiektu (start)
|
||||||
TDynamicObject *temp = this;
|
TDynamicObject *temp = this;
|
||||||
@@ -255,7 +255,7 @@ float TDynamicObject::GetEPP()
|
|||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
TDynamicObject *__fastcall TDynamicObject::GetFirstDynamic(int cpl_type)
|
TDynamicObject * TDynamicObject::GetFirstDynamic(int cpl_type)
|
||||||
{ // Szukanie skrajnego połączonego pojazdu w pociagu
|
{ // Szukanie skrajnego połączonego pojazdu w pociagu
|
||||||
// od strony sprzegu (cpl_type) obiektu szukajacego
|
// od strony sprzegu (cpl_type) obiektu szukajacego
|
||||||
// Ra: wystarczy jedna funkcja do szukania w obu kierunkach
|
// Ra: wystarczy jedna funkcja do szukania w obu kierunkach
|
||||||
@@ -413,10 +413,10 @@ void TDynamicObject::UpdateDoorTranslate(TAnim *pAnim)
|
|||||||
{
|
{
|
||||||
if (pAnim->iNumber & 1)
|
if (pAnim->iNumber & 1)
|
||||||
pAnim->smAnimated->SetTranslate(
|
pAnim->smAnimated->SetTranslate(
|
||||||
vector3(0, 0, Max0R(dDoorMoveR * pAnim->fSpeed, dDoorMoveR)));
|
vector3(0, 0, Min0R(dDoorMoveR * pAnim->fSpeed, dDoorMoveR)));
|
||||||
else
|
else
|
||||||
pAnim->smAnimated->SetTranslate(
|
pAnim->smAnimated->SetTranslate(
|
||||||
vector3(0, 0, Max0R(dDoorMoveL * pAnim->fSpeed, dDoorMoveL)));
|
vector3(0, 0, Min0R(dDoorMoveL * pAnim->fSpeed, dDoorMoveL)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -485,6 +485,23 @@ void TDynamicObject::UpdatePant(TAnim *pAnim)
|
|||||||
pAnim->smElement[4]->SetRotate(float3(-1, 0, 0), b); //ślizg
|
pAnim->smElement[4]->SetRotate(float3(-1, 0, 0), b); //ślizg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TDynamicObject::UpdateDoorPlug(TAnim *pAnim)
|
||||||
|
{ // animacja drzwi - odskokprzesuw
|
||||||
|
if (pAnim->smAnimated)
|
||||||
|
{
|
||||||
|
if (pAnim->iNumber & 1)
|
||||||
|
pAnim->smAnimated->SetTranslate(
|
||||||
|
vector3(Min0R(dDoorMoveR * 2, MoverParameters->DoorMaxPlugShift), 0,
|
||||||
|
Max0R(0, Min0R(dDoorMoveR * pAnim->fSpeed, dDoorMoveR) -
|
||||||
|
MoverParameters->DoorMaxPlugShift * 0.5f)));
|
||||||
|
else
|
||||||
|
pAnim->smAnimated->SetTranslate(
|
||||||
|
vector3(Min0R(dDoorMoveL * 2, MoverParameters->DoorMaxPlugShift), 0,
|
||||||
|
Max0R(0, Min0R(dDoorMoveL * pAnim->fSpeed, dDoorMoveL) -
|
||||||
|
MoverParameters->DoorMaxPlugShift * 0.5f)));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void TDynamicObject::UpdateLeverDouble(TAnim *pAnim)
|
void TDynamicObject::UpdateLeverDouble(TAnim *pAnim)
|
||||||
{ // animacja gałki zależna od double
|
{ // animacja gałki zależna od double
|
||||||
pAnim->smAnimated->SetRotate(float3(1, 0, 0), pAnim->fSpeed * *pAnim->fDoubleBase);
|
pAnim->smAnimated->SetRotate(float3(1, 0, 0), pAnim->fSpeed * *pAnim->fDoubleBase);
|
||||||
@@ -919,7 +936,7 @@ double ABuAcos(const vector3 &calc_temp)
|
|||||||
return atan2(-calc_temp.x, calc_temp.z); // Ra: tak prościej
|
return atan2(-calc_temp.x, calc_temp.z); // Ra: tak prościej
|
||||||
}
|
}
|
||||||
|
|
||||||
TDynamicObject *__fastcall TDynamicObject::ABuFindNearestObject(TTrack *Track,
|
TDynamicObject * TDynamicObject::ABuFindNearestObject(TTrack *Track,
|
||||||
TDynamicObject *MyPointer,
|
TDynamicObject *MyPointer,
|
||||||
int &CouplNr)
|
int &CouplNr)
|
||||||
{ // zwraca wskaznik do obiektu znajdujacego sie na torze
|
{ // zwraca wskaznik do obiektu znajdujacego sie na torze
|
||||||
@@ -983,7 +1000,7 @@ TDynamicObject *__fastcall TDynamicObject::ABuFindNearestObject(TTrack *Track,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDynamicObject *__fastcall TDynamicObject::ABuScanNearestObject(TTrack *Track, double ScanDir,
|
TDynamicObject * TDynamicObject::ABuScanNearestObject(TTrack *Track, double ScanDir,
|
||||||
double ScanDist, int &CouplNr)
|
double ScanDist, int &CouplNr)
|
||||||
{ // skanowanie toru w poszukiwaniu obiektu najblizszego
|
{ // skanowanie toru w poszukiwaniu obiektu najblizszego
|
||||||
// kamerze
|
// kamerze
|
||||||
@@ -1086,7 +1103,7 @@ void TDynamicObject::ABuCheckMyTrack()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ra: w poniższej funkcji jest problem ze sprzęgami
|
// Ra: w poniższej funkcji jest problem ze sprzęgami
|
||||||
TDynamicObject *__fastcall TDynamicObject::ABuFindObject(TTrack *Track, int ScanDir,
|
TDynamicObject * TDynamicObject::ABuFindObject(TTrack *Track, int ScanDir,
|
||||||
Byte &CouplFound, double &dist)
|
Byte &CouplFound, double &dist)
|
||||||
{ // Zwraca wskaźnik najbliższego obiektu znajdującego się
|
{ // Zwraca wskaźnik najbliższego obiektu znajdującego się
|
||||||
// na torze w określonym kierunku, ale tylko wtedy, kiedy
|
// na torze w określonym kierunku, ale tylko wtedy, kiedy
|
||||||
@@ -2625,17 +2642,21 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// asynchronami, to
|
// asynchronami, to
|
||||||
// niech steruje
|
// niech steruje
|
||||||
{ // hamulcem lacznie dla calego pociagu/ezt
|
{ // hamulcem lacznie dla calego pociagu/ezt
|
||||||
|
bool kier = (DirectionGet() * MoverParameters->ActiveCab > 0);
|
||||||
float FED = 0;
|
float FED = 0;
|
||||||
float np = 0;
|
float np = 0;
|
||||||
float masa = 0;
|
float masa = 0;
|
||||||
float FrED = 0;
|
float FrED = 0;
|
||||||
float masamax = 0;
|
float masamax = 0;
|
||||||
float FmaxPN = 0;
|
float FmaxPN = 0;
|
||||||
|
float FfulED = 0;
|
||||||
float FmaxED = 0;
|
float FmaxED = 0;
|
||||||
float Fzad = 0;
|
float Fzad = 0;
|
||||||
float FzadED = 0;
|
float FzadED = 0;
|
||||||
float FzadPN = 0;
|
float FzadPN = 0;
|
||||||
|
float Frj = 0;
|
||||||
float amax = 0;
|
float amax = 0;
|
||||||
|
float osie = 0;
|
||||||
// 1. ustal wymagana sile hamowania calego pociagu
|
// 1. ustal wymagana sile hamowania calego pociagu
|
||||||
// - opoznienie moze byc ustalane na podstawie charakterystyki
|
// - opoznienie moze byc ustalane na podstawie charakterystyki
|
||||||
// - opoznienie moze byc ustalane na podstawie mas i cisnien granicznych
|
// - opoznienie moze byc ustalane na podstawie mas i cisnien granicznych
|
||||||
@@ -2644,7 +2665,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// 2. ustal mozliwa do realizacji sile hamowania ED
|
// 2. ustal mozliwa do realizacji sile hamowania ED
|
||||||
// - w szczegolnosci powinien brac pod uwage rozne sily hamowania
|
// - w szczegolnosci powinien brac pod uwage rozne sily hamowania
|
||||||
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
p = p->NextC(4))
|
(kier ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
{
|
{
|
||||||
np++;
|
np++;
|
||||||
masamax += p->MoverParameters->MBPM +
|
masamax += p->MoverParameters->MBPM +
|
||||||
@@ -2655,27 +2676,63 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
p->MoverParameters->BrakeCylMult[0] -
|
p->MoverParameters->BrakeCylMult[0] -
|
||||||
p->MoverParameters->BrakeSlckAdj) *
|
p->MoverParameters->BrakeSlckAdj) *
|
||||||
p->MoverParameters->BrakeCylNo * p->MoverParameters->BrakeRigEff;
|
p->MoverParameters->BrakeCylNo * p->MoverParameters->BrakeRigEff;
|
||||||
FmaxPN += Nmax *
|
FmaxPN += Nmax * p->MoverParameters->Hamulec->GetFC(
|
||||||
p->MoverParameters->Hamulec->GetFC(
|
|
||||||
Nmax / (p->MoverParameters->NAxles * p->MoverParameters->NBpA),
|
Nmax / (p->MoverParameters->NAxles * p->MoverParameters->NBpA),
|
||||||
p->MoverParameters->Vmax) *
|
p->MoverParameters->Vmax) *
|
||||||
1000; // sila hamowania pn
|
1000; // sila hamowania pn
|
||||||
FmaxED += ((p->MoverParameters->Mains) && (p->MoverParameters->eimc[eimc_p_Fh] *
|
FmaxED += ((p->MoverParameters->Mains) && (p->MoverParameters->ActiveDir != 0) &&
|
||||||
p->MoverParameters->NPoweredAxles >
|
(p->MoverParameters->eimc[eimc_p_Fh] * p->MoverParameters->NPoweredAxles >
|
||||||
0) ?
|
0) ?
|
||||||
p->MoverParameters->eimc[eimc_p_Fh] * 1000 :
|
p->MoverParameters->eimc[eimc_p_Fh] * 1000 :
|
||||||
0); // chwilowy max ED -> do rozdzialu sil
|
0); // chwilowy max ED -> do rozdzialu sil
|
||||||
FED -= Min0R(p->MoverParameters->eimv[eimv_Fmax], 0) *
|
FED -= Min0R(p->MoverParameters->eimv[eimv_Fmax], 0) *
|
||||||
|
1000; // chwilowy max ED -> do rozdzialu sil
|
||||||
|
FfulED = Min0R(p->MoverParameters->eimv[eimv_Fful], 0) *
|
||||||
1000; // chwilowy max ED -> do rozdzialu sil
|
1000; // chwilowy max ED -> do rozdzialu sil
|
||||||
FrED -= Min0R(p->MoverParameters->eimv[eimv_Fr], 0) *
|
FrED -= Min0R(p->MoverParameters->eimv[eimv_Fr], 0) *
|
||||||
1000; // chwilowo realizowane ED -> do pneumatyki
|
1000; // chwilowo realizowane ED -> do pneumatyki
|
||||||
|
Frj += Max0R(p->MoverParameters->eimv[eimv_Fr], 0) *
|
||||||
|
1000;// chwilowo realizowany napęd -> do utrzymującego
|
||||||
masa += p->MoverParameters->TotalMass;
|
masa += p->MoverParameters->TotalMass;
|
||||||
|
osie += p->MoverParameters->NAxles;
|
||||||
}
|
}
|
||||||
amax = FmaxPN / masamax;
|
amax = FmaxPN / masamax;
|
||||||
|
if ((MoverParameters->Vel < 0.5) && (MoverParameters->BrakePress > 0.2) ||
|
||||||
|
(dDoorMoveL > 0.001) || (dDoorMoveR > 0.001))
|
||||||
|
{
|
||||||
|
MoverParameters->ShuntMode = true;
|
||||||
|
}
|
||||||
|
if (MoverParameters->ShuntMode)
|
||||||
|
{
|
||||||
|
MoverParameters->ShuntModeAllow = (dDoorMoveL < 0.001) && (dDoorMoveR < 0.001) &&
|
||||||
|
(MoverParameters->LocalBrakeRatio() < 0.01);
|
||||||
|
}
|
||||||
|
if ((MoverParameters->Vel > 1) && (dDoorMoveL < 0.001) && (dDoorMoveR < 0.001))
|
||||||
|
{
|
||||||
|
MoverParameters->ShuntMode = false;
|
||||||
|
MoverParameters->ShuntModeAllow = (MoverParameters->BrakePress > 0.2) &&
|
||||||
|
(MoverParameters->LocalBrakeRatio() < 0.01);
|
||||||
|
}
|
||||||
Fzad = amax * MoverParameters->LocalBrakeRatio() * masa;
|
Fzad = amax * MoverParameters->LocalBrakeRatio() * masa;
|
||||||
|
if ((MoverParameters->ScndS) &&
|
||||||
|
(MoverParameters->Vel > MoverParameters->eimc[eimc_p_Vh1]) && (FmaxED > 0))
|
||||||
|
{
|
||||||
|
Fzad = Min0R(MoverParameters->LocalBrakeRatio() * FmaxED, FfulED);
|
||||||
|
}
|
||||||
|
if (((MoverParameters->ShuntMode) && (Frj < 0.0015 * masa)) ||
|
||||||
|
(MoverParameters->V * MoverParameters->DirAbsolute < -0.2))
|
||||||
|
{
|
||||||
|
Fzad = Max0R(0.5 * masa, Fzad);
|
||||||
|
}
|
||||||
FzadED = Min0R(Fzad, FmaxED);
|
FzadED = Min0R(Fzad, FmaxED);
|
||||||
FzadPN = Fzad - FrED;
|
FzadPN = Fzad - FrED;
|
||||||
np = 0;
|
np = 0;
|
||||||
|
bool* PrzekrF = new bool[np];
|
||||||
|
float nPrzekrF = 0;
|
||||||
|
bool test = true;
|
||||||
|
float* FzED = new float[np];
|
||||||
|
float* FzEP = new float[np];
|
||||||
|
float* FmaxEP = new float[np];
|
||||||
// 3. ustaw pojazdom sile hamowania ED
|
// 3. ustaw pojazdom sile hamowania ED
|
||||||
// - proporcjonalnie do mozliwosci
|
// - proporcjonalnie do mozliwosci
|
||||||
|
|
||||||
@@ -2685,13 +2742,111 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// - gdy zahamowany ma ponizej 2 km/h
|
// - gdy zahamowany ma ponizej 2 km/h
|
||||||
// 6. ustaw pojazdom sile hamowania ep
|
// 6. ustaw pojazdom sile hamowania ep
|
||||||
// - proporcjonalnie do masy, do liczby osi, rowne cisnienia - jak
|
// - proporcjonalnie do masy, do liczby osi, rowne cisnienia - jak
|
||||||
// bedzie, tak bedzie
|
// bedzie, tak bedzie dobrze
|
||||||
// dobrze
|
float Fpoj = 0; // MoverParameters->ActiveCab < 0
|
||||||
float Fpoj = 0;
|
////ALGORYTM 2 - KAZDEMU PO ROWNO, ale nie wiecej niz eped * masa
|
||||||
|
// 1. najpierw daj kazdemu tyle samo
|
||||||
|
int i = 0;
|
||||||
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
p = p->NextC(4))
|
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
{
|
{
|
||||||
np++;
|
np++;
|
||||||
|
float Nmax = ((p->MoverParameters->P2FTrans * p->MoverParameters->MaxBrakePress[0] -
|
||||||
|
p->MoverParameters->BrakeCylSpring) *
|
||||||
|
p->MoverParameters->BrakeCylMult[0] -
|
||||||
|
p->MoverParameters->BrakeSlckAdj) *
|
||||||
|
p->MoverParameters->BrakeCylNo * p->MoverParameters->BrakeRigEff;
|
||||||
|
FmaxEP[i] = Nmax *
|
||||||
|
p->MoverParameters->Hamulec->GetFC(
|
||||||
|
Nmax / (p->MoverParameters->NAxles * p->MoverParameters->NBpA),
|
||||||
|
p->MoverParameters->Vmax) *
|
||||||
|
1000; // sila hamowania pn
|
||||||
|
|
||||||
|
PrzekrF[i] = false;
|
||||||
|
FzED[i] = (FmaxED > 0 ? FzadED / FmaxED : 0);
|
||||||
|
p->MoverParameters->AnPos =
|
||||||
|
(MoverParameters->ScndS ? MoverParameters->LocalBrakeRatio() : FzED[i]);
|
||||||
|
FzEP[i] = FzadPN * p->MoverParameters->NAxles / osie;
|
||||||
|
i++;
|
||||||
|
p->MoverParameters->ShuntMode = MoverParameters->ShuntMode;
|
||||||
|
p->MoverParameters->ShuntModeAllow = MoverParameters->ShuntModeAllow;
|
||||||
|
}
|
||||||
|
while (test)
|
||||||
|
{
|
||||||
|
test = false;
|
||||||
|
i = 0;
|
||||||
|
float przek = 0;
|
||||||
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
|
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
|
{
|
||||||
|
if ((FzEP[i] > 0.01) &&
|
||||||
|
(FzEP[i] >
|
||||||
|
p->MoverParameters->TotalMass * p->MoverParameters->eimc[eimc_p_eped] +
|
||||||
|
Min0R(p->MoverParameters->eimv[eimv_Fr], 0) * 1000) &&
|
||||||
|
(!PrzekrF[i]))
|
||||||
|
{
|
||||||
|
float przek1 = -Min0R(p->MoverParameters->eimv[eimv_Fr], 0) * 1000 +
|
||||||
|
FzEP[i] -
|
||||||
|
p->MoverParameters->TotalMass *
|
||||||
|
p->MoverParameters->eimc[eimc_p_eped] * 0.999;
|
||||||
|
PrzekrF[i] = true;
|
||||||
|
test = true;
|
||||||
|
nPrzekrF++;
|
||||||
|
przek1 = Min0R(przek1, FzEP[i]);
|
||||||
|
FzEP[i] -= przek1;
|
||||||
|
if (FzEP[i] < 0)
|
||||||
|
FzEP[i] = 0;
|
||||||
|
przek += przek1;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
przek = przek / (np - nPrzekrF);
|
||||||
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
|
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
|
{
|
||||||
|
if (!PrzekrF[i])
|
||||||
|
{
|
||||||
|
FzEP[i] += przek;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
|
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
|
{
|
||||||
|
float Nmax = ((p->MoverParameters->P2FTrans * p->MoverParameters->MaxBrakePress[0] -
|
||||||
|
p->MoverParameters->BrakeCylSpring) *
|
||||||
|
p->MoverParameters->BrakeCylMult[0] -
|
||||||
|
p->MoverParameters->BrakeSlckAdj) *
|
||||||
|
p->MoverParameters->BrakeCylNo * p->MoverParameters->BrakeRigEff;
|
||||||
|
float FmaxPoj = Nmax *
|
||||||
|
p->MoverParameters->Hamulec->GetFC(
|
||||||
|
Nmax / (p->MoverParameters->NAxles * p->MoverParameters->NBpA),
|
||||||
|
p->MoverParameters->Vel) *
|
||||||
|
1000; // sila hamowania pn
|
||||||
|
p->MoverParameters->LocalBrakePosA = (p->MoverParameters->SlippingWheels ? 0 : FzEP[i] / FmaxPoj);
|
||||||
|
if (p->MoverParameters->LocalBrakePosA>0.009)
|
||||||
|
if (p->MoverParameters->P2FTrans * p->MoverParameters->BrakeCylMult[0] *
|
||||||
|
p->MoverParameters->MaxBrakePress[0] != 0)
|
||||||
|
{
|
||||||
|
float x = (p->MoverParameters->BrakeSlckAdj / p->MoverParameters->BrakeCylMult[0] +
|
||||||
|
p->MoverParameters->BrakeCylSpring) / (p->MoverParameters->P2FTrans *
|
||||||
|
p->MoverParameters->MaxBrakePress[0]);
|
||||||
|
p->MoverParameters->LocalBrakePosA = x + (1 - x) * p->MoverParameters->LocalBrakePosA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p->MoverParameters->LocalBrakePosA = p->MoverParameters->LocalBrakePosA;
|
||||||
|
else
|
||||||
|
p->MoverParameters->LocalBrakePosA = 0;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
/* ////ALGORYTM 1 - KAZDEMU PO ROWNO
|
||||||
|
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0); p;
|
||||||
|
(iDirection > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||||
|
{
|
||||||
|
|
||||||
float Nmax = ((p->MoverParameters->P2FTrans * p->MoverParameters->MaxBrakePress[0] -
|
float Nmax = ((p->MoverParameters->P2FTrans * p->MoverParameters->MaxBrakePress[0] -
|
||||||
p->MoverParameters->BrakeCylSpring) *
|
p->MoverParameters->BrakeCylSpring) *
|
||||||
p->MoverParameters->BrakeCylMult[0] -
|
p->MoverParameters->BrakeCylMult[0] -
|
||||||
@@ -2705,10 +2860,24 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// Fpoj=(FED>0?-FzadED*p->MoverParameters->eimv[eimv_Fmax]*1000/FED:0);
|
// Fpoj=(FED>0?-FzadED*p->MoverParameters->eimv[eimv_Fmax]*1000/FED:0);
|
||||||
// p->MoverParameters->AnPos=(p->MoverParameters->eimc[eimc_p_Fh]>1?0.001f*Fpoj/(p->MoverParameters->eimc[eimc_p_Fh]):0);
|
// p->MoverParameters->AnPos=(p->MoverParameters->eimc[eimc_p_Fh]>1?0.001f*Fpoj/(p->MoverParameters->eimc[eimc_p_Fh]):0);
|
||||||
p->MoverParameters->AnPos = (FmaxED > 0 ? FzadED / FmaxED : 0);
|
p->MoverParameters->AnPos = (FmaxED > 0 ? FzadED / FmaxED : 0);
|
||||||
Fpoj = FzadPN * Min0R(p->MoverParameters->TotalMass / masa, 1);
|
// Fpoj = FzadPN * Min0R(p->MoverParameters->TotalMass / masa, 1);
|
||||||
p->MoverParameters->LocalBrakePosA =
|
// p->MoverParameters->LocalBrakePosA =
|
||||||
(p->MoverParameters->SlippingWheels ? 0 : Min0R(Max0R(Fpoj / FmaxPoj, 0), 1));
|
// (p->MoverParameters->SlippingWheels ? 0 : Min0R(Max0R(Fpoj / FmaxPoj, 0), 1));
|
||||||
}
|
p->MoverParameters->LocalBrakePosA = (p->MoverParameters->SlippingWheels ? 0 : FzadPN / FmaxPN);
|
||||||
|
} */
|
||||||
|
|
||||||
|
MED[0][0] = masa*0.001;
|
||||||
|
MED[0][1] = amax;
|
||||||
|
MED[0][2] = Fzad*0.001;
|
||||||
|
MED[0][3] = FmaxPN*0.001;
|
||||||
|
MED[0][4] = FmaxED*0.001;
|
||||||
|
MED[0][5] = FrED*0.001;
|
||||||
|
MED[0][6] = FzadPN*0.001;
|
||||||
|
MED[0][7] = nPrzekrF;
|
||||||
|
|
||||||
|
delete[] PrzekrF;
|
||||||
|
delete[] FzED;
|
||||||
|
delete[] FzEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
// yB: cos (AI) tu jest nie kompatybilne z czyms (hamulce)
|
// yB: cos (AI) tu jest nie kompatybilne z czyms (hamulce)
|
||||||
@@ -2923,7 +3092,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
TAnimPant *p; // wskaźnik do obiektu danych pantografu
|
TAnimPant *p; // wskaźnik do obiektu danych pantografu
|
||||||
double fCurrent = (MoverParameters->DynamicBrakeFlag && MoverParameters->ResistorsFlag ?
|
double fCurrent = (MoverParameters->DynamicBrakeFlag && MoverParameters->ResistorsFlag ?
|
||||||
0 :
|
0 :
|
||||||
fabs(MoverParameters->Itot)) +
|
MoverParameters->Itot) +
|
||||||
MoverParameters->TotalCurrent; // prąd pobierany przez pojazd - bez
|
MoverParameters->TotalCurrent; // prąd pobierany przez pojazd - bez
|
||||||
// sensu z tym (TotalCurrent)
|
// sensu z tym (TotalCurrent)
|
||||||
// TotalCurrent to bedzie prad nietrakcyjny (niezwiazany z napedem)
|
// TotalCurrent to bedzie prad nietrakcyjny (niezwiazany z napedem)
|
||||||
@@ -4788,6 +4957,9 @@ void TDynamicObject::LoadMMediaFile(AnsiString BaseDir, AnsiString TypeName,
|
|||||||
case 3:
|
case 3:
|
||||||
pAnimations[i + j].yUpdate = UpdateDoorFold;
|
pAnimations[i + j].yUpdate = UpdateDoorFold;
|
||||||
break; // obrót 3 kolejnych submodeli
|
break; // obrót 3 kolejnych submodeli
|
||||||
|
case 4:
|
||||||
|
pAnimations[i + j].yUpdate = UpdateDoorPlug;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
pAnimations[i + j].iNumber =
|
pAnimations[i + j].iNumber =
|
||||||
i; // parzyste działają inaczej niż nieparzyste
|
i; // parzyste działają inaczej niż nieparzyste
|
||||||
@@ -5064,11 +5236,83 @@ void TDynamicObject::LoadMMediaFile(AnsiString BaseDir, AnsiString TypeName,
|
|||||||
void TDynamicObject::RadioStop()
|
void TDynamicObject::RadioStop()
|
||||||
{ // zatrzymanie pojazdu
|
{ // zatrzymanie pojazdu
|
||||||
if (Mechanik) // o ile ktoś go prowadzi
|
if (Mechanik) // o ile ktoś go prowadzi
|
||||||
if (MoverParameters->SecuritySystem.RadioStop) // jeśli pojazd ma RadioStop i jest on
|
if (MoverParameters->SecuritySystem.RadioStop &&
|
||||||
// aktywny
|
MoverParameters->Radio) // jeśli pojazd ma RadioStop i jest on aktywny
|
||||||
Mechanik->PutCommand("Emergency_brake", 1.0, 1.0, &vPosition, stopRadio);
|
Mechanik->PutCommand("Emergency_brake", 1.0, 1.0, &vPosition, stopRadio);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
void TDynamicObject::Damage(char flag)
|
||||||
|
{
|
||||||
|
if (flag & 1) //różnicówka nie robi nic
|
||||||
|
{
|
||||||
|
MoverParameters->MainSwitch(false);
|
||||||
|
MoverParameters->FuseOff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & 2) //usterka sterowania
|
||||||
|
{
|
||||||
|
MoverParameters->StLinFlag = false;
|
||||||
|
if (MoverParameters->InitialCtrlDelay<100000000)
|
||||||
|
MoverParameters->InitialCtrlDelay += 100000001;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MoverParameters->InitialCtrlDelay>100000000)
|
||||||
|
MoverParameters->InitialCtrlDelay -= 100000001;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & 4) //blokada przetwornicy
|
||||||
|
{
|
||||||
|
MoverParameters->ConvOvldFlag = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & 8) //blokada sprezarki
|
||||||
|
{
|
||||||
|
if (MoverParameters->MinCompressor>0)
|
||||||
|
MoverParameters->MinCompressor -= 100000001;
|
||||||
|
if (MoverParameters->MaxCompressor>0)
|
||||||
|
MoverParameters->MaxCompressor -= 100000001;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MoverParameters->MinCompressor<0)
|
||||||
|
MoverParameters->MinCompressor += 100000001;
|
||||||
|
if (MoverParameters->MaxCompressor<0)
|
||||||
|
MoverParameters->MaxCompressor += 100000001;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & 16) //blokada wału
|
||||||
|
{
|
||||||
|
if (MoverParameters->CtrlDelay<100000000)
|
||||||
|
MoverParameters->CtrlDelay += 100000001;
|
||||||
|
if (MoverParameters->CtrlDownDelay<100000000)
|
||||||
|
MoverParameters->CtrlDownDelay += 100000001;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MoverParameters->CtrlDelay>100000000)
|
||||||
|
MoverParameters->CtrlDelay -= 100000001;
|
||||||
|
if (MoverParameters->CtrlDownDelay>100000000)
|
||||||
|
MoverParameters->CtrlDownDelay -= 100000001;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & 32) //hamowanie nagŁe
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MoverParameters->EngDmgFlag = flag;
|
||||||
|
};
|
||||||
|
|
||||||
void TDynamicObject::RaLightsSet(int head, int rear)
|
void TDynamicObject::RaLightsSet(int head, int rear)
|
||||||
{ // zapalenie świateł z przodu i z
|
{ // zapalenie świateł z przodu i z
|
||||||
// tyłu, zależne od kierunku
|
// tyłu, zależne od kierunku
|
||||||
@@ -5132,24 +5376,30 @@ int TDynamicObject::DirectionSet(int d)
|
|||||||
// następnego
|
// następnego
|
||||||
};
|
};
|
||||||
|
|
||||||
TDynamicObject *__fastcall TDynamicObject::PrevAny()
|
TDynamicObject * TDynamicObject::PrevAny()
|
||||||
{ // wskaźnik na poprzedni,
|
{ // wskaźnik na poprzedni,
|
||||||
// nawet wirtualny
|
// nawet wirtualny
|
||||||
return iDirection ? PrevConnected : NextConnected;
|
return iDirection ? PrevConnected : NextConnected;
|
||||||
};
|
};
|
||||||
TDynamicObject *__fastcall TDynamicObject::Prev()
|
TDynamicObject * TDynamicObject::Prev()
|
||||||
{
|
{
|
||||||
if (MoverParameters->Couplers[iDirection ^ 1].CouplingFlag)
|
if (MoverParameters->Couplers[iDirection ^ 1].CouplingFlag)
|
||||||
return iDirection ? PrevConnected : NextConnected;
|
return iDirection ? PrevConnected : NextConnected;
|
||||||
return NULL; // gdy sprzęg wirtualny, to jakby nic nie było
|
return NULL; // gdy sprzęg wirtualny, to jakby nic nie było
|
||||||
};
|
};
|
||||||
TDynamicObject *__fastcall TDynamicObject::Next()
|
TDynamicObject * TDynamicObject::Next()
|
||||||
{
|
{
|
||||||
if (MoverParameters->Couplers[iDirection].CouplingFlag)
|
if (MoverParameters->Couplers[iDirection].CouplingFlag)
|
||||||
return iDirection ? NextConnected : PrevConnected;
|
return iDirection ? NextConnected : PrevConnected;
|
||||||
return NULL; // gdy sprzęg wirtualny, to jakby nic nie było
|
return NULL; // gdy sprzęg wirtualny, to jakby nic nie było
|
||||||
};
|
};
|
||||||
TDynamicObject *__fastcall TDynamicObject::NextC(int C)
|
TDynamicObject * TDynamicObject::PrevC(int C)
|
||||||
|
{
|
||||||
|
if (MoverParameters->Couplers[iDirection ^ 1].CouplingFlag & C)
|
||||||
|
return iDirection ? PrevConnected : NextConnected;
|
||||||
|
return NULL; // gdy sprzęg wirtualny, to jakby nic nie było
|
||||||
|
};
|
||||||
|
TDynamicObject * TDynamicObject::NextC(int C)
|
||||||
{
|
{
|
||||||
if (MoverParameters->Couplers[iDirection].CouplingFlag & C)
|
if (MoverParameters->Couplers[iDirection].CouplingFlag & C)
|
||||||
return iDirection ? NextConnected : PrevConnected;
|
return iDirection ? NextConnected : PrevConnected;
|
||||||
@@ -5167,7 +5417,7 @@ double TDynamicObject::NextDistance(double d)
|
|||||||
return d;
|
return d;
|
||||||
};
|
};
|
||||||
|
|
||||||
TDynamicObject *__fastcall TDynamicObject::Neightbour(int &dir)
|
TDynamicObject * TDynamicObject::Neightbour(int &dir)
|
||||||
{ // ustalenie następnego (1) albo poprzedniego (0) w składzie bez
|
{ // ustalenie następnego (1) albo poprzedniego (0) w składzie bez
|
||||||
// względu na prawidłowość
|
// względu na prawidłowość
|
||||||
// iDirection
|
// iDirection
|
||||||
@@ -5242,7 +5492,7 @@ void TDynamicObject::CoupleDist()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TDynamicObject *__fastcall TDynamicObject::ControlledFind()
|
TDynamicObject * TDynamicObject::ControlledFind()
|
||||||
{ // taka proteza:
|
{ // taka proteza:
|
||||||
// chcę podłączyć
|
// chcę podłączyć
|
||||||
// kabinę EN57
|
// kabinę EN57
|
||||||
|
|||||||
32
DynObj.h
32
DynObj.h
@@ -157,7 +157,7 @@ class TDynamicObject
|
|||||||
float fAxleDist; // rozstaw wózków albo osi do liczenia proporcji zacienienia
|
float fAxleDist; // rozstaw wózków albo osi do liczenia proporcji zacienienia
|
||||||
vector3 modelRot; // obrot pudła względem świata - do przeanalizowania, czy potrzebne!!!
|
vector3 modelRot; // obrot pudła względem świata - do przeanalizowania, czy potrzebne!!!
|
||||||
// bool bCameraNear; //blisko kamer są potrzebne dodatkowe obliczenia szczegółów
|
// bool bCameraNear; //blisko kamer są potrzebne dodatkowe obliczenia szczegółów
|
||||||
TDynamicObject *__fastcall ABuFindNearestObject(TTrack *Track, TDynamicObject *MyPointer,
|
TDynamicObject * ABuFindNearestObject(TTrack *Track, TDynamicObject *MyPointer,
|
||||||
int &CouplNr);
|
int &CouplNr);
|
||||||
|
|
||||||
public: // parametry położenia pojazdu dostępne publicznie
|
public: // parametry położenia pojazdu dostępne publicznie
|
||||||
@@ -197,6 +197,7 @@ class TDynamicObject
|
|||||||
void UpdateDoorTranslate(TAnim *pAnim); // animacja drzwi - przesuw
|
void UpdateDoorTranslate(TAnim *pAnim); // animacja drzwi - przesuw
|
||||||
void UpdateDoorRotate(TAnim *pAnim); // animacja drzwi - obrót
|
void UpdateDoorRotate(TAnim *pAnim); // animacja drzwi - obrót
|
||||||
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
|
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
|
||||||
|
void UpdateDoorPlug(TAnim *pAnim); // animacja drzwi - odskokowo-przesuwne
|
||||||
void UpdatePant(TAnim *pAnim); // animacja pantografu
|
void UpdatePant(TAnim *pAnim); // animacja pantografu
|
||||||
void UpdateLeverDouble(TAnim *pAnim); // animacja gałki zależna od double
|
void UpdateLeverDouble(TAnim *pAnim); // animacja gałki zależna od double
|
||||||
void UpdateLeverFloat(TAnim *pAnim); // animacja gałki zależna od float
|
void UpdateLeverFloat(TAnim *pAnim); // animacja gałki zależna od float
|
||||||
@@ -325,7 +326,7 @@ class TDynamicObject
|
|||||||
void ABuScanObjects(int ScanDir, double ScanDist);
|
void ABuScanObjects(int ScanDir, double ScanDist);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TDynamicObject *__fastcall ABuFindObject(TTrack *Track, int ScanDir, Byte &CouplFound,
|
TDynamicObject * ABuFindObject(TTrack *Track, int ScanDir, Byte &CouplFound,
|
||||||
double &dist);
|
double &dist);
|
||||||
void ABuCheckMyTrack();
|
void ABuCheckMyTrack();
|
||||||
|
|
||||||
@@ -333,10 +334,11 @@ class TDynamicObject
|
|||||||
int *iLights; // wskaźnik na bity zapalonych świateł (własne albo innego członu)
|
int *iLights; // wskaźnik na bity zapalonych świateł (własne albo innego członu)
|
||||||
double fTrackBlock; // odległość do przeszkody do dalszego ruchu (wykrywanie kolizji z innym
|
double fTrackBlock; // odległość do przeszkody do dalszego ruchu (wykrywanie kolizji z innym
|
||||||
// pojazdem)
|
// pojazdem)
|
||||||
TDynamicObject *__fastcall PrevAny();
|
TDynamicObject * PrevAny();
|
||||||
TDynamicObject *__fastcall Prev();
|
TDynamicObject * Prev();
|
||||||
TDynamicObject *__fastcall Next();
|
TDynamicObject * Next();
|
||||||
TDynamicObject *__fastcall NextC(int C);
|
TDynamicObject * PrevC(int C);
|
||||||
|
TDynamicObject * NextC(int C);
|
||||||
double NextDistance(double d = -1.0);
|
double NextDistance(double d = -1.0);
|
||||||
void SetdMoveLen(double dMoveLen)
|
void SetdMoveLen(double dMoveLen)
|
||||||
{
|
{
|
||||||
@@ -367,9 +369,9 @@ class TDynamicObject
|
|||||||
// float EmR;
|
// float EmR;
|
||||||
// vector3 smokeoffset;
|
// vector3 smokeoffset;
|
||||||
|
|
||||||
TDynamicObject *__fastcall ABuScanNearestObject(TTrack *Track, double ScanDir, double ScanDist,
|
TDynamicObject * ABuScanNearestObject(TTrack *Track, double ScanDir, double ScanDist,
|
||||||
int &CouplNr);
|
int &CouplNr);
|
||||||
TDynamicObject *__fastcall GetFirstDynamic(int cpl_type);
|
TDynamicObject * GetFirstDynamic(int cpl_type);
|
||||||
// TDynamicObject* GetFirstCabDynamic(int cpl_type);
|
// TDynamicObject* GetFirstCabDynamic(int cpl_type);
|
||||||
void ABuSetModelShake(vector3 mShake);
|
void ABuSetModelShake(vector3 mShake);
|
||||||
|
|
||||||
@@ -435,7 +437,7 @@ class TDynamicObject
|
|||||||
{
|
{
|
||||||
return vLeft;
|
return vLeft;
|
||||||
};
|
};
|
||||||
inline double *__fastcall Matrix()
|
inline double * Matrix()
|
||||||
{
|
{
|
||||||
return mMatrix.getArray();
|
return mMatrix.getArray();
|
||||||
};
|
};
|
||||||
@@ -451,7 +453,7 @@ class TDynamicObject
|
|||||||
{
|
{
|
||||||
return MoverParameters->Dim.W;
|
return MoverParameters->Dim.W;
|
||||||
};
|
};
|
||||||
inline TTrack *__fastcall GetTrack()
|
inline TTrack * GetTrack()
|
||||||
{
|
{
|
||||||
return (iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack());
|
return (iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack());
|
||||||
};
|
};
|
||||||
@@ -476,15 +478,16 @@ class TDynamicObject
|
|||||||
{ // zwraca przesunięcie wózka względem Point1 toru z aktywną osią
|
{ // zwraca przesunięcie wózka względem Point1 toru z aktywną osią
|
||||||
return iAxleFirst ? Axle1.GetTranslation() : Axle0.GetTranslation();
|
return iAxleFirst ? Axle1.GetTranslation() : Axle0.GetTranslation();
|
||||||
};
|
};
|
||||||
inline TTrack *__fastcall RaTrackGet()
|
inline TTrack * RaTrackGet()
|
||||||
{ // zwraca tor z aktywną osią
|
{ // zwraca tor z aktywną osią
|
||||||
return iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack();
|
return iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack();
|
||||||
};
|
};
|
||||||
void CouplersDettach(double MinDist, int MyScanDir);
|
void CouplersDettach(double MinDist, int MyScanDir);
|
||||||
void RadioStop();
|
void RadioStop();
|
||||||
|
void Damage(char flag);
|
||||||
void RaLightsSet(int head, int rear);
|
void RaLightsSet(int head, int rear);
|
||||||
// void RaAxleEvent(TEvent *e);
|
// void RaAxleEvent(TEvent *e);
|
||||||
TDynamicObject *__fastcall FirstFind(int &coupler_nr);
|
TDynamicObject * FirstFind(int &coupler_nr);
|
||||||
float GetEPP(); // wyliczanie sredniego cisnienia w PG
|
float GetEPP(); // wyliczanie sredniego cisnienia w PG
|
||||||
int DirectionSet(int d); // ustawienie kierunku w składzie
|
int DirectionSet(int d); // ustawienie kierunku w składzie
|
||||||
int DirectionGet()
|
int DirectionGet()
|
||||||
@@ -493,15 +496,16 @@ class TDynamicObject
|
|||||||
}; // odczyt kierunku w składzie
|
}; // odczyt kierunku w składzie
|
||||||
int DettachStatus(int dir);
|
int DettachStatus(int dir);
|
||||||
int Dettach(int dir);
|
int Dettach(int dir);
|
||||||
TDynamicObject *__fastcall Neightbour(int &dir);
|
TDynamicObject * Neightbour(int &dir);
|
||||||
void CoupleDist();
|
void CoupleDist();
|
||||||
TDynamicObject *__fastcall ControlledFind();
|
TDynamicObject * ControlledFind();
|
||||||
void ParamSet(int what, int into);
|
void ParamSet(int what, int into);
|
||||||
int RouteWish(TTrack *tr); // zapytanie do AI, po którym segmencie skrzyżowania
|
int RouteWish(TTrack *tr); // zapytanie do AI, po którym segmencie skrzyżowania
|
||||||
// jechać
|
// jechać
|
||||||
void DestinationSet(AnsiString to);
|
void DestinationSet(AnsiString to);
|
||||||
AnsiString TextureTest(AnsiString &name);
|
AnsiString TextureTest(AnsiString &name);
|
||||||
void OverheadTrack(float o);
|
void OverheadTrack(float o);
|
||||||
|
double MED[9][8]; // lista zmiennych do debugowania hamulca ED
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
48
EU07.bpr
48
EU07.bpr
@@ -5,15 +5,16 @@
|
|||||||
<VERSION value="BCB.05.03"/>
|
<VERSION value="BCB.05.03"/>
|
||||||
<PROJECT value="E:\Gry\MaSzyna_15_04\EU07.exe"/>
|
<PROJECT value="E:\Gry\MaSzyna_15_04\EU07.exe"/>
|
||||||
<OBJFILES value="QueryParserComp.obj McZapkie\mtable.obj McZapkie\_mover.obj
|
<OBJFILES value="QueryParserComp.obj McZapkie\mtable.obj McZapkie\_mover.obj
|
||||||
McZapkie\hamulce.obj EU07.obj dumb3d.obj Camera.obj Texture.obj World.obj
|
McZapkie\hamulce.obj McZapkie\Oerlikon_ESt.obj EU07.obj dumb3d.obj
|
||||||
Model3d.obj MdlMngr.obj Train.obj wavread.obj Timer.obj Event.obj
|
Camera.obj Texture.obj World.obj Model3d.obj MdlMngr.obj Train.obj
|
||||||
MemCell.obj Logs.obj Spring.obj Button.obj Globals.obj Gauge.obj
|
wavread.obj Timer.obj Event.obj MemCell.obj Logs.obj Spring.obj Button.obj
|
||||||
AnimModel.obj Ground.obj TrkFoll.obj Segment.obj Sound.obj AdvSound.obj
|
Globals.obj Gauge.obj AnimModel.obj Ground.obj TrkFoll.obj Segment.obj
|
||||||
Track.obj DynObj.obj RealSound.obj EvLaunch.obj FadeSound.obj Traction.obj
|
Sound.obj AdvSound.obj Track.obj DynObj.obj RealSound.obj EvLaunch.obj
|
||||||
TractionPower.obj parser.obj sky.obj AirCoupler.obj opengl\glew.obj
|
FadeSound.obj Traction.obj TractionPower.obj parser.obj sky.obj
|
||||||
ResourceManager.obj VBO.obj TextureDDS.obj opengl\ARB_Multisample.obj
|
AirCoupler.obj opengl\glew.obj ResourceManager.obj VBO.obj TextureDDS.obj
|
||||||
Float3d.obj Classes.obj Driver.obj Names.obj Console.obj Mover.obj
|
opengl\ARB_Multisample.obj Float3d.obj Classes.obj Driver.obj Names.obj
|
||||||
Console\PoKeys55.obj Forth.obj Console\LPT.obj PyInt.obj"/>
|
Console.obj Mover.obj Console\PoKeys55.obj Forth.obj Console\LPT.obj
|
||||||
|
PyInt.obj"/>
|
||||||
<RESFILES value="EU07.res"/>
|
<RESFILES value="EU07.res"/>
|
||||||
<IDLFILES value=""/>
|
<IDLFILES value=""/>
|
||||||
<IDLGENFILES value=""/>
|
<IDLGENFILES value=""/>
|
||||||
@@ -38,10 +39,10 @@
|
|||||||
<WARNINGS value="-w-par"/>
|
<WARNINGS value="-w-par"/>
|
||||||
</MACROS>
|
</MACROS>
|
||||||
<OPTIONS>
|
<OPTIONS>
|
||||||
<IDLCFLAGS value="-IConsole -Iopengl -IMcZapkie -I$(BCB)\include -I$(BCB)\include\vcl
|
<IDLCFLAGS value="-src_suffix cpp -DGLEW_STATIC -D_DEBUG -IConsole -Iopengl -IMcZapkie
|
||||||
-src_suffix cpp -DGLEW_STATIC -D_DEBUG -boa"/>
|
-I$(BCB)\include -I$(BCB)\include\vcl -Ipython\include -boa"/>
|
||||||
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a1 -6 -b- -k -y -v -vi-
|
<CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -w- -Vx -Ve -X- -r- -a1 -6 -b- -k -y -v
|
||||||
-c -tW -tWM"/>
|
-vi- -c -tW -tWM"/>
|
||||||
<PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
|
<PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
|
||||||
<RFLAGS value=""/>
|
<RFLAGS value=""/>
|
||||||
<AFLAGS value="/mx /w2 /zi"/>
|
<AFLAGS value="/mx /w2 /zi"/>
|
||||||
@@ -59,7 +60,7 @@ AutoIncBuild=0
|
|||||||
MajorVer=15
|
MajorVer=15
|
||||||
MinorVer=4
|
MinorVer=4
|
||||||
Release=1171
|
Release=1171
|
||||||
Build=474
|
Build=475
|
||||||
Debug=1
|
Debug=1
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
@@ -71,7 +72,7 @@ CodePage=1250
|
|||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=EU07 Team
|
CompanyName=EU07 Team
|
||||||
FileDescription=MaSzyna EU07-424
|
FileDescription=MaSzyna EU07-424
|
||||||
FileVersion=15.4.1171.474
|
FileVersion=15.4.1171.475
|
||||||
InternalName=9th by firleju + Ra + SPKS + MP
|
InternalName=9th by firleju + Ra + SPKS + MP
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
@@ -98,25 +99,26 @@ Item1=$(BCB)\source\vcl
|
|||||||
[HistoryLists\hlConditionals]
|
[HistoryLists\hlConditionals]
|
||||||
Count=8
|
Count=8
|
||||||
Item0=GLEW_STATIC;_DEBUG
|
Item0=GLEW_STATIC;_DEBUG
|
||||||
Item1=GLEW_STATIC;_DEBUG;USE_VBO
|
Item1=GLEW_STATIC
|
||||||
Item2=GLEW_STATIC;_DEBUG;_USE_OLD_RW_STL
|
Item2=GLEW_STATIC;_DEBUG;USE_VBO
|
||||||
Item3=GLEW_STATIC
|
Item3=GLEW_STATIC;_DEBUG;_USE_OLD_RW_STL
|
||||||
Item4=GLEW_STATIC;USE_VERTEX_ARRAYS;_DEBUG
|
Item4=GLEW_STATIC;USE_VERTEX_ARRAYS;_DEBUG
|
||||||
Item5=GLEW_STATIC;USE_VERTEX_ARRAYS
|
Item5=GLEW_STATIC;USE_VERTEX_ARRAYS
|
||||||
Item6=GLEW_STATIC;_DEBUG;USE_VERTEX_ARRAYS
|
Item6=GLEW_STATIC;_DEBUG;USE_VERTEX_ARRAYS
|
||||||
Item7=_DEBUG
|
Item7=_DEBUG
|
||||||
|
|
||||||
[HistoryLists\hlFinalOutputDir]
|
[HistoryLists\hlFinalOutputDir]
|
||||||
Count=3
|
Count=4
|
||||||
Item0=E:\Gry\MaSzyna_15_04
|
Item0=E:\Gry\MaSzyna_15_04\
|
||||||
Item1=D:\EU07\
|
Item1=E:\Gry\MaSzyna_15_04
|
||||||
Item2=E:\EU07\
|
Item2=D:\EU07\
|
||||||
|
Item3=E:\EU07\
|
||||||
|
|
||||||
[Debugging]
|
[Debugging]
|
||||||
DebugSourceDirs=McZapkie\
|
DebugSourceDirs=McZapkie\
|
||||||
|
|
||||||
[Parameters]
|
[Parameters]
|
||||||
RunParams=
|
RunParams=-s $.scn -v EN57AKL-1ra
|
||||||
HostApplication=
|
HostApplication=
|
||||||
RemoteHost=
|
RemoteHost=
|
||||||
RemotePath=
|
RemotePath=
|
||||||
|
|||||||
1
EU07.cpp
1
EU07.cpp
@@ -78,6 +78,7 @@ USEUNIT("Console.cpp");
|
|||||||
USEUNIT("Mover.cpp");
|
USEUNIT("Mover.cpp");
|
||||||
USEUNIT("McZapkie\_mover.pas");
|
USEUNIT("McZapkie\_mover.pas");
|
||||||
USEUNIT("McZapkie\hamulce.pas");
|
USEUNIT("McZapkie\hamulce.pas");
|
||||||
|
USEUNIT("McZapkie\Oerlikon_ESt.pas");
|
||||||
USEUNIT("Console\PoKeys55.cpp");
|
USEUNIT("Console\PoKeys55.cpp");
|
||||||
USEUNIT("Forth.cpp");
|
USEUNIT("Forth.cpp");
|
||||||
USEUNIT("Console\LPT.cpp");
|
USEUNIT("Console\LPT.cpp");
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ vector3 Global::pFreeCameraInit[10];
|
|||||||
vector3 Global::pFreeCameraInitAngle[10];
|
vector3 Global::pFreeCameraInitAngle[10];
|
||||||
double Global::fFogStart = 1700;
|
double Global::fFogStart = 1700;
|
||||||
double Global::fFogEnd = 2000;
|
double Global::fFogEnd = 2000;
|
||||||
|
float Global::Background[3] = { 0.2, 0.4, 0.33 };
|
||||||
GLfloat Global::AtmoColor[] = {0.423f, 0.702f, 1.0f};
|
GLfloat Global::AtmoColor[] = {0.423f, 0.702f, 1.0f};
|
||||||
GLfloat Global::FogColor[] = {0.6f, 0.7f, 0.8f};
|
GLfloat Global::FogColor[] = {0.6f, 0.7f, 0.8f};
|
||||||
GLfloat Global::ambientDayLight[] = {0.40f, 0.40f, 0.45f, 1.0f}; // robocze
|
GLfloat Global::ambientDayLight[] = {0.40f, 0.40f, 0.45f, 1.0f}; // robocze
|
||||||
@@ -469,6 +470,12 @@ void Global::ConfigParse(TQueryParserComp *qp, cParser *cp)
|
|||||||
// renderer
|
// renderer
|
||||||
TPythonInterpreter::getInstance()->setScreenRendererPriority(
|
TPythonInterpreter::getInstance()->setScreenRendererPriority(
|
||||||
GetNextSymbol().LowerCase().c_str());
|
GetNextSymbol().LowerCase().c_str());
|
||||||
|
else if (str == AnsiString("background"))
|
||||||
|
{
|
||||||
|
Background[0] = GetNextSymbol().ToDouble(); // r
|
||||||
|
Background[1] = GetNextSymbol().ToDouble(); // g
|
||||||
|
Background[2] = GetNextSymbol().ToDouble(); // b
|
||||||
|
}
|
||||||
} while (str != "endconfig"); //(!Parser->EndOfFile)
|
} while (str != "endconfig"); //(!Parser->EndOfFile)
|
||||||
// na koniec trochê zale¿noœci
|
// na koniec trochê zale¿noœci
|
||||||
if (!bLoadTraction) // wczytywanie drutów i s³upów
|
if (!bLoadTraction) // wczytywanie drutów i s³upów
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ class Global
|
|||||||
static void SetCameraRotation(double Yaw);
|
static void SetCameraRotation(double Yaw);
|
||||||
static int iWriteLogEnabled; // maska bitowa: 1-zapis do pliku, 2-okienko
|
static int iWriteLogEnabled; // maska bitowa: 1-zapis do pliku, 2-okienko
|
||||||
// McZapkie-221002: definicja swiatla dziennego
|
// McZapkie-221002: definicja swiatla dziennego
|
||||||
|
static float Background[3];
|
||||||
static GLfloat AtmoColor[];
|
static GLfloat AtmoColor[];
|
||||||
static GLfloat FogColor[];
|
static GLfloat FogColor[];
|
||||||
// static bool bTimeChange;
|
// static bool bTimeChange;
|
||||||
|
|||||||
63
Ground.cpp
63
Ground.cpp
@@ -4774,6 +4774,24 @@ void TGround::WyslijEvent(const AnsiString &e, const AnsiString &d)
|
|||||||
cData.cbData = 12 + i + j; // 8+dwa liczniki i dwa zera koñcz¹ce
|
cData.cbData = 12 + i + j; // 8+dwa liczniki i dwa zera koñcz¹ce
|
||||||
cData.lpData = &r;
|
cData.lpData = &r;
|
||||||
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(r.iComm) + " " + e + " sent");
|
||||||
|
};
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
void TGround::WyslijUszkodzenia(const AnsiString &t, char fl)
|
||||||
|
{ // wys³anie informacji w postaci pojedynczego tekstu
|
||||||
|
DaneRozkaz r;
|
||||||
|
r.iSygn = 'EU07';
|
||||||
|
r.iComm = 13; // numer komunikatu
|
||||||
|
int i = t.Length();
|
||||||
|
r.cString[0] = char(fl);
|
||||||
|
r.cString[1] = char(i);
|
||||||
|
strcpy(r.cString + 2, t.c_str()); // z zerem koñcz¹cym
|
||||||
|
COPYDATASTRUCT cData;
|
||||||
|
cData.dwData = 'EU07'; // sygnatura
|
||||||
|
cData.cbData = 11 + i; // 8+licznik i zero koñcz¹ce
|
||||||
|
cData.lpData = &r;
|
||||||
|
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(r.iComm) + " " + t + " sent");
|
||||||
};
|
};
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void TGround::WyslijString(const AnsiString &t, int n)
|
void TGround::WyslijString(const AnsiString &t, int n)
|
||||||
@@ -4789,6 +4807,7 @@ void TGround::WyslijString(const AnsiString &t, int n)
|
|||||||
cData.cbData = 10 + i; // 8+licznik i zero koñcz¹ce
|
cData.cbData = 10 + i; // 8+licznik i zero koñcz¹ce
|
||||||
cData.lpData = &r;
|
cData.lpData = &r;
|
||||||
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(r.iComm) + " " + t + " sent");
|
||||||
};
|
};
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void TGround::WyslijWolny(const AnsiString &t)
|
void TGround::WyslijWolny(const AnsiString &t)
|
||||||
@@ -4868,7 +4887,51 @@ void TGround::WyslijNamiary(TGroundNode *t)
|
|||||||
// WriteLog("Ramka gotowa");
|
// WriteLog("Ramka gotowa");
|
||||||
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
||||||
// WriteLog("Ramka poszla!");
|
// WriteLog("Ramka poszla!");
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(r.iComm) + " " + t->asName + " sent");
|
||||||
};
|
};
|
||||||
|
//
|
||||||
|
void TGround::WyslijObsadzone()
|
||||||
|
{ // wys³anie informacji o pojeŸdzie
|
||||||
|
DaneRozkaz2 r;
|
||||||
|
r.iSygn = 'EU07';
|
||||||
|
r.iComm = 12; // kod 12
|
||||||
|
for (int i; i<1984; i++) r.cString[i] = 0;
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for (TGroundNode *Current = nRootDynamic; Current; Current = Current->nNext)
|
||||||
|
if (Current->DynamicObject->Mechanik)
|
||||||
|
{
|
||||||
|
strcpy(r.cString + 64 * i, Current->DynamicObject->asName.c_str());
|
||||||
|
r.fPar[16 * i + 4] = Current->DynamicObject->GetPosition().x;
|
||||||
|
r.fPar[16 * i + 5] = Current->DynamicObject->GetPosition().y;
|
||||||
|
r.fPar[16 * i + 6] = Current->DynamicObject->GetPosition().z;
|
||||||
|
r.iPar[16 * i + 7] = Current->DynamicObject->Mechanik->GetAction();
|
||||||
|
strcpy(r.cString + 64 * i + 32, Current->DynamicObject->GetTrack()->IsolatedName().c_str());
|
||||||
|
strcpy(r.cString + 64 * i + 48, Current->DynamicObject->Mechanik->Timetable()->TrainName.c_str());
|
||||||
|
i++;
|
||||||
|
if (i>30) break;
|
||||||
|
}
|
||||||
|
while (i <= 30)
|
||||||
|
{
|
||||||
|
strcpy(r.cString + 64 * i, AnsiString("none").c_str());
|
||||||
|
r.fPar[16 * i + 4] = 1;
|
||||||
|
r.fPar[16 * i + 5] = 2;
|
||||||
|
r.fPar[16 * i + 6] = 3;
|
||||||
|
r.iPar[16 * i + 7] = 0;
|
||||||
|
strcpy(r.cString + 64 * i + 32, AnsiString("none").c_str());
|
||||||
|
strcpy(r.cString + 64 * i + 48, AnsiString("none").c_str());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
COPYDATASTRUCT cData;
|
||||||
|
cData.dwData = 'EU07'; // sygnatura
|
||||||
|
cData.cbData = 8 + 1984; // 8+licznik i zero koñcz¹ce
|
||||||
|
cData.lpData = &r;
|
||||||
|
// WriteLog("Ramka gotowa");
|
||||||
|
Navigate("TEU07SRK", WM_COPYDATA, (WPARAM)Global::hWnd, (LPARAM)&cData);
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(r.iComm) + " obsadzone" + " sent");
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
void TGround::WyslijParam(int nr, int fl)
|
void TGround::WyslijParam(int nr, int fl)
|
||||||
{ // wys³anie parametrów symulacji w ramce (nr) z flagami (fl)
|
{ // wys³anie parametrów symulacji w ramce (nr) z flagami (fl)
|
||||||
|
|||||||
15
Ground.h
15
Ground.h
@@ -46,6 +46,18 @@ struct DaneRozkaz
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DaneRozkaz2
|
||||||
|
{ // struktura komunikacji z EU07.EXE
|
||||||
|
int iSygn; // sygnatura 'EU07'
|
||||||
|
int iComm; // rozkaz/status (kod ramki)
|
||||||
|
union
|
||||||
|
{
|
||||||
|
float fPar[496];
|
||||||
|
int iPar[496];
|
||||||
|
char cString[1984]; // upakowane stringi
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
typedef int TGroundNodeType;
|
typedef int TGroundNodeType;
|
||||||
|
|
||||||
struct TGroundVertex
|
struct TGroundVertex
|
||||||
@@ -386,6 +398,9 @@ class TGround
|
|||||||
void WyslijWolny(const AnsiString &t);
|
void WyslijWolny(const AnsiString &t);
|
||||||
void WyslijNamiary(TGroundNode *t);
|
void WyslijNamiary(TGroundNode *t);
|
||||||
void WyslijParam(int nr, int fl);
|
void WyslijParam(int nr, int fl);
|
||||||
|
void WyslijUszkodzenia(const AnsiString &t, char fl);
|
||||||
|
void WyslijPojazdy(int nr); // -> skladanie wielu pojazdow
|
||||||
|
void WyslijObsadzone(); // -> skladanie wielu pojazdow
|
||||||
void RadioStop(vector3 pPosition);
|
void RadioStop(vector3 pPosition);
|
||||||
TDynamicObject *__fastcall DynamicNearest(vector3 pPosition, double distance = 20.0,
|
TDynamicObject *__fastcall DynamicNearest(vector3 pPosition, double distance = 20.0,
|
||||||
bool mech = false);
|
bool mech = false);
|
||||||
|
|||||||
24
Logs.cpp
24
Logs.cpp
@@ -20,6 +20,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
|
|
||||||
std::ofstream output; // standardowy "log.txt", mo¿na go wy³¹czyæ
|
std::ofstream output; // standardowy "log.txt", mo¿na go wy³¹czyæ
|
||||||
std::ofstream errors; // lista b³êdów "errors.txt", zawsze dzia³a
|
std::ofstream errors; // lista b³êdów "errors.txt", zawsze dzia³a
|
||||||
|
std::ofstream comms; // lista komunikatow "comms.txt", mo¿na go wy³¹czyæ
|
||||||
|
|
||||||
char endstring[10] = "\n";
|
char endstring[10] = "\n";
|
||||||
|
|
||||||
@@ -103,6 +104,29 @@ void WriteLog(const AnsiString &str, bool newline)
|
|||||||
{ // Ra: wersja z AnsiString jest zamienna z Error()
|
{ // Ra: wersja z AnsiString jest zamienna z Error()
|
||||||
WriteLog(str.c_str(), newline);
|
WriteLog(str.c_str(), newline);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void CommLog(const char *str)
|
||||||
|
{ // Ra: warunkowa rejestracja komunikatów
|
||||||
|
WriteLog(str);
|
||||||
|
/* if (Global::iWriteLogEnabled & 4)
|
||||||
|
{
|
||||||
|
if (!comms.is_open())
|
||||||
|
{
|
||||||
|
comms.open("comms.txt", std::ios::trunc);
|
||||||
|
comms << AnsiString("EU07.EXE " + Global::asRelease).c_str() << "\n";
|
||||||
|
}
|
||||||
|
if (str)
|
||||||
|
comms << str;
|
||||||
|
comms << "\n";
|
||||||
|
comms.flush();
|
||||||
|
}*/
|
||||||
|
};
|
||||||
|
|
||||||
|
void CommLog(const AnsiString &str)
|
||||||
|
{ // Ra: wersja z AnsiString jest zamienna z Error()
|
||||||
|
CommLog(str.c_str());
|
||||||
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#pragma package(smart_init)
|
#pragma package(smart_init)
|
||||||
|
|||||||
2
Logs.h
2
Logs.h
@@ -18,5 +18,7 @@ void WriteLog(const char *str, bool newline = true);
|
|||||||
void Error(const AnsiString &asMessage, bool box = true);
|
void Error(const AnsiString &asMessage, bool box = true);
|
||||||
void ErrorLog(const AnsiString &asMessage);
|
void ErrorLog(const AnsiString &asMessage);
|
||||||
void WriteLog(const AnsiString &str, bool newline = true);
|
void WriteLog(const AnsiString &str, bool newline = true);
|
||||||
|
void CommLog(const char *str);
|
||||||
|
void CommLog(const AnsiString &str);
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -93,8 +93,9 @@ enum TBrakeValve { NoValve, W, W_Lu_VI, W_Lu_L, W_Lu_XR, K, Kg, Kp, Kss, Kkg, Kk
|
|||||||
#pragma option pop
|
#pragma option pop
|
||||||
|
|
||||||
#pragma option push -b-
|
#pragma option push -b-
|
||||||
enum TBrakeHandle { NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113
|
enum TBrakeHandle {
|
||||||
};
|
NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113,
|
||||||
|
MHZ_P, MHZ_T, MHZ_EN57 };
|
||||||
#pragma option pop
|
#pragma option pop
|
||||||
|
|
||||||
#pragma option push -b-
|
#pragma option push -b-
|
||||||
@@ -425,6 +426,10 @@ public:
|
|||||||
Byte BrakeCtrlPosNo;
|
Byte BrakeCtrlPosNo;
|
||||||
Byte MainCtrlPosNo;
|
Byte MainCtrlPosNo;
|
||||||
Byte ScndCtrlPosNo;
|
Byte ScndCtrlPosNo;
|
||||||
|
Byte LightsPosNo;
|
||||||
|
Byte LightsDefPos;
|
||||||
|
bool LightsWrap;
|
||||||
|
Byte Lights[2][16];
|
||||||
bool ScndInMain;
|
bool ScndInMain;
|
||||||
bool MBrake;
|
bool MBrake;
|
||||||
TSecuritySystem SecuritySystem;
|
TSecuritySystem SecuritySystem;
|
||||||
@@ -454,6 +459,7 @@ public:
|
|||||||
double RVentCutOff;
|
double RVentCutOff;
|
||||||
int CompressorPower;
|
int CompressorPower;
|
||||||
int SmallCompressorPower;
|
int SmallCompressorPower;
|
||||||
|
bool Trafo;
|
||||||
double dizel_Mmax;
|
double dizel_Mmax;
|
||||||
double dizel_nMmax;
|
double dizel_nMmax;
|
||||||
double dizel_Mnmax;
|
double dizel_Mnmax;
|
||||||
@@ -481,7 +487,7 @@ public:
|
|||||||
TShuntScheme SST[33];
|
TShuntScheme SST[33];
|
||||||
double PowerCorRatio;
|
double PowerCorRatio;
|
||||||
double Ftmax;
|
double Ftmax;
|
||||||
double eimc[21];
|
double eimc[26];
|
||||||
int MaxLoad;
|
int MaxLoad;
|
||||||
AnsiString LoadAccepted;
|
AnsiString LoadAccepted;
|
||||||
AnsiString LoadQuantity;
|
AnsiString LoadQuantity;
|
||||||
@@ -496,7 +502,11 @@ public:
|
|||||||
double DoorCloseSpeed;
|
double DoorCloseSpeed;
|
||||||
double DoorMaxShiftL;
|
double DoorMaxShiftL;
|
||||||
double DoorMaxShiftR;
|
double DoorMaxShiftR;
|
||||||
|
double DoorMaxPlugShift;
|
||||||
Byte DoorOpenMethod;
|
Byte DoorOpenMethod;
|
||||||
|
double PlatformSpeed;
|
||||||
|
double PlatformMaxShift;
|
||||||
|
Byte PlatformOpenMethod;
|
||||||
bool ScndS;
|
bool ScndS;
|
||||||
TLocation Loc;
|
TLocation Loc;
|
||||||
TRotation Rot;
|
TRotation Rot;
|
||||||
@@ -559,6 +569,7 @@ public:
|
|||||||
double LimPipePress;
|
double LimPipePress;
|
||||||
double ActFlowSpeed;
|
double ActFlowSpeed;
|
||||||
Byte DamageFlag;
|
Byte DamageFlag;
|
||||||
|
Byte EngDmgFlag;
|
||||||
Byte DerailReason;
|
Byte DerailReason;
|
||||||
TCommand CommandIn;
|
TCommand CommandIn;
|
||||||
AnsiString CommandOut;
|
AnsiString CommandOut;
|
||||||
@@ -571,6 +582,7 @@ public:
|
|||||||
bool Mains;
|
bool Mains;
|
||||||
Byte MainCtrlPos;
|
Byte MainCtrlPos;
|
||||||
Byte ScndCtrlPos;
|
Byte ScndCtrlPos;
|
||||||
|
Byte LightsPos;
|
||||||
int ActiveDir;
|
int ActiveDir;
|
||||||
int CabNo;
|
int CabNo;
|
||||||
int DirAbsolute;
|
int DirAbsolute;
|
||||||
@@ -763,6 +775,7 @@ static const Shortint maxcc = 0x4;
|
|||||||
static const Shortint LocalBrakePosNo = 0xa;
|
static const Shortint LocalBrakePosNo = 0xa;
|
||||||
static const Shortint MainBrakeMaxPos = 0xa;
|
static const Shortint MainBrakeMaxPos = 0xa;
|
||||||
static const Shortint ManualBrakePosNo = 0x14;
|
static const Shortint ManualBrakePosNo = 0x14;
|
||||||
|
static const Shortint LightsSwitchPosNo = 0x10;
|
||||||
static const Shortint dtrack_railwear = 0x2;
|
static const Shortint dtrack_railwear = 0x2;
|
||||||
static const Shortint dtrack_freerail = 0x4;
|
static const Shortint dtrack_freerail = 0x4;
|
||||||
static const Shortint dtrack_thinrail = 0x8;
|
static const Shortint dtrack_thinrail = 0x8;
|
||||||
@@ -847,6 +860,8 @@ static const Shortint eimc_p_Ph = 0x11;
|
|||||||
static const Shortint eimc_p_Vh0 = 0x12;
|
static const Shortint eimc_p_Vh0 = 0x12;
|
||||||
static const Shortint eimc_p_Vh1 = 0x13;
|
static const Shortint eimc_p_Vh1 = 0x13;
|
||||||
static const Shortint eimc_p_Imax = 0x14;
|
static const Shortint eimc_p_Imax = 0x14;
|
||||||
|
static const Shortint eimc_p_abed = 0x15;
|
||||||
|
static const Shortint eimc_p_eped = 0x16;
|
||||||
static const Shortint eimv_FMAXMAX = 0x0;
|
static const Shortint eimv_FMAXMAX = 0x0;
|
||||||
static const Shortint eimv_Fmax = 0x1;
|
static const Shortint eimv_Fmax = 0x1;
|
||||||
static const Shortint eimv_ks = 0x2;
|
static const Shortint eimv_ks = 0x2;
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ enum TBrakeValve { NoValve, W, W_Lu_VI, W_Lu_L, W_Lu_XR, K, Kg, Kp, Kss, Kkg, Kk
|
|||||||
#pragma option pop
|
#pragma option pop
|
||||||
|
|
||||||
#pragma option push -b-
|
#pragma option push -b-
|
||||||
enum TBrakeHandle { NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113
|
enum TBrakeHandle { NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113,
|
||||||
};
|
MHZ_P, MHZ_T, MHZ_EN57 };
|
||||||
#pragma option pop
|
#pragma option pop
|
||||||
|
|
||||||
#pragma option push -b-
|
#pragma option push -b-
|
||||||
@@ -404,6 +404,10 @@ public:
|
|||||||
Byte BrakeCtrlPosNo;
|
Byte BrakeCtrlPosNo;
|
||||||
Byte MainCtrlPosNo;
|
Byte MainCtrlPosNo;
|
||||||
Byte ScndCtrlPosNo;
|
Byte ScndCtrlPosNo;
|
||||||
|
Byte LightsPosNo;
|
||||||
|
Byte LightsDefPos;
|
||||||
|
bool LightsWrap;
|
||||||
|
Byte Lights[2][16];
|
||||||
bool ScndInMain;
|
bool ScndInMain;
|
||||||
bool MBrake;
|
bool MBrake;
|
||||||
TSecuritySystem SecuritySystem;
|
TSecuritySystem SecuritySystem;
|
||||||
@@ -433,6 +437,7 @@ public:
|
|||||||
double RVentCutOff;
|
double RVentCutOff;
|
||||||
int CompressorPower;
|
int CompressorPower;
|
||||||
int SmallCompressorPower;
|
int SmallCompressorPower;
|
||||||
|
bool Trafo;
|
||||||
double dizel_Mmax;
|
double dizel_Mmax;
|
||||||
double dizel_nMmax;
|
double dizel_nMmax;
|
||||||
double dizel_Mnmax;
|
double dizel_Mnmax;
|
||||||
@@ -460,7 +465,7 @@ public:
|
|||||||
TShuntScheme SST[33];
|
TShuntScheme SST[33];
|
||||||
double PowerCorRatio;
|
double PowerCorRatio;
|
||||||
double Ftmax;
|
double Ftmax;
|
||||||
double eimc[21];
|
double eimc[26];
|
||||||
int MaxLoad;
|
int MaxLoad;
|
||||||
AnsiString LoadAccepted;
|
AnsiString LoadAccepted;
|
||||||
AnsiString LoadQuantity;
|
AnsiString LoadQuantity;
|
||||||
@@ -475,7 +480,11 @@ public:
|
|||||||
double DoorCloseSpeed;
|
double DoorCloseSpeed;
|
||||||
double DoorMaxShiftL;
|
double DoorMaxShiftL;
|
||||||
double DoorMaxShiftR;
|
double DoorMaxShiftR;
|
||||||
|
double DoorMaxPlugShift;
|
||||||
Byte DoorOpenMethod;
|
Byte DoorOpenMethod;
|
||||||
|
double PlatformSpeed;
|
||||||
|
double PlatformMaxShift;
|
||||||
|
Byte PlatformOpenMethod;
|
||||||
bool ScndS;
|
bool ScndS;
|
||||||
TLocation Loc;
|
TLocation Loc;
|
||||||
TRotation Rot;
|
TRotation Rot;
|
||||||
@@ -538,6 +547,7 @@ public:
|
|||||||
double LimPipePress;
|
double LimPipePress;
|
||||||
double ActFlowSpeed;
|
double ActFlowSpeed;
|
||||||
Byte DamageFlag;
|
Byte DamageFlag;
|
||||||
|
Byte EngDmgFlag;
|
||||||
Byte DerailReason;
|
Byte DerailReason;
|
||||||
TCommand CommandIn;
|
TCommand CommandIn;
|
||||||
AnsiString CommandOut;
|
AnsiString CommandOut;
|
||||||
@@ -550,6 +560,7 @@ public:
|
|||||||
bool Mains;
|
bool Mains;
|
||||||
Byte MainCtrlPos;
|
Byte MainCtrlPos;
|
||||||
Byte ScndCtrlPos;
|
Byte ScndCtrlPos;
|
||||||
|
Byte LightsPos;
|
||||||
int ActiveDir;
|
int ActiveDir;
|
||||||
int CabNo;
|
int CabNo;
|
||||||
int DirAbsolute;
|
int DirAbsolute;
|
||||||
@@ -761,6 +772,7 @@ static const Shortint maxcc = 0x4;
|
|||||||
static const Shortint LocalBrakePosNo = 0xa;
|
static const Shortint LocalBrakePosNo = 0xa;
|
||||||
static const Shortint MainBrakeMaxPos = 0xa;
|
static const Shortint MainBrakeMaxPos = 0xa;
|
||||||
static const Shortint ManualBrakePosNo = 0x14;
|
static const Shortint ManualBrakePosNo = 0x14;
|
||||||
|
static const Shortint LightsSwitchPosNo = 0x10;
|
||||||
static const Shortint dtrack_railwear = 0x2;
|
static const Shortint dtrack_railwear = 0x2;
|
||||||
static const Shortint dtrack_freerail = 0x4;
|
static const Shortint dtrack_freerail = 0x4;
|
||||||
static const Shortint dtrack_thinrail = 0x8;
|
static const Shortint dtrack_thinrail = 0x8;
|
||||||
@@ -845,6 +857,8 @@ static const Shortint eimc_p_Ph = 0x11;
|
|||||||
static const Shortint eimc_p_Vh0 = 0x12;
|
static const Shortint eimc_p_Vh0 = 0x12;
|
||||||
static const Shortint eimc_p_Vh1 = 0x13;
|
static const Shortint eimc_p_Vh1 = 0x13;
|
||||||
static const Shortint eimc_p_Imax = 0x14;
|
static const Shortint eimc_p_Imax = 0x14;
|
||||||
|
static const Shortint eimc_p_abed = 0x15;
|
||||||
|
static const Shortint eimc_p_eped = 0x16;
|
||||||
static const Shortint eimv_FMAXMAX = 0x0;
|
static const Shortint eimv_FMAXMAX = 0x0;
|
||||||
static const Shortint eimv_Fmax = 0x1;
|
static const Shortint eimv_Fmax = 0x1;
|
||||||
static const Shortint eimv_ks = 0x2;
|
static const Shortint eimv_ks = 0x2;
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ CONST
|
|||||||
LocalBrakePosNo=10; {ilosc nastaw hamulca pomocniczego}
|
LocalBrakePosNo=10; {ilosc nastaw hamulca pomocniczego}
|
||||||
MainBrakeMaxPos=10; {max. ilosc nastaw hamulca zasadniczego}
|
MainBrakeMaxPos=10; {max. ilosc nastaw hamulca zasadniczego}
|
||||||
ManualBrakePosNo=20; {ilosc nastaw hamulca recznego}
|
ManualBrakePosNo=20; {ilosc nastaw hamulca recznego}
|
||||||
|
LightsSwitchPosNo=16;
|
||||||
|
|
||||||
{uszkodzenia toru}
|
{uszkodzenia toru}
|
||||||
dtrack_railwear=2;
|
dtrack_railwear=2;
|
||||||
@@ -182,6 +183,8 @@ CONST
|
|||||||
eimc_p_Vh0=18;
|
eimc_p_Vh0=18;
|
||||||
eimc_p_Vh1=19;
|
eimc_p_Vh1=19;
|
||||||
eimc_p_Imax=20;
|
eimc_p_Imax=20;
|
||||||
|
eimc_p_abed=21;
|
||||||
|
eimc_p_eped=22;
|
||||||
|
|
||||||
//zmienne dla asynchronów
|
//zmienne dla asynchronów
|
||||||
eimv_FMAXMAX=0;
|
eimv_FMAXMAX=0;
|
||||||
@@ -248,7 +251,7 @@ TYPE
|
|||||||
{podtypy hamulcow zespolonych}
|
{podtypy hamulcow zespolonych}
|
||||||
TBrakeSubSystem = (ss_None, ss_W, ss_K, ss_KK, ss_Hik, ss_ESt, ss_KE, ss_LSt, ss_MT, ss_Dako);
|
TBrakeSubSystem = (ss_None, ss_W, ss_K, ss_KK, ss_Hik, ss_ESt, ss_KE, ss_LSt, ss_MT, ss_Dako);
|
||||||
TBrakeValve = (NoValve, W, W_Lu_VI, W_Lu_L, W_Lu_XR, K, Kg, Kp, Kss, Kkg, Kkp, Kks, Hikg1, Hikss, Hikp1, KE, SW, EStED, NESt3, ESt3, LSt, ESt4, ESt3AL2, EP1, EP2, M483, CV1_L_TR, CV1, CV1_R, Other);
|
TBrakeValve = (NoValve, W, W_Lu_VI, W_Lu_L, W_Lu_XR, K, Kg, Kp, Kss, Kkg, Kkp, Kks, Hikg1, Hikss, Hikp1, KE, SW, EStED, NESt3, ESt3, LSt, ESt4, ESt3AL2, EP1, EP2, M483, CV1_L_TR, CV1, CV1_R, Other);
|
||||||
TBrakeHandle = (NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113);
|
TBrakeHandle = (NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113, MHZ_P, MHZ_T, MHZ_EN57);
|
||||||
{typy hamulcow indywidualnych}
|
{typy hamulcow indywidualnych}
|
||||||
TLocalBrake = (NoBrake, ManualBrake, PneumaticBrake, HydraulicBrake);
|
TLocalBrake = (NoBrake, ManualBrake, PneumaticBrake, HydraulicBrake);
|
||||||
|
|
||||||
@@ -484,6 +487,9 @@ TYPE
|
|||||||
{nastawniki:}
|
{nastawniki:}
|
||||||
MainCtrlPosNo: byte; {ilosc pozycji nastawnika}
|
MainCtrlPosNo: byte; {ilosc pozycji nastawnika}
|
||||||
ScndCtrlPosNo: byte;
|
ScndCtrlPosNo: byte;
|
||||||
|
LightsPosNo, LightsDefPos: byte;
|
||||||
|
LightsWrap: boolean;
|
||||||
|
Lights: array [0..1] of array [1..16] of byte;
|
||||||
ScndInMain: boolean; {zaleznosc bocznika od nastawnika}
|
ScndInMain: boolean; {zaleznosc bocznika od nastawnika}
|
||||||
MBrake: boolean; {Czy jest hamulec reczny}
|
MBrake: boolean; {Czy jest hamulec reczny}
|
||||||
SecuritySystem: TSecuritySystem;
|
SecuritySystem: TSecuritySystem;
|
||||||
@@ -520,6 +526,7 @@ TYPE
|
|||||||
RVentCutOff: real; {rezystancja wylaczania wentylatorow dla RVentType=2}
|
RVentCutOff: real; {rezystancja wylaczania wentylatorow dla RVentType=2}
|
||||||
CompressorPower: integer; {0: bezp. z obwodow silnika, 1: z przetwornicy, reczne, 2: w przetwornicy, stale, 5: z silnikowego}
|
CompressorPower: integer; {0: bezp. z obwodow silnika, 1: z przetwornicy, reczne, 2: w przetwornicy, stale, 5: z silnikowego}
|
||||||
SmallCompressorPower: integer; {Winger ZROBIC}
|
SmallCompressorPower: integer; {Winger ZROBIC}
|
||||||
|
Trafo: boolean; {pojazd wyposażony w transformator}
|
||||||
|
|
||||||
{-sekcja parametrow dla lokomotywy spalinowej z przekladnia mechaniczna}
|
{-sekcja parametrow dla lokomotywy spalinowej z przekladnia mechaniczna}
|
||||||
dizel_Mmax, dizel_nMmax, dizel_Mnmax, dizel_nmax, dizel_nominalfill: real;
|
dizel_Mmax, dizel_nMmax, dizel_Mnmax, dizel_nmax, dizel_nominalfill: real;
|
||||||
@@ -553,7 +560,7 @@ TYPE
|
|||||||
Ftmax:real;
|
Ftmax:real;
|
||||||
|
|
||||||
{- dla lokomotyw z silnikami indukcyjnymi -}
|
{- dla lokomotyw z silnikami indukcyjnymi -}
|
||||||
eimc: array [0..20] of real;
|
eimc: array [0..25] of real;
|
||||||
|
|
||||||
{-dla wagonow}
|
{-dla wagonow}
|
||||||
MaxLoad: longint; {masa w T lub ilosc w sztukach - ladownosc}
|
MaxLoad: longint; {masa w T lub ilosc w sztukach - ladownosc}
|
||||||
@@ -564,8 +571,11 @@ TYPE
|
|||||||
DoorStayOpen: real; {jak dlugo otwarte w przypadku DoorCloseCtrl=2}
|
DoorStayOpen: real; {jak dlugo otwarte w przypadku DoorCloseCtrl=2}
|
||||||
DoorClosureWarning: boolean; {czy jest ostrzeganie przed zamknieciem}
|
DoorClosureWarning: boolean; {czy jest ostrzeganie przed zamknieciem}
|
||||||
DoorOpenSpeed, DoorCloseSpeed: real; {predkosc otwierania i zamykania w j.u. }
|
DoorOpenSpeed, DoorCloseSpeed: real; {predkosc otwierania i zamykania w j.u. }
|
||||||
DoorMaxShiftL,DoorMaxShiftR: real;{szerokosc otwarcia lub kat}
|
DoorMaxShiftL,DoorMaxShiftR,DoorMaxPlugShift: real;{szerokosc otwarcia lub kat}
|
||||||
DoorOpenMethod: byte; {sposob otwarcia - 1: przesuwne, 2: obrotowe, 3: trójelementowe}
|
DoorOpenMethod: byte; {sposob otwarcia - 1: przesuwne, 2: obrotowe, 3: trójelementowe}
|
||||||
|
PlatformSpeed: real; {szybkosc stopnia}
|
||||||
|
PlatformMaxShift: real; {wysuniecie stopnia}
|
||||||
|
PlatformOpenMethod: byte; {sposob animacji stopnia}
|
||||||
ScndS: boolean; {Czy jest bocznikowanie na szeregowej}
|
ScndS: boolean; {Czy jest bocznikowanie na szeregowej}
|
||||||
|
|
||||||
{--sekcja zmiennych}
|
{--sekcja zmiennych}
|
||||||
@@ -629,6 +639,7 @@ TYPE
|
|||||||
|
|
||||||
|
|
||||||
DamageFlag: byte; //kombinacja bitowa stalych dtrain_* }
|
DamageFlag: byte; //kombinacja bitowa stalych dtrain_* }
|
||||||
|
EngDmgFlag: byte; //kombinacja bitowa stalych usterek}
|
||||||
DerailReason: byte; //przyczyna wykolejenia
|
DerailReason: byte; //przyczyna wykolejenia
|
||||||
|
|
||||||
//EndSignalsFlag: byte; {ABu 060205: zmiany - koncowki: 1/16 - swiatla prz/tyl, 2/31 - blachy prz/tyl}
|
//EndSignalsFlag: byte; {ABu 060205: zmiany - koncowki: 1/16 - swiatla prz/tyl, 2/31 - blachy prz/tyl}
|
||||||
@@ -648,6 +659,7 @@ TYPE
|
|||||||
Mains: boolean; {polozenie glownego wylacznika}
|
Mains: boolean; {polozenie glownego wylacznika}
|
||||||
MainCtrlPos: byte; {polozenie glownego nastawnika}
|
MainCtrlPos: byte; {polozenie glownego nastawnika}
|
||||||
ScndCtrlPos: byte; {polozenie dodatkowego nastawnika}
|
ScndCtrlPos: byte; {polozenie dodatkowego nastawnika}
|
||||||
|
LightsPos: byte;
|
||||||
ActiveDir: integer; //czy lok. jest wlaczona i w ktorym kierunku:
|
ActiveDir: integer; //czy lok. jest wlaczona i w ktorym kierunku:
|
||||||
//względem wybranej kabiny: -1 - do tylu, +1 - do przodu, 0 - wylaczona
|
//względem wybranej kabiny: -1 - do tylu, +1 - do przodu, 0 - wylaczona
|
||||||
CabNo: integer; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
CabNo: integer; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||||
@@ -1048,6 +1060,7 @@ end;
|
|||||||
|
|
||||||
{---------rozwiniecie deklaracji metod obiektu T_MoverParameters--------}
|
{---------rozwiniecie deklaracji metod obiektu T_MoverParameters--------}
|
||||||
|
|
||||||
|
(*
|
||||||
function T_MoverParameters.GetTrainsetVoltage: real;
|
function T_MoverParameters.GetTrainsetVoltage: real;
|
||||||
//ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
//ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
||||||
var volt: real;
|
var volt: real;
|
||||||
@@ -1074,6 +1087,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
GetTrainsetVoltage:=volt;
|
GetTrainsetVoltage:=volt;
|
||||||
end;
|
end;
|
||||||
|
*)
|
||||||
|
|
||||||
|
function T_MoverParameters.GetTrainsetVoltage: real;
|
||||||
|
//ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
||||||
|
//var volt: real;
|
||||||
|
begin
|
||||||
|
GetTrainsetVoltage:=Max0R(HVCouplers[1][1],HVCouplers[0][1]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1554,6 +1575,12 @@ begin
|
|||||||
if (LastRelayTime>CtrlDelay) then
|
if (LastRelayTime>CtrlDelay) then
|
||||||
LastRelayTime:=0;
|
LastRelayTime:=0;
|
||||||
|
|
||||||
|
if (OK) and (EngineType=ElectricInductionMotor) then
|
||||||
|
if (Vmax<250) then
|
||||||
|
ScndCtrlActualPos:=Round(Vel+0.5)
|
||||||
|
else
|
||||||
|
ScndCtrlActualPos:=Round(Vel/2+0.5);
|
||||||
|
|
||||||
IncScndCtrl:=OK;
|
IncScndCtrl:=OK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1597,6 +1624,10 @@ begin
|
|||||||
if OK then
|
if OK then
|
||||||
if (LastRelayTime>CtrlDownDelay) then
|
if (LastRelayTime>CtrlDownDelay) then
|
||||||
LastRelayTime:=0;
|
LastRelayTime:=0;
|
||||||
|
|
||||||
|
if (OK) and (EngineType=ElectricInductionMotor) then
|
||||||
|
ScndCtrlActualPos:=0;
|
||||||
|
|
||||||
DecScndCtrl:=OK;
|
DecScndCtrl:=OK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1631,7 +1662,7 @@ begin
|
|||||||
MainSwitch:=false; //Ra: przeniesione z końca
|
MainSwitch:=false; //Ra: przeniesione z końca
|
||||||
if ((Mains<>State) and (MainCtrlPosNo>0)) then
|
if ((Mains<>State) and (MainCtrlPosNo>0)) then
|
||||||
begin
|
begin
|
||||||
if (State=false) or ({(MainCtrlPos=0) and} (ScndCtrlPos=0) and (ConvOvldFlag=false) and (LastSwitchingTime>CtrlDelay) and not TestFlag(DamageFlag,dtrain_out)) then
|
if (State=false) or ({(MainCtrlPos=0) and} (ScndCtrlPos=0) and ((ConvOvldFlag=false)or(TrainType=dt_EZT)) and (LastSwitchingTime>CtrlDelay) and not TestFlag(DamageFlag,dtrain_out) and not TestFlag(EngDmgFlag,1)) then
|
||||||
begin
|
begin
|
||||||
if Mains then //jeśli był załączony
|
if Mains then //jeśli był załączony
|
||||||
SendCtrlToNext('MainSwitch',ord(State),CabNo); //wysłanie wyłączenia do pozostałych?
|
SendCtrlToNext('MainSwitch',ord(State),CabNo); //wysłanie wyłączenia do pozostałych?
|
||||||
@@ -1644,6 +1675,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
dizel_enginestart:=State;
|
dizel_enginestart:=State;
|
||||||
end;
|
end;
|
||||||
|
if ((TrainType=dt_EZT)and(not State)) then
|
||||||
|
ConvOvldFlag:=true;
|
||||||
//if (State=false) then //jeśli wyłączony
|
//if (State=false) then //jeśli wyłączony
|
||||||
// begin
|
// begin
|
||||||
//SetFlag(SoundFlag,sound_relay); //hunter-091012: przeniesione do Train.cpp, zeby sie nie zapetlal
|
//SetFlag(SoundFlag,sound_relay); //hunter-091012: przeniesione do Train.cpp, zeby sie nie zapetlal
|
||||||
@@ -1939,6 +1972,8 @@ begin
|
|||||||
//poza tym jest zdefiniowany we wszystkich 3 członach EN57
|
//poza tym jest zdefiniowany we wszystkich 3 członach EN57
|
||||||
with SecuritySystem do
|
with SecuritySystem do
|
||||||
begin
|
begin
|
||||||
|
if (not Radio) then
|
||||||
|
EmergencyBrakeSwitch(false);
|
||||||
if (SystemType>0) and (Status>0) and (Battery) then //Ra: EZT ma teraz czuwak w rozrządczym
|
if (SystemType>0) and (Status>0) and (Battery) then //Ra: EZT ma teraz czuwak w rozrządczym
|
||||||
begin
|
begin
|
||||||
//CA
|
//CA
|
||||||
@@ -1988,6 +2023,7 @@ begin
|
|||||||
end
|
end
|
||||||
else if not (Battery) then
|
else if not (Battery) then
|
||||||
begin //wyłączenie baterii deaktywuje sprzęt
|
begin //wyłączenie baterii deaktywuje sprzęt
|
||||||
|
EmergencyBrakeSwitch(false);
|
||||||
//SecuritySystem.Status:=0; //deaktywacja czuwaka
|
//SecuritySystem.Status:=0; //deaktywacja czuwaka
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -2061,11 +2097,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
dec(BrakeCtrlPos);
|
dec(BrakeCtrlPos);
|
||||||
// BrakeCtrlPosR:=BrakeCtrlPos;
|
// BrakeCtrlPosR:=BrakeCtrlPos;
|
||||||
if EmergencyBrakeFlag then
|
//// if EmergencyBrakeFlag then //yB: czy to jest potrzebne?
|
||||||
begin
|
//// begin
|
||||||
EmergencyBrakeFlag:=false; {!!!}
|
//// EmergencyBrakeFlag:=false; {!!!}
|
||||||
SendCtrlToNext('Emergency_brake',0,CabNo);
|
//// SendCtrlToNext('Emergency_brake',0,CabNo);
|
||||||
end;
|
//// end;
|
||||||
|
|
||||||
//youBy: wywalilem to, jak jest EP, to sa przenoszone sygnaly nt. co ma robic, a nie poszczegolne pozycje;
|
//youBy: wywalilem to, jak jest EP, to sa przenoszone sygnaly nt. co ma robic, a nie poszczegolne pozycje;
|
||||||
// wystarczy spojrzec na Knorra i Oerlikona EP w EN57; mogly ze soba wspolapracowac
|
// wystarczy spojrzec na Knorra i Oerlikona EP w EN57; mogly ze soba wspolapracowac
|
||||||
@@ -2443,7 +2479,7 @@ with BrakePressureTable[BrakeCtrlPos] do
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then {ulepszony hamulec bezp.}
|
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then {ulepszony hamulec bezp.}
|
||||||
if(EmergencyBrakeFlag)or TestFlag(SecuritySystem.Status,s_SHPebrake) or TestFlag(SecuritySystem.Status,s_CAebrake) or (s_CAtestebrake=true)then {ulepszony hamulec bezp.}
|
if(EmergencyBrakeFlag)or TestFlag(SecuritySystem.Status,s_SHPebrake) or TestFlag(SecuritySystem.Status,s_CAebrake) or (s_CAtestebrake=true) or (TestFlag(EngDmgFlag,32)){ or (not Battery)}then {ulepszony hamulec bezp.}
|
||||||
dpMainValve:=dpMainValve/1+PF(0,PipePress,0.15)*dt;
|
dpMainValve:=dpMainValve/1+PF(0,PipePress,0.15)*dt;
|
||||||
//0.2*Spg
|
//0.2*Spg
|
||||||
Pipe.Flow(-dpMainValve);
|
Pipe.Flow(-dpMainValve);
|
||||||
@@ -2485,6 +2521,12 @@ end;
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
(Hamulec as TLSt).SetLBP(LocBrakePress);
|
(Hamulec as TLSt).SetLBP(LocBrakePress);
|
||||||
|
if (BrakeValve = EStED) then
|
||||||
|
if MBPM<2 then
|
||||||
|
(Hamulec as TEStED).PLC(MaxBrakePress[LoadFlag])
|
||||||
|
else
|
||||||
|
(Hamulec as TEStED).PLC(TotalMass);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
CV1_L_TR:
|
CV1_L_TR:
|
||||||
begin
|
begin
|
||||||
@@ -2570,7 +2612,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
CompressedVolume:=CompressedVolume+dt*CompressorSpeed*(2*MaxCompressor-Compressor)/MaxCompressor;
|
CompressedVolume:=CompressedVolume+dt*CompressorSpeed*(2*MaxCompressor-Compressor)/MaxCompressor;
|
||||||
TotalCurrent:=0.0015*Voltage; //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
TotalCurrent:=TotalCurrent+0.0015*Voltage; //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -2636,11 +2678,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
CompressedVolume:=CompressedVolume+dt*CompressorSpeed*(2*MaxCompressor-Compressor)/MaxCompressor;
|
CompressedVolume:=CompressedVolume+dt*CompressorSpeed*(2*MaxCompressor-Compressor)/MaxCompressor;
|
||||||
if (CompressorPower=5)and(Couplers[1].Connected<>NIL) then
|
if (CompressorPower=5)and(Couplers[1].Connected<>NIL) then
|
||||||
Couplers[1].Connected.TotalCurrent:=0.0015*Couplers[1].Connected.Voltage //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
Couplers[1].Connected.TotalCurrent:=Couplers[1].Connected.TotalCurrent+0.0015*Couplers[1].Connected.Voltage //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
else if (CompressorPower=4)and(Couplers[0].Connected<>NIL) then
|
else if (CompressorPower=4)and(Couplers[0].Connected<>NIL) then
|
||||||
Couplers[0].Connected.TotalCurrent:=0.0015*Couplers[0].Connected.Voltage //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
Couplers[0].Connected.TotalCurrent:=Couplers[0].Connected.TotalCurrent+0.0015*Couplers[0].Connected.Voltage //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
else
|
else
|
||||||
TotalCurrent:=0.0015*Voltage; //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
TotalCurrent:=TotalCurrent+0.0015*Voltage; //tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -2748,7 +2790,7 @@ end;
|
|||||||
function T_MoverParameters.FuseOn: boolean;
|
function T_MoverParameters.FuseOn: boolean;
|
||||||
begin
|
begin
|
||||||
FuseOn:=false;
|
FuseOn:=false;
|
||||||
if (MainCtrlPos=0) and (ScndCtrlPos=0) and (TrainType<>dt_ET40) and Mains then
|
if (MainCtrlPos=0) and (ScndCtrlPos=0) and (TrainType<>dt_ET40) and ((Mains) or (TrainType<>dt_EZT)) and (not TestFlag(EngDmgFlag,1)) then
|
||||||
begin //w ET40 jest blokada nastawnika, ale czy działa dobrze?
|
begin //w ET40 jest blokada nastawnika, ale czy działa dobrze?
|
||||||
SendCtrlToNext('FuseSwitch',1,CabNo);
|
SendCtrlToNext('FuseSwitch',1,CabNo);
|
||||||
if ((EngineType=ElectricSeriesMotor)or((EngineType=DieselElectric))) and FuseFlag then
|
if ((EngineType=ElectricSeriesMotor)or((EngineType=DieselElectric))) and FuseFlag then
|
||||||
@@ -3517,7 +3559,7 @@ var OK:boolean; //b:byte;
|
|||||||
begin
|
begin
|
||||||
//Ra 2014-06: dla SN61 nie działa prawidłowo
|
//Ra 2014-06: dla SN61 nie działa prawidłowo
|
||||||
//rozlaczanie stycznikow liniowych
|
//rozlaczanie stycznikow liniowych
|
||||||
if (not Mains) or (FuseFlag) or (MainCtrlPos=0) or (BrakePress>2.1) or (ActiveDir=0) then //hunter-111211: wylacznik cisnieniowy
|
if (not Mains) or (FuseFlag) or (MainCtrlPos=0) or ((BrakePress>2.1)and(TrainType<>dt_EZT)) or (ActiveDir=0) then //hunter-111211: wylacznik cisnieniowy
|
||||||
begin
|
begin
|
||||||
StLinFlag:=false; //yBARC - rozlaczenie stycznikow liniowych
|
StLinFlag:=false; //yBARC - rozlaczenie stycznikow liniowych
|
||||||
AutoRelayCheck:=false;
|
AutoRelayCheck:=false;
|
||||||
@@ -3534,6 +3576,9 @@ begin
|
|||||||
//brak PSR na tej pozycji działa PSR i prąd poniżej progu na tej pozycji nie działa PSR i pozycja walu ponizej
|
//brak PSR na tej pozycji działa PSR i prąd poniżej progu na tej pozycji nie działa PSR i pozycja walu ponizej
|
||||||
// chodzi w tym wszystkim o to, żeby można było zatrzymać rozruch na jakiejś pozycji wpisując Autoswitch=0 i wymuszać
|
// chodzi w tym wszystkim o to, żeby można było zatrzymać rozruch na jakiejś pozycji wpisując Autoswitch=0 i wymuszać
|
||||||
// przejście dalej przez danie nastawnika na dalszą pozycję - tak to do tej pory działało i na tym się opiera fizyka ET22-2k
|
// przejście dalej przez danie nastawnika na dalszą pozycję - tak to do tej pory działało i na tym się opiera fizyka ET22-2k
|
||||||
|
|
||||||
|
////// LocalBrakePos:=byte(ARFASI)+2*byte(ARFASI2);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if (StLinFlag) then
|
if (StLinFlag) then
|
||||||
begin
|
begin
|
||||||
@@ -3652,7 +3697,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
OK:=false;
|
OK:=false;
|
||||||
//ybARC - tutaj sa wszystkie warunki, jakie musza byc spelnione, zeby mozna byla zalaczyc styczniki liniowe
|
//ybARC - tutaj sa wszystkie warunki, jakie musza byc spelnione, zeby mozna byla zalaczyc styczniki liniowe
|
||||||
if ((MainCtrlPos=1)or((TrainType=dt_EZT)and(MainCtrlPos>0)))and(not FuseFlag)and(Mains)and(BrakePress<1.0)and(MainCtrlActualPos=0)and(ActiveDir<>0) then
|
if ((MainCtrlPos=1)or((TrainType=dt_EZT)and(MainCtrlPos>0)))and(not FuseFlag)and(Mains)and((BrakePress<1.0)or(TrainType=dt_EZT))and(MainCtrlActualPos=0)and(ActiveDir<>0) then
|
||||||
begin
|
begin
|
||||||
DelayCtrlFlag:=true;
|
DelayCtrlFlag:=true;
|
||||||
if (LastRelayTime>=InitialCtrlDelay) then
|
if (LastRelayTime>=InitialCtrlDelay) then
|
||||||
@@ -3962,6 +4007,7 @@ end;
|
|||||||
{SILY}
|
{SILY}
|
||||||
|
|
||||||
function T_MoverParameters.TractionForce(dt:real):real;
|
function T_MoverParameters.TractionForce(dt:real):real;
|
||||||
|
const kv=0.2; ksum=0.05;
|
||||||
var PosRatio,dmoment,dtrans,tmp,tmpV: real;
|
var PosRatio,dmoment,dtrans,tmp,tmpV: real;
|
||||||
i: byte;
|
i: byte;
|
||||||
{oblicza sile trakcyjna lokomotywy (dla elektrowozu tez calkowity prad)}
|
{oblicza sile trakcyjna lokomotywy (dla elektrowozu tez calkowity prad)}
|
||||||
@@ -4291,41 +4337,63 @@ begin
|
|||||||
ElectricInductionMotor:
|
ElectricInductionMotor:
|
||||||
begin
|
begin
|
||||||
if (Mains) then //nie wchodzić w funkcję bez potrzeby
|
if (Mains) then //nie wchodzić w funkcję bez potrzeby
|
||||||
if (Abs(Voltage)<EnginePowerSource.CollectorParameters.MinV) or (Abs(Voltage)>EnginePowerSource.CollectorParameters.MaxV) then
|
if (Abs(Voltage)<EnginePowerSource.CollectorParameters.MinV) or (Abs(Voltage)>EnginePowerSource.CollectorParameters.MaxV+100) then
|
||||||
|
begin
|
||||||
MainSwitch(false);
|
MainSwitch(false);
|
||||||
// tmpV:=V/(Pi*WheelDiameter)*Transmision.Ratio;//*DirAbsolute*eimc[eimc_s_p]; - do przemyslenia dzialanie pp
|
end;
|
||||||
|
tmpV:=abs(nrot)*(Pi*WheelDiameter)*3.6;//*DirAbsolute*eimc[eimc_s_p]; - do przemyslenia dzialanie pp
|
||||||
if (MainS) then
|
if (MainS) then
|
||||||
begin
|
begin
|
||||||
|
|
||||||
if ((Hamulec as TLSt).GetEDBCP<0.25) and (LocHandle.GetCP<0.25) and (AnPos<0.01) then
|
dtrans:=(Hamulec as TLSt).GetEDBCP;
|
||||||
|
if ((dtrans<0.25) and (LocHandle.GetCP<0.25) and (AnPos<0.01)) or ((ShuntModeAllow) and (LocalBrakePos=0)) then
|
||||||
DynamicBrakeFlag:=false
|
DynamicBrakeFlag:=false
|
||||||
else if (((BrakePress>0.25) and ((Hamulec as TLSt).GetEDBCP>0.25) or (LocHandle.GetCP>0.25))) or (AnPos>0.02) then
|
else if (((BrakePress>0.25) and (dtrans>0.25) or (LocHandle.GetCP>0.25))) or (AnPos>0.02) then
|
||||||
DynamicBrakeFlag:=true;
|
DynamicBrakeFlag:=true;
|
||||||
|
dtrans:=(Hamulec as TLSt).GetEDBCP*eimc[eimc_p_abed]; //stala napedu
|
||||||
if(DynamicBrakeFlag)then
|
if(DynamicBrakeFlag)then
|
||||||
begin
|
begin
|
||||||
if eimv[eimv_Fmax]*sign(V)*DirAbsolute<-1 then
|
if eimv[eimv_Fmax]*sign(V)*DirAbsolute<-1 then
|
||||||
PosRatio:=-sign(V)*DirAbsolute*eimv[eimv_Fr]/(eimc[eimc_p_Fh]*Max0R((Hamulec as TLSt).GetEDBCP/MaxBrakePress[0],AnPos){dizel_fill})
|
begin
|
||||||
|
PosRatio:=-sign(V)*DirAbsolute*eimv[eimv_Fr]/(eimc[eimc_p_Fh]*Max0R(dtrans/MaxBrakePress[0],AnPos){dizel_fill});
|
||||||
|
end
|
||||||
else
|
else
|
||||||
PosRatio:=0;
|
PosRatio:=0;
|
||||||
PosRatio:=round(20*Posratio)/20;
|
PosRatio:=round(20*Posratio)/20;
|
||||||
if PosRatio<19.5/20 then PosRatio:=PosRatio*0.9;
|
if PosRatio<19.5/20 then PosRatio:=PosRatio*0.9;
|
||||||
(Hamulec as TLSt).SetED(PosRatio);
|
// if PosRatio<0 then
|
||||||
|
// PosRatio:=2+PosRatio-2;
|
||||||
|
(Hamulec as TLSt).SetED(Max0R(0.0,Min0R(PosRatio,1)));
|
||||||
// (Hamulec as TLSt).SetLBP(LocBrakePress*(1-PosRatio));
|
// (Hamulec as TLSt).SetLBP(LocBrakePress*(1-PosRatio));
|
||||||
PosRatio:=-Max0R(Min0R((Hamulec as TLSt).GetEDBCP/MaxBrakePress[0],1),AnPos)*Max0R(0,Min0R(1,(Vel-eimc[eimc_p_Vh0])/(eimc[eimc_p_Vh1]-eimc[eimc_p_Vh0])));
|
PosRatio:=-Max0R(Min0R(dtrans/MaxBrakePress[0],1),AnPos)*Max0R(0,Min0R(1,(Vel-eimc[eimc_p_Vh0])/(eimc[eimc_p_Vh1]-eimc[eimc_p_Vh0])));
|
||||||
eimv[eimv_Fzad]:=-Max0R(LocalBrakeRatio,(Hamulec as TLSt).GetEDBCP/MaxBrakePress[0]);
|
eimv[eimv_Fzad]:=-Max0R(LocalBrakeRatio,dtrans/MaxBrakePress[0]);
|
||||||
tmp:=5;
|
tmp:=5;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
PosRatio:=(MainCtrlPos/MainCtrlPosNo);
|
PosRatio:=(MainCtrlPos/MainCtrlPosNo);
|
||||||
eimv[eimv_Fzad]:=PosRatio;
|
eimv[eimv_Fzad]:=PosRatio;
|
||||||
|
if(Flat)and(eimc[eimc_p_F0]*eimv[eimv_Fful]>0)then
|
||||||
|
PosRatio:=Min0R(PosRatio*eimc[eimc_p_F0]/eimv[eimv_Fful],1);
|
||||||
|
if ScndCtrlActualPos>0 then
|
||||||
|
if (Vmax<250) then
|
||||||
|
PosRatio:=Min0R(PosRatio,Max0R(-1,0.5*(ScndCtrlActualPos-Vel)))
|
||||||
|
else
|
||||||
|
PosRatio:=Min0R(PosRatio,Max0R(-1,0.5*(ScndCtrlActualPos*2-Vel)));
|
||||||
PosRatio:=1.0*(PosRatio*0+1)*PosRatio;
|
PosRatio:=1.0*(PosRatio*0+1)*PosRatio;
|
||||||
(Hamulec as TLSt).SetED(0);
|
(Hamulec as TLSt).SetED(0);
|
||||||
// (Hamulec as TLSt).SetLBP(LocBrakePress);
|
// (Hamulec as TLSt).SetLBP(LocBrakePress);
|
||||||
if (PosRatio>dizel_fill) then tmp:=1 else tmp:=4; //szybkie malenie, powolne wzrastanie
|
if (PosRatio>dizel_fill) then tmp:=1 else tmp:=4; //szybkie malenie, powolne wzrastanie
|
||||||
end;
|
end;
|
||||||
if SlippingWheels then begin PosRatio:=0; tmp:=10; SandDoseOn; end;//przeciwposlizg
|
// if SlippingWheels then begin PosRatio:=0; tmp:=10; SandDoseOn; end;//przeciwposlizg
|
||||||
|
|
||||||
|
// if(Flat)then //PRZECIWPOŚLIZG
|
||||||
|
dmoment:=eimv[eimv_Fful];
|
||||||
|
// else
|
||||||
|
// dmoment:=eimc[eimc_p_F0]*0.99;
|
||||||
|
if (abs((PosRatio+9.66*dizel_fill)*dmoment*100)>Adhesive(RunningTrack.friction)*TotalMassxg) then begin PosRatio:=0; tmp:=4; SandDoseOn; end;//przeciwposlizg
|
||||||
|
if (abs((PosRatio+9.80*dizel_fill)*dmoment*100)>Adhesive(RunningTrack.friction)*TotalMassxg) then begin PosRatio:=0; tmp:=9; SandDoseOn; end;//przeciwposlizg
|
||||||
|
if (SlippingWheels) then begin PosRatio:=-PosRatio*0; tmp:=9; SandDoseOn; end;//przeciwposlizg
|
||||||
|
|
||||||
dizel_fill:=dizel_fill+Max0R(Min0R(PosRatio-dizel_fill,0.1),-0.1)*2*(tmp{2{+4*byte(PosRatio<dizel_fill)})*dt; //wartość zadana/procent czegoś
|
dizel_fill:=dizel_fill+Max0R(Min0R(PosRatio-dizel_fill,0.1),-0.1)*2*(tmp{2{+4*byte(PosRatio<dizel_fill)})*dt; //wartość zadana/procent czegoś
|
||||||
|
|
||||||
@@ -4333,12 +4401,12 @@ begin
|
|||||||
|
|
||||||
eimv[eimv_Uzsmax]:=Min0R(Voltage-eimc[eimc_f_DU],tmp);
|
eimv[eimv_Uzsmax]:=Min0R(Voltage-eimc[eimc_f_DU],tmp);
|
||||||
eimv[eimv_fkr]:=eimv[eimv_Uzsmax]/eimc[eimc_f_cfu];
|
eimv[eimv_fkr]:=eimv[eimv_Uzsmax]/eimc[eimc_f_cfu];
|
||||||
if(DynamicBrakeFlag)then
|
if(dizel_fill<0)then
|
||||||
eimv[eimv_Pmax]:=eimc[eimc_p_Ph]
|
eimv[eimv_Pmax]:=eimc[eimc_p_Ph]
|
||||||
else
|
else
|
||||||
eimv[eimv_Pmax]:=Min0R(eimc[eimc_p_Pmax],0.001*Voltage*(eimc[eimc_p_Imax]-eimc[eimc_f_I0])*Pirazy2*eimc[eimc_s_cim]/eimc[eimc_s_p]/eimc[eimc_s_cfu]);
|
eimv[eimv_Pmax]:=Min0R(eimc[eimc_p_Pmax],0.001*Voltage*(eimc[eimc_p_Imax]-eimc[eimc_f_I0])*Pirazy2*eimc[eimc_s_cim]/eimc[eimc_s_p]/eimc[eimc_s_cfu]);
|
||||||
eimv[eimv_FMAXMAX]:=0.001*SQR(Min0R(eimv[eimv_fkr]/Max0R(abs(enrot)*eimc[eimc_s_p]+eimc[eimc_s_dfmax]*eimv[eimv_ks],eimc[eimc_s_dfmax]),1)*eimc[eimc_f_cfu]/eimc[eimc_s_cfu])*(eimc[eimc_s_dfmax]*eimc[eimc_s_dfic]*eimc[eimc_s_cim])*Transmision.Ratio*NPoweredAxles*2/WheelDiameter;
|
eimv[eimv_FMAXMAX]:=0.001*SQR(Min0R(eimv[eimv_fkr]/Max0R(abs(enrot)*eimc[eimc_s_p]+eimc[eimc_s_dfmax]*eimv[eimv_ks],eimc[eimc_s_dfmax]),1)*eimc[eimc_f_cfu]/eimc[eimc_s_cfu])*(eimc[eimc_s_dfmax]*eimc[eimc_s_dfic]*eimc[eimc_s_cim])*Transmision.Ratio*NPoweredAxles*2/WheelDiameter;
|
||||||
if(DynamicBrakeFlag)then
|
if(dizel_fill<0)then
|
||||||
begin
|
begin
|
||||||
eimv[eimv_Fful]:=Min0R(eimc[eimc_p_Ph]*3.6/Vel,Min0R(eimc[eimc_p_Fh],eimv[eimv_FMAXMAX]));
|
eimv[eimv_Fful]:=Min0R(eimc[eimc_p_Ph]*3.6/Vel,Min0R(eimc[eimc_p_Fh],eimv[eimv_FMAXMAX]));
|
||||||
eimv[eimv_Fmax]:=-sign(V)*(DirAbsolute)*Min0R(eimc[eimc_p_Ph]*3.6/Vel,Min0R(-eimc[eimc_p_Fh]*dizel_fill,eimv[eimv_FMAXMAX]));//*Min0R(1,(Vel-eimc[eimc_p_Vh0])/(eimc[eimc_p_Vh1]-eimc[eimc_p_Vh0]))
|
eimv[eimv_Fmax]:=-sign(V)*(DirAbsolute)*Min0R(eimc[eimc_p_Ph]*3.6/Vel,Min0R(-eimc[eimc_p_Fh]*dizel_fill,eimv[eimv_FMAXMAX]));//*Min0R(1,(Vel-eimc[eimc_p_Vh0])/(eimc[eimc_p_Vh1]-eimc[eimc_p_Vh0]))
|
||||||
@@ -4346,7 +4414,10 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
eimv[eimv_Fful]:=Min0R(Min0R(3.6*eimv[eimv_Pmax]/Max0R(Vel,1),eimc[eimc_p_F0]-Vel*eimc[eimc_p_a1]),eimv[eimv_FMAXMAX]);
|
eimv[eimv_Fful]:=Min0R(Min0R(3.6*eimv[eimv_Pmax]/Max0R(Vel,1),eimc[eimc_p_F0]-Vel*eimc[eimc_p_a1]),eimv[eimv_FMAXMAX]);
|
||||||
eimv[eimv_Fmax]:=eimv[eimv_Fful]*dizel_fill;
|
// if(not Flat)then
|
||||||
|
eimv[eimv_Fmax]:=eimv[eimv_Fful]*dizel_fill
|
||||||
|
// else
|
||||||
|
// eimv[eimv_Fmax]:=Min0R(eimc[eimc_p_F0]*dizel_fill,eimv[eimv_Fful]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -4369,7 +4440,13 @@ begin
|
|||||||
eimv[eimv_eta]:=eimv[eimv_Pm]/eimv[eimv_Pe];
|
eimv[eimv_eta]:=eimv[eimv_Pm]/eimv[eimv_Pe];
|
||||||
|
|
||||||
Im:=eimv[eimv_If];
|
Im:=eimv[eimv_If];
|
||||||
Itot:=eimv[eimv_Ipoj];
|
if (eimv[eimv_Ipoj]>=0) then
|
||||||
|
Vadd:=Vadd*(1-2*dt)
|
||||||
|
else if (Voltage<EnginePowerSource.CollectorParameters.MaxV) then
|
||||||
|
Vadd:=Vadd*(1-dt)
|
||||||
|
else
|
||||||
|
Vadd:=Max0R(Vadd*(1-0.2*dt),0.02*(Voltage-EnginePowerSource.CollectorParameters.MaxV));
|
||||||
|
Itot:=eimv[eimv_Ipoj]*(0.01+Min0R(0.99,0.99-Vadd));
|
||||||
|
|
||||||
|
|
||||||
EnginePower:=Abs(eimv[eimv_Ic]*eimv[eimv_U]*NPoweredAxles)/1000;
|
EnginePower:=Abs(eimv[eimv_Ic]*eimv[eimv_U]*NPoweredAxles)/1000;
|
||||||
@@ -4392,11 +4469,20 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Im:=0;Mm:=0;Mw:=0;Fw:=0;Ft:=0;Itot:=0;dizel_fill:=0;EnginePower:=0;
|
Im:=0;Mm:=0;Mw:=0;Fw:=0;Ft:=0;Itot:=0;dizel_fill:=0;EnginePower:=0;
|
||||||
|
for i:=1 to 20 do
|
||||||
|
eimv[i]:=0;
|
||||||
(Hamulec as TLSt).SetED(0);RventRot:=0.0;//(Hamulec as TLSt).SetLBP(LocBrakePress);
|
(Hamulec as TLSt).SetED(0);RventRot:=0.0;//(Hamulec as TLSt).SetLBP(LocBrakePress);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
None: begin end;
|
None: begin end;
|
||||||
end; {case EngineType}
|
end {case EngineType}
|
||||||
|
else if EngineType=ElectricInductionMotor then
|
||||||
|
begin
|
||||||
|
Im:=0;Mm:=0;Mw:=0;Fw:=0;Ft:=0;Itot:=0;dizel_fill:=0;EnginePower:=0;
|
||||||
|
for i:=1 to 20 do
|
||||||
|
eimv[i]:=0;
|
||||||
|
(Hamulec as TLSt).SetED(0);RventRot:=0.0;//(Hamulec as TLSt).SetLBP(LocBrakePress);
|
||||||
|
end;
|
||||||
TractionForce:=Ft
|
TractionForce:=Ft
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -4792,10 +4878,10 @@ begin
|
|||||||
else
|
else
|
||||||
Voltage:=RunningTraction.TractionVoltage*DirAbsolute; //ActiveDir*CabNo;
|
Voltage:=RunningTraction.TractionVoltage*DirAbsolute; //ActiveDir*CabNo;
|
||||||
end {bo nie dzialalo}
|
end {bo nie dzialalo}
|
||||||
|
else if (EngineType=ElectricInductionMotor) or (((Couplers[0].CouplingFlag and ctrain_power)=ctrain_power) or ((Couplers[1].CouplingFlag and ctrain_power)=ctrain_power)) then //potem ulepszyc! pantogtrafy!
|
||||||
|
Voltage:=Max0R(Max0R(RunningTraction.TractionVoltage,HVCouplers[0][1]),HVCouplers[1][1])
|
||||||
else
|
else
|
||||||
Voltage:=0;
|
Voltage:=0;
|
||||||
if Mains and {(Abs(CabNo)<2) and} (EngineType=ElectricInductionMotor) then //potem ulepszyc! pantogtrafy!
|
|
||||||
Voltage:=Max0R(Max0R(RunningTraction.TractionVoltage,HVCouplers[0][1]),HVCouplers[1][1]);
|
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
if Power>0 then
|
if Power>0 then
|
||||||
@@ -4864,17 +4950,19 @@ var b:byte;
|
|||||||
const Vepsilon=1e-5; Aepsilon=1e-3; //ASBSpeed=0.8;
|
const Vepsilon=1e-5; Aepsilon=1e-3; //ASBSpeed=0.8;
|
||||||
begin
|
begin
|
||||||
TotalCurrent:=0;
|
TotalCurrent:=0;
|
||||||
|
hvc:=Max0R(PantFrontVolt,PantRearVolt);
|
||||||
for b:=0 to 1 do //przekazywanie napiec
|
for b:=0 to 1 do //przekazywanie napiec
|
||||||
if ((Couplers[b].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[b].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then
|
if ((Couplers[b].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[b].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then
|
||||||
begin
|
begin
|
||||||
HVCouplers[1-b][1]:=Max0R(Abs(ElectricTraction.TractionVoltage),Couplers[b].Connected.HVCouplers[Couplers[b].ConnectedNr][1]*0.99);
|
HVCouplers[1-b][1]:=Max0R(Abs(hvc),Couplers[b].Connected.HVCouplers[Couplers[b].ConnectedNr][1]-HVCouplers[b][0]*0.02);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
HVCouplers[1-b][1]:=Abs(ElectricTraction.TractionVoltage);//Max0R(Abs(Voltage),0);
|
HVCouplers[1-b][1]:=Abs(hvc)-HVCouplers[b][0]*0.02;//Max0R(Abs(Voltage),0);
|
||||||
// end;
|
// end;
|
||||||
|
|
||||||
hvc:=HVCouplers[0][1]+HVCouplers[1][1];
|
hvc:=HVCouplers[0][1]+HVCouplers[1][1];
|
||||||
if (Abs(ElectricTraction.TractionVoltage)<1) and (hvc>1)then //bez napiecia, ale jest cos na sprzegach:
|
|
||||||
|
if (Abs(PantFrontVolt)+Abs(PantRearVolt)<1) and (hvc>1)then //bez napiecia, ale jest cos na sprzegach:
|
||||||
begin
|
begin
|
||||||
for b:=0 to 1 do //przekazywanie pradow
|
for b:=0 to 1 do //przekazywanie pradow
|
||||||
if ((Couplers[b].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[b].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then //jesli spiety
|
if ((Couplers[b].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[b].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then //jesli spiety
|
||||||
@@ -4888,12 +4976,14 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
TotalCurrent:=HVCouplers[0][0]+HVCouplers[1][0];
|
if ((Couplers[0].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[0].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then
|
||||||
|
TotalCurrent:=TotalCurrent+Couplers[0].Connected.HVCouplers[1-Couplers[0].ConnectedNr][0];
|
||||||
|
if ((Couplers[1].CouplingFlag and ctrain_power) = ctrain_power)or(((Couplers[1].CouplingFlag and ctrain_heating) = ctrain_heating)and(Heating)) then
|
||||||
|
TotalCurrent:=TotalCurrent+Couplers[1].Connected.HVCouplers[1-Couplers[1].ConnectedNr][0];
|
||||||
HVCouplers[0][0]:=0;
|
HVCouplers[0][0]:=0;
|
||||||
HVCouplers[1][0]:=0;
|
HVCouplers[1][0]:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
ClearPendingExceptions;
|
ClearPendingExceptions;
|
||||||
if not TestFlag(DamageFlag,dtrain_out) then
|
if not TestFlag(DamageFlag,dtrain_out) then
|
||||||
begin //Ra: to przepisywanie tu jest bez sensu
|
begin //Ra: to przepisywanie tu jest bez sensu
|
||||||
@@ -5188,6 +5278,14 @@ Begin
|
|||||||
end
|
end
|
||||||
else if command='ScndCtrl' then
|
else if command='ScndCtrl' then
|
||||||
begin
|
begin
|
||||||
|
if (EngineType=ElectricInductionMotor) then
|
||||||
|
if (ScndCtrlPos=0) and (Trunc(CValue1)>0) then
|
||||||
|
if (Vmax<250) then
|
||||||
|
ScndCtrlActualPos:=Round(Vel+0.5)
|
||||||
|
else
|
||||||
|
ScndCtrlActualPos:=Round(Vel/2+0.5)
|
||||||
|
else if (Trunc(CValue1)=0) then
|
||||||
|
ScndCtrlActualPos:=0;
|
||||||
if ScndCtrlPosNo>=Trunc(CValue1) then
|
if ScndCtrlPosNo>=Trunc(CValue1) then
|
||||||
ScndCtrlPos:=Trunc(CValue1);
|
ScndCtrlPos:=Trunc(CValue1);
|
||||||
OK:=SendCtrlToNext(command,CValue1,CValue2);
|
OK:=SendCtrlToNext(command,CValue1,CValue2);
|
||||||
@@ -5431,7 +5529,7 @@ Begin
|
|||||||
end
|
end
|
||||||
else if command='Emergency_brake' then
|
else if command='Emergency_brake' then
|
||||||
begin
|
begin
|
||||||
if EmergencyBrakeSwitch(Trunc(CValue1)=1) then
|
if EmergencyBrakeSwitch(Trunc(CValue1)=1) then //YB: czy to jest potrzebne?
|
||||||
OK:=true
|
OK:=true
|
||||||
else OK:=false;
|
else OK:=false;
|
||||||
end
|
end
|
||||||
@@ -5558,6 +5656,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
WheelDiameter:=1.0;
|
WheelDiameter:=1.0;
|
||||||
BrakeCtrlPosNo:=0;
|
BrakeCtrlPosNo:=0;
|
||||||
|
LightsPosNo:=0;
|
||||||
|
LightsDefPos:=1;
|
||||||
for k:=-1 to MainBrakeMaxPos do
|
for k:=-1 to MainBrakeMaxPos do
|
||||||
with BrakePressureTable[k] do
|
with BrakePressureTable[k] do
|
||||||
begin
|
begin
|
||||||
@@ -5637,6 +5737,9 @@ begin
|
|||||||
InsideConsist:=false;
|
InsideConsist:=false;
|
||||||
CompressorPower:=1;
|
CompressorPower:=1;
|
||||||
SmallCompressorPower:=0;
|
SmallCompressorPower:=0;
|
||||||
|
for b:=0 to 25 do
|
||||||
|
eimc[b]:=0;
|
||||||
|
eimc[eimc_p_eped]:=1.5;
|
||||||
|
|
||||||
ScndInMain:=false;
|
ScndInMain:=false;
|
||||||
|
|
||||||
@@ -5668,6 +5771,7 @@ begin
|
|||||||
ScndCtrlPos:=0;
|
ScndCtrlPos:=0;
|
||||||
MainCtrlActualPos:=0;
|
MainCtrlActualPos:=0;
|
||||||
ScndCtrlActualPos:=0;
|
ScndCtrlActualPos:=0;
|
||||||
|
LightsPos:=0;
|
||||||
Heating:=false;
|
Heating:=false;
|
||||||
Mains:=false;
|
Mains:=false;
|
||||||
ActiveDir:=0; //kierunek nie ustawiony
|
ActiveDir:=0; //kierunek nie ustawiony
|
||||||
@@ -5731,6 +5835,8 @@ begin
|
|||||||
dizel_enginestart:=false;
|
dizel_enginestart:=false;
|
||||||
dizel_engagedeltaomega:=0;
|
dizel_engagedeltaomega:=0;
|
||||||
PhysicActivation:=true;
|
PhysicActivation:=true;
|
||||||
|
for b:=1 to 20 do
|
||||||
|
eimv[b]:=0;
|
||||||
|
|
||||||
with RunningShape do
|
with RunningShape do
|
||||||
begin
|
begin
|
||||||
@@ -5911,6 +6017,10 @@ case BrakeValve of
|
|||||||
EStED :begin
|
EStED :begin
|
||||||
Hamulec := TEStED.Create(MaxBrakePress[3], BrakeCylRadius, BrakeCylDist, BrakeVVolume, BrakeCylNo, BrakeDelays, BrakeMethod, NAxles, NBpA);
|
Hamulec := TEStED.Create(MaxBrakePress[3], BrakeCylRadius, BrakeCylDist, BrakeVVolume, BrakeCylNo, BrakeDelays, BrakeMethod, NAxles, NBpA);
|
||||||
(Hamulec as TEStED).SetRM(RapidMult);
|
(Hamulec as TEStED).SetRM(RapidMult);
|
||||||
|
if(MBPM<2)then //jesli przystawka wazaca
|
||||||
|
(Hamulec as TEStED).SetLP(0,MaxBrakePress[3],0)
|
||||||
|
else
|
||||||
|
(Hamulec as TEStED).SetLP(Mass, MBPM, MaxBrakePress[1]);
|
||||||
end;
|
end;
|
||||||
EP2:begin
|
EP2:begin
|
||||||
Hamulec :=TEStEP2.Create(MaxBrakePress[3], BrakeCylRadius, BrakeCylDist, BrakeVVolume, BrakeCylNo, BrakeDelays, BrakeMethod, NAxles, NBpA);
|
Hamulec :=TEStEP2.Create(MaxBrakePress[3], BrakeCylRadius, BrakeCylDist, BrakeVVolume, BrakeCylNo, BrakeDelays, BrakeMethod, NAxles, NBpA);
|
||||||
@@ -5943,6 +6053,8 @@ case BrakeLocHandle of
|
|||||||
begin
|
begin
|
||||||
LocHandle := TFD1.Create;
|
LocHandle := TFD1.Create;
|
||||||
LocHandle.Init(MaxBrakePress[0]);
|
LocHandle.Init(MaxBrakePress[0]);
|
||||||
|
if(TrainType=dt_EZT)then
|
||||||
|
(LocHandle as TFD1).SetSpeed(3.5);
|
||||||
end;
|
end;
|
||||||
Knorr:
|
Knorr:
|
||||||
begin
|
begin
|
||||||
@@ -5964,6 +6076,8 @@ end;
|
|||||||
Pipe.CreateCap((Max0R(Dim.L,14)+0.5)*Spg*1); //dlugosc x przekroj x odejscia i takie tam
|
Pipe.CreateCap((Max0R(Dim.L,14)+0.5)*Spg*1); //dlugosc x przekroj x odejscia i takie tam
|
||||||
Pipe2.CreateCap((Max0R(Dim.L,14)+0.5)*Spg*1);
|
Pipe2.CreateCap((Max0R(Dim.L,14)+0.5)*Spg*1);
|
||||||
|
|
||||||
|
if LightsPosNo>0 then LightsPos:=LightsDefPos;
|
||||||
|
|
||||||
{to dac potem do init}
|
{to dac potem do init}
|
||||||
if ReadyFlag then {gotowy do drogi}
|
if ReadyFlag then {gotowy do drogi}
|
||||||
begin
|
begin
|
||||||
@@ -5992,8 +6106,8 @@ end;
|
|||||||
CompressedVolume:=VeselVolume*MinCompressor*0.55;
|
CompressedVolume:=VeselVolume*MinCompressor*0.55;
|
||||||
ScndPipePress:=5.1;
|
ScndPipePress:=5.1;
|
||||||
PipePress:=LowPipePress;
|
PipePress:=LowPipePress;
|
||||||
PipeBrakePress:=MaxBrakePress[3];
|
PipeBrakePress:=MaxBrakePress[3]*0.5;
|
||||||
BrakePress:=MaxBrakePress[3];
|
BrakePress:=MaxBrakePress[3]*0.5;
|
||||||
LocalBrakePos:=0;
|
LocalBrakePos:=0;
|
||||||
// if (BrakeSystem=Pneumatic) and (BrakeCtrlPosNo>0) then
|
// if (BrakeSystem=Pneumatic) and (BrakeCtrlPosNo>0) then
|
||||||
// BrakeCtrlPos:=-2; //Ra: hamulec jest poprawiany w DynObj.cpp
|
// BrakeCtrlPos:=-2; //Ra: hamulec jest poprawiany w DynObj.cpp
|
||||||
@@ -6578,6 +6692,7 @@ begin
|
|||||||
if s='P10-Bg' then BrakeMethod:=bp_P10Bg else
|
if s='P10-Bg' then BrakeMethod:=bp_P10Bg else
|
||||||
if s='P10-Bgu' then BrakeMethod:=bp_P10Bgu else
|
if s='P10-Bgu' then BrakeMethod:=bp_P10Bgu else
|
||||||
if s='FR513' then BrakeMethod:=bp_FR513 else
|
if s='FR513' then BrakeMethod:=bp_FR513 else
|
||||||
|
if s='FR510' then BrakeMethod:=bp_FR510 else
|
||||||
if s='Cosid' then BrakeMethod:=bp_Cosid else
|
if s='Cosid' then BrakeMethod:=bp_Cosid else
|
||||||
if s='P10yBg' then BrakeMethod:=bp_P10yBg else
|
if s='P10yBg' then BrakeMethod:=bp_P10yBg else
|
||||||
if s='P10yBgu' then BrakeMethod:=bp_P10yBgu else
|
if s='P10yBgu' then BrakeMethod:=bp_P10yBgu else
|
||||||
@@ -6656,6 +6771,7 @@ begin
|
|||||||
s:=DUE(ExtractKeyWord(lines,'DoorOpenMethod='));
|
s:=DUE(ExtractKeyWord(lines,'DoorOpenMethod='));
|
||||||
if s='Shift' then DoorOpenMethod:=1 //przesuw
|
if s='Shift' then DoorOpenMethod:=1 //przesuw
|
||||||
else if s='Fold' then DoorOpenMethod:=3 //3 submodele się obracają
|
else if s='Fold' then DoorOpenMethod:=3 //3 submodele się obracają
|
||||||
|
else if s='Plug' then DoorOpenMethod:=4 //odskokowo-przesuwne
|
||||||
else
|
else
|
||||||
DoorOpenMethod:=2; //obrót
|
DoorOpenMethod:=2; //obrót
|
||||||
s:=DUE(ExtractKeyWord(lines,'DoorClosureWarning='));
|
s:=DUE(ExtractKeyWord(lines,'DoorClosureWarning='));
|
||||||
@@ -6667,6 +6783,16 @@ begin
|
|||||||
if s='Yes' then DoorBlocked:=true
|
if s='Yes' then DoorBlocked:=true
|
||||||
else
|
else
|
||||||
DoorBlocked:=false;
|
DoorBlocked:=false;
|
||||||
|
s:=ExtractKeyWord(lines,'DoorMaxShiftPlug=');
|
||||||
|
DoorMaxPlugShift:=s2r(DUE(s));
|
||||||
|
s:=ExtractKeyWord(lines,'PlatformSpeed=');
|
||||||
|
PlatformSpeed:=s2r(DUE(s));
|
||||||
|
s:=ExtractKeyWord(lines,'PlatformMaxSpeed=');
|
||||||
|
PlatformMaxShift:=s2r(DUE(s));
|
||||||
|
s:=DUE(ExtractKeyWord(lines,'PlatformOpenMethod='));
|
||||||
|
if s='Shift' then PlatformOpenMethod:=1 //przesuw
|
||||||
|
else
|
||||||
|
PlatformOpenMethod:=2; //obrót
|
||||||
end
|
end
|
||||||
else if (Pos('BuffCoupl.',lines)>0) or (Pos('BuffCoupl1.',lines)>0) then {zderzaki i sprzegi}
|
else if (Pos('BuffCoupl.',lines)>0) or (Pos('BuffCoupl1.',lines)>0) then {zderzaki i sprzegi}
|
||||||
begin
|
begin
|
||||||
@@ -7183,7 +7309,9 @@ begin
|
|||||||
s:=ExtractKeyWord(lines,'Vh0='); eimc[eimc_p_Vh0]:=s2r(DUE(s));
|
s:=ExtractKeyWord(lines,'Vh0='); eimc[eimc_p_Vh0]:=s2r(DUE(s));
|
||||||
s:=ExtractKeyWord(lines,'Vh1='); eimc[eimc_p_Vh1]:=s2r(DUE(s));
|
s:=ExtractKeyWord(lines,'Vh1='); eimc[eimc_p_Vh1]:=s2r(DUE(s));
|
||||||
s:=ExtractKeyWord(lines,'Imax='); eimc[eimc_p_Imax]:=s2r(DUE(s));
|
s:=ExtractKeyWord(lines,'Imax='); eimc[eimc_p_Imax]:=s2r(DUE(s));
|
||||||
|
s:=ExtractKeyWord(lines,'abed='); if DUE(s)<>'' then eimc[eimc_p_abed]:=s2r(DUE(s));
|
||||||
|
s:=ExtractKeyWord(lines,'edep='); if DUE(s)<>'' then eimc[eimc_p_eped]:=s2r(DUE(s));
|
||||||
|
s:=ExtractKeyWord(lines,'Flat='); if DUE(s)='Yes' then Flat:=true else Flat:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
else ConversionError:=-13; {not implemented yet!}
|
else ConversionError:=-13; {not implemented yet!}
|
||||||
@@ -7377,6 +7505,14 @@ begin
|
|||||||
RListSize:=s2b(DUE(ExtractKeyWord(lines,'Size=')));
|
RListSize:=s2b(DUE(ExtractKeyWord(lines,'Size=')));
|
||||||
for k:=0 to RListSize do
|
for k:=0 to RListSize do
|
||||||
readln(fin, DEList[k].rpm, DEList[k].genpower)
|
readln(fin, DEList[k].rpm, DEList[k].genpower)
|
||||||
|
end
|
||||||
|
else if (Pos('LightsList:',lines)>0) then {dla asynchronow}
|
||||||
|
begin
|
||||||
|
LightsPosNo:=s2b(DUE(ExtractKeyWord(lines,'Size=')));
|
||||||
|
LightsWrap:=('Yes')=(DUE(ExtractKeyWord(lines,'Wrap=')));
|
||||||
|
LightsDefPos:=s2b(DUE(ExtractKeyWord(lines,'Default=')));
|
||||||
|
for k:=1 to LightsPosNo do
|
||||||
|
readln(fin, Lights[0][k], Lights[1][k])
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -322,11 +322,17 @@ private:
|
|||||||
bool Zamykajacy;
|
bool Zamykajacy;
|
||||||
bool Przys_blok;
|
bool Przys_blok;
|
||||||
TReservoir* Miedzypoj;
|
TReservoir* Miedzypoj;
|
||||||
|
double TareM;
|
||||||
|
double LoadM;
|
||||||
|
double TareBP;
|
||||||
|
double LoadC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void __fastcall Init(double PP, double HPP, double LPP, double BP, Byte BDF);
|
virtual void __fastcall Init(double PP, double HPP, double LPP, double BP, Byte BDF);
|
||||||
virtual double __fastcall GetPF(double PP, double dt, double Vel);
|
virtual double __fastcall GetPF(double PP, double dt, double Vel);
|
||||||
virtual double __fastcall GetEDBCP(void);
|
virtual double __fastcall GetEDBCP(void);
|
||||||
|
void __fastcall PLC(double mass);
|
||||||
|
void __fastcall SetLP(double TM, double LM, double TBP);
|
||||||
public:
|
public:
|
||||||
#pragma option push -w-inl
|
#pragma option push -w-inl
|
||||||
/* TBrake.Create */ inline __fastcall TEStED(double i_mbp, double i_bcr, double i_bcd, double i_brc
|
/* TBrake.Create */ inline __fastcall TEStED(double i_mbp, double i_bcr, double i_bcd, double i_brc
|
||||||
@@ -692,9 +698,11 @@ private:
|
|||||||
double BP;
|
double BP;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
double Speed;
|
||||||
virtual double __fastcall GetPF(double i_bcp, double pp, double hp, double dt, double ep);
|
virtual double __fastcall GetPF(double i_bcp, double pp, double hp, double dt, double ep);
|
||||||
virtual void __fastcall Init(double press);
|
virtual void __fastcall Init(double press);
|
||||||
virtual double __fastcall GetCP(void);
|
virtual double __fastcall GetCP(void);
|
||||||
|
void __fastcall SetSpeed(double nSpeed);
|
||||||
public:
|
public:
|
||||||
#pragma option push -w-inl
|
#pragma option push -w-inl
|
||||||
/* TObject.Create */ inline __fastcall TFD1(void) : THandle() { }
|
/* TObject.Create */ inline __fastcall TFD1(void) : THandle() { }
|
||||||
@@ -802,6 +810,7 @@ static const Shortint bp_PKPBgu = 0xe;
|
|||||||
static const Byte bp_MHS = 0x80;
|
static const Byte bp_MHS = 0x80;
|
||||||
static const Shortint bp_P10yBg = 0xf;
|
static const Shortint bp_P10yBg = 0xf;
|
||||||
static const Shortint bp_P10yBgu = 0x10;
|
static const Shortint bp_P10yBgu = 0x10;
|
||||||
|
static const Shortint bp_FR510 = 0x11;
|
||||||
static const Shortint sf_Acc = 0x1;
|
static const Shortint sf_Acc = 0x1;
|
||||||
static const Shortint sf_BR = 0x2;
|
static const Shortint sf_BR = 0x2;
|
||||||
static const Shortint sf_CylB = 0x4;
|
static const Shortint sf_CylB = 0x4;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ CONST
|
|||||||
bp_MHS = 128; //magnetyczny hamulec szynowy
|
bp_MHS = 128; //magnetyczny hamulec szynowy
|
||||||
bp_P10yBg = 15; //żeliwo fosforowe P10
|
bp_P10yBg = 15; //żeliwo fosforowe P10
|
||||||
bp_P10yBgu= 16;
|
bp_P10yBgu= 16;
|
||||||
|
bp_FR510 = 17; //Frenoplast FR510
|
||||||
|
|
||||||
sf_Acc = 1; //przyspieszacz
|
sf_Acc = 1; //przyspieszacz
|
||||||
sf_BR = 2; //przekladnia
|
sf_BR = 2; //przekladnia
|
||||||
@@ -289,10 +290,15 @@ TYPE
|
|||||||
Zamykajacy: boolean; //pamiec zaworka zamykajacego
|
Zamykajacy: boolean; //pamiec zaworka zamykajacego
|
||||||
Przys_blok: boolean; //blokada przyspieszacza
|
Przys_blok: boolean; //blokada przyspieszacza
|
||||||
Miedzypoj: TReservoir; //pojemnosc posrednia (urojona) do napelniania ZP i ZS
|
Miedzypoj: TReservoir; //pojemnosc posrednia (urojona) do napelniania ZP i ZS
|
||||||
|
TareM, LoadM: real; //masa proznego i pelnego
|
||||||
|
TareBP: real; //cisnienie dla proznego
|
||||||
|
LoadC: real;
|
||||||
public
|
public
|
||||||
procedure Init(PP, HPP, LPP, BP: real; BDF: byte); override;
|
procedure Init(PP, HPP, LPP, BP: real; BDF: byte); override;
|
||||||
function GetPF(PP, dt, Vel: real): real; override; //przeplyw miedzy komora wstepna i PG
|
function GetPF(PP, dt, Vel: real): real; override; //przeplyw miedzy komora wstepna i PG
|
||||||
function GetEDBCP: real; override; //cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED w EP09
|
function GetEDBCP: real; override; //cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED w EP09
|
||||||
|
procedure PLC(mass: real); //wspolczynnik cisnienia przystawki wazacej
|
||||||
|
procedure SetLP(TM, LM, TBP: real); //parametry przystawki wazacej
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TEStEP2= class(TLSt)
|
TEStEP2= class(TLSt)
|
||||||
@@ -489,9 +495,11 @@ TYPE
|
|||||||
MaxBP: real; //najwyzsze cisnienie
|
MaxBP: real; //najwyzsze cisnienie
|
||||||
BP: real; //aktualne cisnienie
|
BP: real; //aktualne cisnienie
|
||||||
public
|
public
|
||||||
|
Speed: real; //szybkosc dzialania
|
||||||
function GetPF(i_bcp:real; pp, hp, dt, ep: real): real; override;
|
function GetPF(i_bcp:real; pp, hp, dt, ep: real): real; override;
|
||||||
procedure Init(press: real); override;
|
procedure Init(press: real); override;
|
||||||
function GetCP(): real; override;
|
function GetCP(): real; override;
|
||||||
|
procedure SetSpeed(nSpeed: real);
|
||||||
// procedure Init(press: real; MaxBP: real); overload;
|
// procedure Init(press: real; MaxBP: real); overload;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -771,6 +779,7 @@ begin
|
|||||||
bp_P10Bg: FM:=TP10Bg.Create;
|
bp_P10Bg: FM:=TP10Bg.Create;
|
||||||
bp_P10Bgu: FM:=TP10Bgu.Create;
|
bp_P10Bgu: FM:=TP10Bgu.Create;
|
||||||
bp_FR513: FM:=TFR513.Create;
|
bp_FR513: FM:=TFR513.Create;
|
||||||
|
bp_FR510: FM:=TFR510.Create;
|
||||||
bp_Cosid: FM:=TCosid.Create;
|
bp_Cosid: FM:=TCosid.Create;
|
||||||
bp_P10yBg: FM:=TP10yBg.Create;
|
bp_P10yBg: FM:=TP10yBg.Create;
|
||||||
bp_P10yBgu: FM:=TP10yBgu.Create;
|
bp_P10yBgu: FM:=TP10yBgu.Create;
|
||||||
@@ -1815,18 +1824,18 @@ begin
|
|||||||
|
|
||||||
|
|
||||||
RapidTemp:=RapidTemp+(RM*Byte((Vel>55)and(BrakeDelayFlag=bdelay_R))-RapidTemp)*dt/2;
|
RapidTemp:=RapidTemp+(RM*Byte((Vel>55)and(BrakeDelayFlag=bdelay_R))-RapidTemp)*dt/2;
|
||||||
temp:=1-RapidTemp;
|
temp:=Max0R(1-RapidTemp,0.001);
|
||||||
// if EDFlag then temp:=1000;
|
// if EDFlag then temp:=1000;
|
||||||
// temp:=temp/(1-);
|
// temp:=temp/(1-);
|
||||||
|
|
||||||
//powtarzacz <20> podwojny zawor zwrotny
|
//powtarzacz <20> podwojny zawor zwrotny
|
||||||
temp:=Max0R(BCP/temp*Min0R(Max0R(1-EDFlag,0),1),LBP);
|
temp:=Max0R(LoadC*BCP/temp*Min0R(Max0R(1-EDFlag,0),1),LBP);
|
||||||
|
|
||||||
if(BrakeCyl.P>temp)then
|
if(BrakeCyl.P>temp)then
|
||||||
dV:=-PFVd(BrakeCyl.P,0,0.02,temp)*dt
|
dV:=-PFVd(BrakeCyl.P,0,0.02*sizeBC,temp)*dt
|
||||||
else
|
else
|
||||||
if(BrakeCyl.P<temp)then
|
if(BrakeCyl.P<temp)then
|
||||||
dV:=PFVa(BVP,BrakeCyl.P,0.02,temp)*dt
|
dV:=PFVa(BVP,BrakeCyl.P,0.02*sizeBC,temp)*dt
|
||||||
else dV:=0;
|
else dV:=0;
|
||||||
|
|
||||||
BrakeCyl.Flow(dV);
|
BrakeCyl.Flow(dV);
|
||||||
@@ -1915,9 +1924,20 @@ end;
|
|||||||
|
|
||||||
function TEStED.GetEDBCP: real;
|
function TEStED.GetEDBCP: real;
|
||||||
begin
|
begin
|
||||||
GetEDBCP:=ImplsRes.P;
|
GetEDBCP:=ImplsRes.P*LoadC;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TEStED.PLC(mass: real);
|
||||||
|
begin
|
||||||
|
LoadC:=1+Byte(Mass<LoadM)*((TareBP+(MaxBP-TareBP)*(mass-TareM)/(LoadM-TareM))/MaxBP-1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TEStED.SetLP(TM, LM, TBP: real);
|
||||||
|
begin
|
||||||
|
TareM:=TM;
|
||||||
|
LoadM:=LM;
|
||||||
|
TareBP:=TBP;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
//---DAKO CV1---
|
//---DAKO CV1---
|
||||||
@@ -2898,7 +2918,7 @@ begin
|
|||||||
// MaxBP:=4;
|
// MaxBP:=4;
|
||||||
// temp:=Min0R(i_bcp*MaxBP,Min0R(5.0,HP));
|
// temp:=Min0R(i_bcp*MaxBP,Min0R(5.0,HP));
|
||||||
temp:=Min0R(i_bcp*MaxBP,HP); //0011
|
temp:=Min0R(i_bcp*MaxBP,HP); //0011
|
||||||
dp:=10*Min0R(abs(temp-BP),0.1)*PF(temp,BP,0.0006*(2+Byte(temp>BP)))*dt;
|
dp:=10*Min0R(abs(temp-BP),0.1)*PF(temp,BP,0.0006*(2+Byte(temp>BP)))*dt*Speed;
|
||||||
BP:=BP-dp;
|
BP:=BP-dp;
|
||||||
GetPF:=-dp;
|
GetPF:=-dp;
|
||||||
end;
|
end;
|
||||||
@@ -2909,6 +2929,7 @@ begin
|
|||||||
MaxBP:=press;
|
MaxBP:=press;
|
||||||
Time:=false;
|
Time:=false;
|
||||||
TimeEP:=false;
|
TimeEP:=false;
|
||||||
|
Speed:=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFD1.GetCP: real;
|
function TFD1.GetCP: real;
|
||||||
@@ -2916,6 +2937,11 @@ begin
|
|||||||
GetCP:=BP;
|
GetCP:=BP;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFD1.SetSpeed(nSpeed: real);
|
||||||
|
begin
|
||||||
|
Speed:=nSpeed;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
//---KNORR---
|
//---KNORR---
|
||||||
|
|
||||||
|
|||||||
@@ -625,7 +625,7 @@ double TMoverParameters::ShowEngineRotation(int VehN)
|
|||||||
|
|
||||||
void TMoverParameters::ConverterCheck()
|
void TMoverParameters::ConverterCheck()
|
||||||
{ // sprawdzanie przetwornicy
|
{ // sprawdzanie przetwornicy
|
||||||
if (ConverterAllow && Mains)
|
if (ConverterAllow && Mains && !ConvOvldFlag)
|
||||||
ConverterFlag = true;
|
ConverterFlag = true;
|
||||||
else
|
else
|
||||||
ConverterFlag = false;
|
ConverterFlag = false;
|
||||||
|
|||||||
2
PyInt.h
2
PyInt.h
@@ -10,9 +10,11 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#define PyGetFloat(param) PyFloat_FromDouble(param >= 0 ? param : -param)
|
#define PyGetFloat(param) PyFloat_FromDouble(param >= 0 ? param : -param)
|
||||||
|
#define PyGetFloatS(param) PyFloat_FromDouble(param)
|
||||||
#define PyGetInt(param) PyInt_FromLong(param)
|
#define PyGetInt(param) PyInt_FromLong(param)
|
||||||
#define PyGetFloatS(param) PyFloat_FromDouble(param)
|
#define PyGetFloatS(param) PyFloat_FromDouble(param)
|
||||||
#define PyGetBool(param) param ? Py_True : Py_False
|
#define PyGetBool(param) param ? Py_True : Py_False
|
||||||
|
#define PyGetString(param) PyString_FromString(param)
|
||||||
|
|
||||||
struct ltstr
|
struct ltstr
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ double TTraction::VoltageGet(double u, double i)
|
|||||||
// 1. zasilacz psPower[0] z rezystancją fResistance[0] oraz jego wewnętrzną
|
// 1. zasilacz psPower[0] z rezystancją fResistance[0] oraz jego wewnętrzną
|
||||||
// 2. zasilacz psPower[1] z rezystancją fResistance[1] oraz jego wewnętrzną
|
// 2. zasilacz psPower[1] z rezystancją fResistance[1] oraz jego wewnętrzną
|
||||||
// 3. zasilacz psPowered z jego wewnętrzną rezystancją dla przęseł zasilanych bezpośrednio
|
// 3. zasilacz psPowered z jego wewnętrzną rezystancją dla przęseł zasilanych bezpośrednio
|
||||||
double res = (i != 0.0) ? fabs(u / i) : 10000.0;
|
double res = (i != 0.0) ? (u / i) : 10000.0;
|
||||||
if (psPowered)
|
if (psPowered)
|
||||||
return psPowered->CurrentGet(res) *
|
return psPowered->CurrentGet(res) *
|
||||||
res; // yB: dla zasilanego nie baw się w gwiazdy, tylko bierz bezpośrednio
|
res; // yB: dla zasilanego nie baw się w gwiazdy, tylko bierz bezpośrednio
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ bool TTractionPowerSource::Render()
|
|||||||
|
|
||||||
bool TTractionPowerSource::Update(double dt)
|
bool TTractionPowerSource::Update(double dt)
|
||||||
{ // powinno byæ wykonane raz na krok fizyki
|
{ // powinno byæ wykonane raz na krok fizyki
|
||||||
|
// if (NominalVoltage * TotalPreviousAdmitance >
|
||||||
|
// MaxOutputCurrent * 0.00000005) // iloczyn napiêcia i admitancji daje pr¹d
|
||||||
|
// ErrorLog("Power overload: \"" + gMyNode->asName + "\" with current " + AnsiString(NominalVoltage * TotalPreviousAdmitance) + "A");
|
||||||
if (NominalVoltage * TotalPreviousAdmitance >
|
if (NominalVoltage * TotalPreviousAdmitance >
|
||||||
MaxOutputCurrent) // iloczyn napiêcia i admitancji daje pr¹d
|
MaxOutputCurrent) // iloczyn napiêcia i admitancji daje pr¹d
|
||||||
{
|
{
|
||||||
@@ -145,13 +148,14 @@ double TTractionPowerSource::CurrentGet(double res)
|
|||||||
FuseTimer = 0;
|
FuseTimer = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((res > 0) || ((res < 0) && (Recuperation)))
|
if ((res > 0) || ((res < 0) && (Recuperation || true)))
|
||||||
TotalAdmitance +=
|
TotalAdmitance +=
|
||||||
1.0 / res; // po³¹czenie równoleg³e rezystancji jest równowa¿ne sumie admitancji
|
1.0 / res; // po³¹czenie równoleg³e rezystancji jest równowa¿ne sumie admitancji
|
||||||
|
float NomVolt = (TotalPreviousAdmitance < 0 ? NominalVoltage * 1.083 : NominalVoltage);
|
||||||
TotalCurrent = (TotalPreviousAdmitance != 0.0) ?
|
TotalCurrent = (TotalPreviousAdmitance != 0.0) ?
|
||||||
NominalVoltage / (InternalRes + 1.0 / TotalPreviousAdmitance) :
|
NomVolt / (InternalRes + 1.0 / TotalPreviousAdmitance) :
|
||||||
0.0; // napiêcie dzielone przez sumê rezystancji wewnêtrznej i obci¹¿enia
|
0.0; // napiêcie dzielone przez sumê rezystancji wewnêtrznej i obci¹¿enia
|
||||||
OutputVoltage = NominalVoltage - InternalRes * TotalCurrent; // napiêcie na obci¹¿eniu
|
OutputVoltage = NomVolt - InternalRes * TotalCurrent; // napiêcie na obci¹¿eniu
|
||||||
return TotalCurrent / (res * TotalPreviousAdmitance); // pr¹d proporcjonalny do udzia³u (1/res)
|
return TotalCurrent / (res * TotalPreviousAdmitance); // pr¹d proporcjonalny do udzia³u (1/res)
|
||||||
// w ca³kowitej admitancji
|
// w ca³kowitej admitancji
|
||||||
};
|
};
|
||||||
|
|||||||
206
Train.cpp
206
Train.cpp
@@ -270,6 +270,7 @@ PyObject *TTrain::GetTrainState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDict_SetItemString(dict, "direction", PyGetInt(DynamicObject->MoverParameters->ActiveDir));
|
PyDict_SetItemString(dict, "direction", PyGetInt(DynamicObject->MoverParameters->ActiveDir));
|
||||||
|
PyDict_SetItemString(dict, "cab", PyGetInt(DynamicObject->MoverParameters->ActiveCab));
|
||||||
PyDict_SetItemString(dict, "slipping_wheels",
|
PyDict_SetItemString(dict, "slipping_wheels",
|
||||||
PyGetBool(DynamicObject->MoverParameters->SlippingWheels));
|
PyGetBool(DynamicObject->MoverParameters->SlippingWheels));
|
||||||
PyDict_SetItemString(dict, "converter",
|
PyDict_SetItemString(dict, "converter",
|
||||||
@@ -292,13 +293,56 @@ PyObject *TTrain::GetTrainState()
|
|||||||
PyDict_SetItemString(dict, "velocity_desired", PyGetFloat(DynamicObject->Mechanik->VelDesired));
|
PyDict_SetItemString(dict, "velocity_desired", PyGetFloat(DynamicObject->Mechanik->VelDesired));
|
||||||
Char* TXTT[10] = { "fd","fdt","fdb","pd","pdt","pdb","itothv","1","2","3" };
|
Char* TXTT[10] = { "fd","fdt","fdb","pd","pdt","pdb","itothv","1","2","3" };
|
||||||
Char* TXTC[10] = { "fr","frt","frb","pr","prt","prb","im","vm","ihv","uhv" };
|
Char* TXTC[10] = { "fr","frt","frb","pr","prt","prb","im","vm","ihv","uhv" };
|
||||||
|
Char* TXTP[3] = { "bc","bp","sp" };
|
||||||
for (int j = 0; j<10; j++)
|
for (int j = 0; j<10; j++)
|
||||||
PyDict_SetItemString(dict, (AnsiString("eimp_t_") + AnsiString(TXTT[j])).c_str(), PyGetFloatS(fEIMParams[0][j]));
|
PyDict_SetItemString(dict, (AnsiString("eimp_t_") + AnsiString(TXTT[j])).c_str(), PyGetFloatS(fEIMParams[0][j]));
|
||||||
for (int i = 0; i<8; i++)
|
for (int i = 0; i<8; i++)
|
||||||
|
{
|
||||||
for (int j = 0; j<10; j++)
|
for (int j = 0; j<10; j++)
|
||||||
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_") + AnsiString(TXTC[j])).c_str(), PyGetFloatS(fEIMParams[i + 1][j]));
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_") + AnsiString(TXTC[j])).c_str(), PyGetFloatS(fEIMParams[i + 1][j]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_ms")).c_str(), PyGetBool(bMains[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_cv")).c_str(), PyGetFloatS(fCntVol[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_u") + IntToStr(i + 1) + AnsiString("_pf")).c_str(), PyGetBool(bPants[i][0]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_u") + IntToStr(i + 1) + AnsiString("_pr")).c_str(), PyGetBool(bPants[i][1]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_fuse")).c_str(), PyGetBool(bFuse[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_batt")).c_str(), PyGetBool(bBatt[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_conv")).c_str(), PyGetBool(bConv[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_u") + IntToStr(i + 1) + AnsiString("_comp_a")).c_str(), PyGetBool(bComp[i][0]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_u") + IntToStr(i + 1) + AnsiString("_comp_w")).c_str(), PyGetBool(bComp[i][1]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_c") + IntToStr(i + 1) + AnsiString("_heat")).c_str(), PyGetBool(bHeat[i]));
|
||||||
|
|
||||||
|
}
|
||||||
|
for (int i = 0; i<20; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j<3; j++)
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("eimp_pn") + IntToStr(i + 1) + AnsiString("_") + AnsiString(TXTP[j])).c_str(),
|
||||||
|
PyGetFloatS(fPress[i][j]));
|
||||||
|
}
|
||||||
|
bool bEP, bPN;
|
||||||
|
bEP = (mvControlled->LocHandle->GetCP()>0.2) || (fEIMParams[0][2]>0.01);
|
||||||
|
PyDict_SetItemString(dict, "dir_brake", PyGetBool(bEP));
|
||||||
|
if (mvControlled->Hamulec->ClassNameIs("TLSt") || mvControlled->Hamulec->ClassNameIs("TEStED"))
|
||||||
|
{
|
||||||
|
TBrake* temp_ham = mvControlled->Hamulec;
|
||||||
|
// TLSt* temp_ham2 = temp_ham;
|
||||||
|
bPN = (static_cast<TLSt*>(temp_ham)->GetEDBCP()>0.2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
bPN = false;
|
||||||
|
PyDict_SetItemString(dict, "indir_brake", PyGetBool(bPN));
|
||||||
|
for (int i = 0; i<20; i++)
|
||||||
|
{
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("doors_") + IntToStr(i + 1)).c_str(), PyGetFloatS(bDoors[i][0]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("doors_r_") + IntToStr(i + 1)).c_str(), PyGetFloatS(bDoors[i][1]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("doors_l_") + IntToStr(i + 1)).c_str(), PyGetFloatS(bDoors[i][2]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("doors_no_") + IntToStr(i + 1)).c_str(), PyGetInt(iDoorNo[i]));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("code_") + IntToStr(i + 1)).c_str(), PyGetString(AnsiString(IntToStr(iUnits[i]) +
|
||||||
|
cCode[i]).c_str()));
|
||||||
|
PyDict_SetItemString(dict, (AnsiString("car_name") + IntToStr(i + 1)).c_str(), PyGetString(asCarName[i].c_str()));
|
||||||
|
}
|
||||||
PyDict_SetItemString(dict, "car_no", PyGetInt(iCarNo));
|
PyDict_SetItemString(dict, "car_no", PyGetInt(iCarNo));
|
||||||
PyDict_SetItemString(dict, "power_no", PyGetInt(iPowerNo));
|
PyDict_SetItemString(dict, "power_no", PyGetInt(iPowerNo));
|
||||||
|
PyDict_SetItemString(dict, "unit_no", PyGetInt(iUnitNo));
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,12 +369,12 @@ void TTrain::OnKeyDown(int cKey)
|
|||||||
}
|
}
|
||||||
else if (cKey == Global::Keys[k_DirectionBackward])
|
else if (cKey == Global::Keys[k_DirectionBackward])
|
||||||
{
|
{
|
||||||
if (mvControlled->Radio == false)
|
if (mvOccupied->Radio == false)
|
||||||
if (GetAsyncKeyState(VK_CONTROL) >= 0)
|
if (GetAsyncKeyState(VK_CONTROL) >= 0)
|
||||||
{
|
{
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
mvControlled->Radio = true;
|
mvOccupied->Radio = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -898,7 +942,20 @@ void TTrain::OnKeyDown(int cKey)
|
|||||||
else if (cKey == Global::Keys[k_UpperSign]) // ABu 060205: œwiat³o górne -
|
else if (cKey == Global::Keys[k_UpperSign]) // ABu 060205: œwiat³o górne -
|
||||||
// w³¹czenie
|
// w³¹czenie
|
||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if (mvOccupied->LightsPosNo > 0) //krêciolek od swiatel
|
||||||
|
{
|
||||||
|
if ((mvOccupied->LightsPos < mvOccupied->LightsPosNo) || (mvOccupied->LightsWrap))
|
||||||
|
{
|
||||||
|
mvOccupied->LightsPos++;
|
||||||
|
if (mvOccupied->LightsPos > mvOccupied->LightsPosNo)
|
||||||
|
{
|
||||||
|
mvOccupied->LightsPos = 1;
|
||||||
|
}
|
||||||
|
SetLights();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem zapala z tylu
|
||||||
{
|
{
|
||||||
//------------------------------
|
//------------------------------
|
||||||
@@ -1329,7 +1386,8 @@ void TTrain::OnKeyDown(int cKey)
|
|||||||
if (GetAsyncKeyState(VK_CONTROL) < 0) // z controlem
|
if (GetAsyncKeyState(VK_CONTROL) < 0) // z controlem
|
||||||
{
|
{
|
||||||
ggConverterFuseButton.PutValue(1); // hunter-261211
|
ggConverterFuseButton.PutValue(1); // hunter-261211
|
||||||
if ((mvControlled->Mains == false) && (ggConverterButton.GetValue() == 0))
|
if ((mvControlled->Mains == false) && (ggConverterButton.GetValue() == 0) &&
|
||||||
|
(mvControlled->TrainType != dt_EZT))
|
||||||
mvControlled->ConvOvldFlag = false;
|
mvControlled->ConvOvldFlag = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1369,11 +1427,11 @@ void TTrain::OnKeyDown(int cKey)
|
|||||||
{
|
{
|
||||||
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
if (GetAsyncKeyState(VK_CONTROL) < 0)
|
||||||
{ // wciœniêty [Ctrl]
|
{ // wciœniêty [Ctrl]
|
||||||
if (mvControlled->Radio == true)
|
if (mvOccupied->Radio == true)
|
||||||
{
|
{
|
||||||
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
dsbSwitch->SetVolume(DSBVOLUME_MAX);
|
||||||
dsbSwitch->Play(0, 0, 0);
|
dsbSwitch->Play(0, 0, 0);
|
||||||
mvControlled->Radio = false;
|
mvOccupied->Radio = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mvOccupied->DirectionBackward())
|
else if (mvOccupied->DirectionBackward())
|
||||||
@@ -2085,7 +2143,19 @@ if
|
|||||||
else if (cKey == Global::Keys[k_UpperSign]) // ABu 060205: œwiat³o górne -
|
else if (cKey == Global::Keys[k_UpperSign]) // ABu 060205: œwiat³o górne -
|
||||||
// wy³¹czenie
|
// wy³¹czenie
|
||||||
{
|
{
|
||||||
if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
if (mvOccupied->LightsPosNo > 0) //krêciolek od swiatel
|
||||||
|
{
|
||||||
|
if ((mvOccupied->LightsPos > 1) || (mvOccupied->LightsWrap))
|
||||||
|
{
|
||||||
|
mvOccupied->LightsPos--;
|
||||||
|
if (mvOccupied->LightsPos < 1)
|
||||||
|
{
|
||||||
|
mvOccupied->LightsPos = mvOccupied->LightsPosNo;
|
||||||
|
}
|
||||||
|
SetLights();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((GetAsyncKeyState(VK_CONTROL) < 0) &&
|
||||||
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
(ggRearUpperLightButton.SubModel)) // hunter-230112 - z controlem gasi z tylu
|
||||||
{
|
{
|
||||||
//------------------------------
|
//------------------------------
|
||||||
@@ -2578,11 +2648,27 @@ bool TTrain::Update()
|
|||||||
fHCurrent[3] = mvControlled->ShowCurrent(3);
|
fHCurrent[3] = mvControlled->ShowCurrent(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool kier = (DynamicObject->DirectionGet()*mvOccupied->ActiveCab > 0);
|
||||||
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->ActiveCab < 0 ? 1 : 0);
|
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->ActiveCab < 0 ? 1 : 0);
|
||||||
int in = 0;
|
int in = 0;
|
||||||
fEIMParams[0][6] = 0;
|
fEIMParams[0][6] = 0;
|
||||||
iCarNo = 0;
|
iCarNo = 0;
|
||||||
iPowerNo = 0;
|
iPowerNo = 0;
|
||||||
|
iUnitNo = 1;
|
||||||
|
|
||||||
|
for (int i = 0; i < 8; i++)
|
||||||
|
{
|
||||||
|
bMains[i] = false;
|
||||||
|
fCntVol[i] = 0.0f;
|
||||||
|
bPants[i][0] = false;
|
||||||
|
bPants[i][1] = false;
|
||||||
|
bFuse[i] = false;
|
||||||
|
bBatt[i] = false;
|
||||||
|
bConv[i] = false;
|
||||||
|
bComp[i][0] = false;
|
||||||
|
bComp[i][1] = false;
|
||||||
|
bHeat[i] = false;
|
||||||
|
}
|
||||||
for (int i = 0; i < 20; i++)
|
for (int i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
if (p)
|
if (p)
|
||||||
@@ -2590,7 +2676,20 @@ bool TTrain::Update()
|
|||||||
fPress[i][0] = p->MoverParameters->BrakePress;
|
fPress[i][0] = p->MoverParameters->BrakePress;
|
||||||
fPress[i][1] = p->MoverParameters->PipePress;
|
fPress[i][1] = p->MoverParameters->PipePress;
|
||||||
fPress[i][2] = p->MoverParameters->ScndPipePress;
|
fPress[i][2] = p->MoverParameters->ScndPipePress;
|
||||||
bDoors[i] = (p->dDoorMoveL > 0.001) || (p->dDoorMoveR > 0.001);
|
bDoors[i][0] = (p->dDoorMoveL > 0.001) || (p->dDoorMoveR > 0.001);
|
||||||
|
bDoors[i][1] = (p->dDoorMoveR > 0.001);
|
||||||
|
bDoors[i][2] = (p->dDoorMoveL > 0.001);
|
||||||
|
iDoorNo[i] = p->iAnimType[ANIM_DOORS];
|
||||||
|
iUnits[i] = iUnitNo;
|
||||||
|
cCode[i] = p->MoverParameters->TypeName[p->MoverParameters->TypeName.Length()];
|
||||||
|
asCarName[i] = p->GetName();
|
||||||
|
bPants[iUnitNo - 1][0] = (bPants[iUnitNo - 1][0] || p->MoverParameters->PantFrontUp);
|
||||||
|
bPants[iUnitNo - 1][1] = (bPants[iUnitNo - 1][1] || p->MoverParameters->PantRearUp);
|
||||||
|
bComp[iUnitNo - 1][0] = (bComp[iUnitNo - 1][0] || p->MoverParameters->CompressorAllow);
|
||||||
|
if (p->MoverParameters->CompressorSpeed>0.00001)
|
||||||
|
{
|
||||||
|
bComp[iUnitNo - 1][1] = (bComp[iUnitNo - 1][1] || p->MoverParameters->CompressorFlag);
|
||||||
|
}
|
||||||
if ((in < 8) && (p->MoverParameters->eimc[eimc_p_Pmax] > 1))
|
if ((in < 8) && (p->MoverParameters->eimc[eimc_p_Pmax] > 1))
|
||||||
{
|
{
|
||||||
fEIMParams[1 + in][0] = p->MoverParameters->eimv[eimv_Fr];
|
fEIMParams[1 + in][0] = p->MoverParameters->eimv[eimv_Fr];
|
||||||
@@ -2602,21 +2701,35 @@ bool TTrain::Update()
|
|||||||
fEIMParams[1 + in][5] = -Min0R(fEIMParams[1 + in][3], 0);
|
fEIMParams[1 + in][5] = -Min0R(fEIMParams[1 + in][3], 0);
|
||||||
fEIMParams[1 + in][6] = p->MoverParameters->eimv[eimv_If];
|
fEIMParams[1 + in][6] = p->MoverParameters->eimv[eimv_If];
|
||||||
fEIMParams[1 + in][7] = p->MoverParameters->eimv[eimv_U];
|
fEIMParams[1 + in][7] = p->MoverParameters->eimv[eimv_U];
|
||||||
fEIMParams[1 + in][8] = p->MoverParameters->eimv[eimv_Ipoj];
|
fEIMParams[1 + in][8] = p->MoverParameters->Itot;//p->MoverParameters->eimv[eimv_Ipoj];
|
||||||
fEIMParams[1 + in][9] = p->MoverParameters->Voltage;
|
fEIMParams[1 + in][9] = p->MoverParameters->Voltage;
|
||||||
fEIMParams[0][6] += fEIMParams[1 + in][8];
|
fEIMParams[0][6] += fEIMParams[1 + in][8];
|
||||||
|
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++;
|
in++;
|
||||||
iPowerNo = in;
|
iPowerNo = in;
|
||||||
}
|
}
|
||||||
p = p->NextC(4);
|
// p = p->NextC(4); //prev
|
||||||
iCarNo = i;
|
if ((kier ? p->NextC(16) : p->PrevC(16)) != (kier ? p->NextC(4) : p->PrevC(4)))
|
||||||
|
iUnitNo++;
|
||||||
|
p = (kier ? p->NextC(4) : p->PrevC(4));
|
||||||
|
iCarNo = i + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fPress[i][0] = 0;
|
fPress[i][0] = 0;
|
||||||
fPress[i][1] = 0;
|
fPress[i][1] = 0;
|
||||||
fPress[i][2] = 0;
|
fPress[i][2] = 0;
|
||||||
bDoors[i] = false;
|
bDoors[i][0] = false;
|
||||||
|
bDoors[i][1] = false;
|
||||||
|
bDoors[i][2] = false;
|
||||||
|
iUnits[i] = 0;
|
||||||
|
cCode[i] = 0;//'0';
|
||||||
|
asCarName[i] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2705,6 +2818,7 @@ bool TTrain::Update()
|
|||||||
if (fConverterTimer < fConverterPrzekaznik)
|
if (fConverterTimer < fConverterPrzekaznik)
|
||||||
{
|
{
|
||||||
mvControlled->ConvOvldFlag = true;
|
mvControlled->ConvOvldFlag = true;
|
||||||
|
if (mvControlled->TrainType != dt_EZT)
|
||||||
mvControlled->MainSwitch(false);
|
mvControlled->MainSwitch(false);
|
||||||
}
|
}
|
||||||
else if (fConverterTimer >= fConverterPrzekaznik)
|
else if (fConverterTimer >= fConverterPrzekaznik)
|
||||||
@@ -3282,6 +3396,15 @@ bool TTrain::Update()
|
|||||||
dsbSlipAlarm->Stop();
|
dsbSlipAlarm->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mvControlled->Mains) || (mvControlled->TrainType == dt_EZT))
|
||||||
|
{
|
||||||
|
btLampkaNadmSil.Turn(mvControlled->FuseFlagCheck());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btLampkaNadmSil.TurnOff();
|
||||||
|
}
|
||||||
|
|
||||||
if (mvControlled->Mains)
|
if (mvControlled->Mains)
|
||||||
{
|
{
|
||||||
btLampkaWylSzybki.TurnOn();
|
btLampkaWylSzybki.TurnOn();
|
||||||
@@ -3324,7 +3447,6 @@ bool TTrain::Update()
|
|||||||
mvControlled->ResistorsFlagCheck());
|
mvControlled->ResistorsFlagCheck());
|
||||||
//-------
|
//-------
|
||||||
|
|
||||||
btLampkaNadmSil.Turn(mvControlled->FuseFlagCheck());
|
|
||||||
btLampkaWysRozr.Turn(mvControlled->Imax == mvControlled->ImaxHi);
|
btLampkaWysRozr.Turn(mvControlled->Imax == mvControlled->ImaxHi);
|
||||||
if (((mvControlled->ScndCtrlActualPos > 0) ||
|
if (((mvControlled->ScndCtrlActualPos > 0) ||
|
||||||
((mvControlled->RList[mvControlled->MainCtrlActualPos].ScndAct != 0) &&
|
((mvControlled->RList[mvControlled->MainCtrlActualPos].ScndAct != 0) &&
|
||||||
@@ -3376,7 +3498,6 @@ bool TTrain::Update()
|
|||||||
btLampkaWylSzybki.TurnOff();
|
btLampkaWylSzybki.TurnOff();
|
||||||
btLampkaOpory.TurnOff();
|
btLampkaOpory.TurnOff();
|
||||||
btLampkaStyczn.TurnOff();
|
btLampkaStyczn.TurnOff();
|
||||||
btLampkaNadmSil.TurnOff();
|
|
||||||
btLampkaUkrotnienie.TurnOff();
|
btLampkaUkrotnienie.TurnOff();
|
||||||
btLampkaHamPosp.TurnOff();
|
btLampkaHamPosp.TurnOff();
|
||||||
btLampkaBoczniki.TurnOff();
|
btLampkaBoczniki.TurnOff();
|
||||||
@@ -3511,7 +3632,7 @@ bool TTrain::Update()
|
|||||||
// KURS90
|
// KURS90
|
||||||
btLampkaMaxSila.Turn(abs(mvControlled->Im) >= 350);
|
btLampkaMaxSila.Turn(abs(mvControlled->Im) >= 350);
|
||||||
btLampkaPrzekrMaxSila.Turn(abs(mvControlled->Im) >= 450);
|
btLampkaPrzekrMaxSila.Turn(abs(mvControlled->Im) >= 450);
|
||||||
btLampkaRadio.Turn(mvControlled->Radio);
|
btLampkaRadio.Turn(mvOccupied->Radio);
|
||||||
btLampkaHamulecReczny.Turn(mvOccupied->ManualBrakePos > 0);
|
btLampkaHamulecReczny.Turn(mvOccupied->ManualBrakePos > 0);
|
||||||
// NBMX wrzesien 2003 - drzwi oraz sygna³ odjazdu
|
// NBMX wrzesien 2003 - drzwi oraz sygna³ odjazdu
|
||||||
btLampkaDoorLeft.Turn(mvOccupied->DoorLeftOpened);
|
btLampkaDoorLeft.Turn(mvOccupied->DoorLeftOpened);
|
||||||
@@ -3680,7 +3801,7 @@ bool TTrain::Update()
|
|||||||
ggMainButton.Update();
|
ggMainButton.Update();
|
||||||
if (ggRadioButton.SubModel)
|
if (ggRadioButton.SubModel)
|
||||||
{
|
{
|
||||||
ggRadioButton.PutValue(mvControlled->Radio ? 1 : 0);
|
ggRadioButton.PutValue(mvOccupied->Radio ? 1 : 0);
|
||||||
ggRadioButton.Update();
|
ggRadioButton.Update();
|
||||||
}
|
}
|
||||||
if (ggConverterButton.SubModel)
|
if (ggConverterButton.SubModel)
|
||||||
@@ -3864,6 +3985,11 @@ bool TTrain::Update()
|
|||||||
else
|
else
|
||||||
ggRearRightLightButton.PutValue(-1);
|
ggRearRightLightButton.PutValue(-1);
|
||||||
}
|
}
|
||||||
|
if (ggLightsButton.SubModel)
|
||||||
|
{
|
||||||
|
ggLightsButton.PutValue(mvOccupied->LightsPos - 1);
|
||||||
|
ggLightsButton.Update();
|
||||||
|
}
|
||||||
|
|
||||||
//---------
|
//---------
|
||||||
// Winger 010304 - pantografy
|
// Winger 010304 - pantografy
|
||||||
@@ -4228,6 +4354,8 @@ bool TTrain::Update()
|
|||||||
ggConverterButton.PutValue(0);
|
ggConverterButton.PutValue(0);
|
||||||
ggConverterOffButton.PutValue(1);
|
ggConverterOffButton.PutValue(1);
|
||||||
mvControlled->ConverterSwitch(false);
|
mvControlled->ConverterSwitch(false);
|
||||||
|
if ((mvControlled->TrainType == dt_EZT) && (!TestFlag(mvControlled->EngDmgFlag, 4)))
|
||||||
|
mvControlled->ConvOvldFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (
|
// if (
|
||||||
@@ -4263,7 +4391,7 @@ bool TTrain::Update()
|
|||||||
*/
|
*/
|
||||||
//-----------------
|
//-----------------
|
||||||
|
|
||||||
if (!FreeFlyModeFlag)
|
if ((!FreeFlyModeFlag) && (!DynamicObject->Mechanik->AIControllFlag))
|
||||||
{
|
{
|
||||||
if (Console::Pressed(Global::Keys[k_Releaser])) // yB: odluzniacz caly
|
if (Console::Pressed(Global::Keys[k_Releaser])) // yB: odluzniacz caly
|
||||||
// czas trzymany, warunki
|
// czas trzymany, warunki
|
||||||
@@ -5348,6 +5476,7 @@ bool TTrain::InitializeCab(int NewCabNo, AnsiString asFileName)
|
|||||||
ggUpperLightButton.Clear();
|
ggUpperLightButton.Clear();
|
||||||
ggLeftEndLightButton.Clear();
|
ggLeftEndLightButton.Clear();
|
||||||
ggRightEndLightButton.Clear();
|
ggRightEndLightButton.Clear();
|
||||||
|
ggLightsButton.Clear();
|
||||||
// hunter-230112
|
// hunter-230112
|
||||||
ggRearLeftLightButton.Clear();
|
ggRearLeftLightButton.Clear();
|
||||||
ggRearRightLightButton.Clear();
|
ggRearRightLightButton.Clear();
|
||||||
@@ -5432,6 +5561,8 @@ bool TTrain::InitializeCab(int NewCabNo, AnsiString asFileName)
|
|||||||
ggLeftEndLightButton.Load(Parser, DynamicObject->mdKabina);
|
ggLeftEndLightButton.Load(Parser, DynamicObject->mdKabina);
|
||||||
else if (str == AnsiString("rightend_sw:")) // swiatlo
|
else if (str == AnsiString("rightend_sw:")) // swiatlo
|
||||||
ggRightEndLightButton.Load(Parser, DynamicObject->mdKabina);
|
ggRightEndLightButton.Load(Parser, DynamicObject->mdKabina);
|
||||||
|
else if (str == AnsiString("lights_sw:")) // swiatla wszystkie
|
||||||
|
ggLightsButton.Load(Parser, DynamicObject->mdKabina);
|
||||||
//---------------------
|
//---------------------
|
||||||
// hunter-230112: przelaczniki swiatel tylnich
|
// hunter-230112: przelaczniki swiatel tylnich
|
||||||
else if (str == AnsiString("rearupperlight_sw:")) // swiatlo
|
else if (str == AnsiString("rearupperlight_sw:")) // swiatlo
|
||||||
@@ -5540,6 +5671,14 @@ bool TTrain::InitializeCab(int NewCabNo, AnsiString asFileName)
|
|||||||
gg = Cabine[cabindex].Gauge(-1); // pierwsza wolna ga³ka
|
gg = Cabine[cabindex].Gauge(-1); // pierwsza wolna ga³ka
|
||||||
gg->Load(Parser, DynamicObject->mdKabina);
|
gg->Load(Parser, DynamicObject->mdKabina);
|
||||||
gg->AssignFloat(&fEIMParams[i][j]);
|
gg->AssignFloat(&fEIMParams[i][j]);
|
||||||
|
}
|
||||||
|
else if (str == AnsiString("brakes:"))
|
||||||
|
{ // amperomierz calkowitego pradu
|
||||||
|
int i = Parser->GetNextSymbol().ToInt();
|
||||||
|
int j = Parser->GetNextSymbol().ToInt();
|
||||||
|
gg = Cabine[cabindex].Gauge(-1); // pierwsza wolna ga³ka
|
||||||
|
gg->Load(Parser, DynamicObject->mdKabina);
|
||||||
|
gg->AssignFloat(&fPress[i - 1][j]);
|
||||||
}
|
}
|
||||||
else if ((str == AnsiString("brakepress:")) || (str == AnsiString("brakepressb:")))
|
else if ((str == AnsiString("brakepress:")) || (str == AnsiString("brakepressb:")))
|
||||||
{ // manometr cylindrow
|
{ // manometr cylindrow
|
||||||
@@ -5759,7 +5898,7 @@ bool TTrain::InitializeCab(int NewCabNo, AnsiString asFileName)
|
|||||||
int i = Parser->GetNextSymbol().ToInt() - 1;
|
int i = Parser->GetNextSymbol().ToInt() - 1;
|
||||||
bt = Cabine[cabindex].Button(-1); // pierwsza wolna lampka
|
bt = Cabine[cabindex].Button(-1); // pierwsza wolna lampka
|
||||||
bt->Load(Parser, DynamicObject->mdKabina);
|
bt->Load(Parser, DynamicObject->mdKabina);
|
||||||
bt->AssignBool(bDoors + i);
|
bt->AssignBool(bDoors[0] + 3 * i);
|
||||||
}
|
}
|
||||||
else if (str == AnsiString("pyscreen:"))
|
else if (str == AnsiString("pyscreen:"))
|
||||||
pyScreens.init(Parser, DynamicObject->mdKabina, DynamicObject->GetName(), NewCabNo);
|
pyScreens.init(Parser, DynamicObject->mdKabina, DynamicObject->GetName(), NewCabNo);
|
||||||
@@ -5929,3 +6068,34 @@ void TTrain::Silence()
|
|||||||
if (dsbBufferClamp)
|
if (dsbBufferClamp)
|
||||||
dsbBufferClamp->Stop();
|
dsbBufferClamp->Stop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TTrain::SetLights()
|
||||||
|
{
|
||||||
|
TDynamicObject *p = DynamicObject->GetFirstDynamic(mvOccupied->ActiveCab < 0 ? 1 : 0);
|
||||||
|
bool kier = (DynamicObject->DirectionGet() * mvOccupied->ActiveCab > 0);
|
||||||
|
int xs = (kier ? 0 : 1);
|
||||||
|
if (kier ? p->NextC(4) : p->PrevC(4)) // jesli jest nastepny, to tylko przod
|
||||||
|
{
|
||||||
|
p->RaLightsSet(mvOccupied->Lights[xs][mvOccupied->LightsPos - 1] * (1 - xs),
|
||||||
|
mvOccupied->Lights[1 - xs][mvOccupied->LightsPos - 1] * xs);
|
||||||
|
p = (kier ? p->NextC(4) : p->PrevC(4));
|
||||||
|
while (p)
|
||||||
|
{
|
||||||
|
if (kier ? p->NextC(4) : p->PrevC(4))
|
||||||
|
{
|
||||||
|
p->RaLightsSet(0, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p->RaLightsSet(mvOccupied->Lights[xs][mvOccupied->LightsPos - 1] * xs,
|
||||||
|
mvOccupied->Lights[1 - xs][mvOccupied->LightsPos - 1] * (1 - xs));
|
||||||
|
}
|
||||||
|
p = (kier ? p->NextC(4) : p->PrevC(4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // calosc
|
||||||
|
{
|
||||||
|
p->RaLightsSet(mvOccupied->Lights[xs][mvOccupied->LightsPos - 1],
|
||||||
|
mvOccupied->Lights[1 - xs][mvOccupied->LightsPos - 1]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
21
Train.h
21
Train.h
@@ -95,6 +95,7 @@ class TTrain
|
|||||||
void UpdateMechPosition(double dt);
|
void UpdateMechPosition(double dt);
|
||||||
bool Update();
|
bool Update();
|
||||||
void MechStop();
|
void MechStop();
|
||||||
|
void SetLights();
|
||||||
// virtual bool RenderAlpha();
|
// virtual bool RenderAlpha();
|
||||||
// McZapkie-310302: ladowanie parametrow z pliku
|
// McZapkie-310302: ladowanie parametrow z pliku
|
||||||
bool LoadMMediaFile(AnsiString asFileName);
|
bool LoadMMediaFile(AnsiString asFileName);
|
||||||
@@ -161,6 +162,7 @@ class TTrain
|
|||||||
TGauge ggRightLightButton;
|
TGauge ggRightLightButton;
|
||||||
TGauge ggLeftEndLightButton;
|
TGauge ggLeftEndLightButton;
|
||||||
TGauge ggRightEndLightButton;
|
TGauge ggRightEndLightButton;
|
||||||
|
TGauge ggLightsButton; //przelacznik reflektorow (wszystkich)
|
||||||
|
|
||||||
// hunter-230112: przelacznik swiatel tylnich
|
// hunter-230112: przelacznik swiatel tylnich
|
||||||
TGauge ggRearUpperLightButton;
|
TGauge ggRearUpperLightButton;
|
||||||
@@ -359,6 +361,7 @@ class TTrain
|
|||||||
float fConverterTimer; // hunter-261211: dla przekaznika
|
float fConverterTimer; // hunter-261211: dla przekaznika
|
||||||
float fMainRelayTimer; // hunter-141211: zalaczanie WSa z opoznieniem
|
float fMainRelayTimer; // hunter-141211: zalaczanie WSa z opoznieniem
|
||||||
float fCzuwakTestTimer; // hunter-091012: do testu czuwaka
|
float fCzuwakTestTimer; // hunter-091012: do testu czuwaka
|
||||||
|
float fLightsTimer; // yB 150617: timer do swiatel
|
||||||
|
|
||||||
int CAflag; // hunter-131211: dla osobnego zbijania CA i SHP
|
int CAflag; // hunter-131211: dla osobnego zbijania CA i SHP
|
||||||
|
|
||||||
@@ -378,9 +381,20 @@ class TTrain
|
|||||||
float fHVoltage; // napi?cie dla dynamicznych ga?ek
|
float fHVoltage; // napi?cie dla dynamicznych ga?ek
|
||||||
float fHCurrent[4]; // pr?dy: suma i amperomierze 1,2,3
|
float fHCurrent[4]; // pr?dy: suma i amperomierze 1,2,3
|
||||||
float fEngine[4]; // obroty te? trzeba pobra?
|
float fEngine[4]; // obroty te? trzeba pobra?
|
||||||
float fPress[20][3]; // cisnienia dla wszystkich czlonow
|
int iCarNo, iPowerNo, iUnitNo; //liczba pojazdow, czlonow napednych i jednostek spi皻ych ze sob<6F>
|
||||||
int iCarNo, iPowerNo; //liczba pojazdow i czlonow napednych
|
bool bDoors[20][3]; // drzwi dla wszystkich czlonow
|
||||||
bool bDoors[20]; // drzwi dla wszystkich czlonow
|
int iUnits[20]; // numer jednostki
|
||||||
|
int iDoorNo[20]; // liczba drzwi
|
||||||
|
char cCode[20]; //kod pojazdu
|
||||||
|
AnsiString asCarName[20]; //nazwa czlonu
|
||||||
|
bool bMains[8]; //WSy
|
||||||
|
float fCntVol[8]; //napiecie NN
|
||||||
|
bool bPants[8][2]; //podniesienie pantografow
|
||||||
|
bool bFuse[8]; //nadmiarowe
|
||||||
|
bool bBatt[8]; //baterie
|
||||||
|
bool bConv[8]; //przetwornice
|
||||||
|
bool bComp[8][2]; //sprezarki
|
||||||
|
bool bHeat[8]; //grzanie
|
||||||
// McZapkie: do syczenia
|
// McZapkie: do syczenia
|
||||||
float fPPress, fNPress;
|
float fPPress, fNPress;
|
||||||
float fSPPress, fSNPress;
|
float fSPPress, fSNPress;
|
||||||
@@ -389,6 +403,7 @@ class TTrain
|
|||||||
TPythonScreens pyScreens;
|
TPythonScreens pyScreens;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
float fPress[20][3]; // cisnienia dla wszystkich czlonow
|
||||||
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
float fEIMParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||||
int RadioChannel()
|
int RadioChannel()
|
||||||
{
|
{
|
||||||
|
|||||||
170
World.cpp
170
World.cpp
@@ -274,9 +274,9 @@ bool TWorld::Init(HWND NhWnd, HDC hDC)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
// WriteLog("glClearColor (FogColor[0], FogColor[1], FogColor[2], 0.0); ");
|
// WriteLog("glClearColor (FogColor[0], FogColor[1], FogColor[2], 0.0); ");
|
||||||
// glClearColor (1.0, 0.0, 0.0, 0.0); // Background Color
|
// glClearColor (1.0, 0.0, 0.0, 0.0); // Background Color
|
||||||
// glClearColor (FogColor[0], FogColor[1], FogColor[2], 0.0); // Background
|
// glClearColor (FogColor[0], FogColor[1], FogColor[2], 0.0);
|
||||||
// Color
|
// Background // Color
|
||||||
glClearColor(0.2, 0.4, 0.33, 1.0); // Background Color
|
glClearColor(Global::Background[0], Global::Background[1], Global::Background[2], 1.0); // Background Color
|
||||||
|
|
||||||
WriteLog("glFogfv(GL_FOG_COLOR, FogColor);");
|
WriteLog("glFogfv(GL_FOG_COLOR, FogColor);");
|
||||||
glFogfv(GL_FOG_COLOR, FogColor); // Set Fog Color
|
glFogfv(GL_FOG_COLOR, FogColor); // Set Fog Color
|
||||||
@@ -846,6 +846,7 @@ void TWorld::OnKeyDown(int cKey)
|
|||||||
}
|
}
|
||||||
else if (cKey == 3) //[Ctrl]+[Break]
|
else if (cKey == 3) //[Ctrl]+[Break]
|
||||||
{ // hamowanie wszystkich pojazdów w okolicy
|
{ // hamowanie wszystkich pojazdów w okolicy
|
||||||
|
if (Controlled->MoverParameters->Radio)
|
||||||
Ground.RadioStop(Camera.Pos);
|
Ground.RadioStop(Camera.Pos);
|
||||||
}
|
}
|
||||||
else if (!Global::iPause) //||(cKey==VK_F4)) //podczas pauzy sterownaie nie dzia³a, F4 tak
|
else if (!Global::iPause) //||(cKey==VK_F4)) //podczas pauzy sterownaie nie dzia³a, F4 tak
|
||||||
@@ -1496,44 +1497,52 @@ bool TWorld::Update()
|
|||||||
// 3. jeœli smuga w³aczona, wyrenderowaæ pojazd u¿ytkownia po dodaniu smugi do sceny
|
// 3. jeœli smuga w³aczona, wyrenderowaæ pojazd u¿ytkownia po dodaniu smugi do sceny
|
||||||
if (Train->Controlled()->Battery)
|
if (Train->Controlled()->Battery)
|
||||||
{ // trochê na skróty z t¹ bateri¹
|
{ // trochê na skróty z t¹ bateri¹
|
||||||
glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE);
|
glBlendFunc(GL_DST_COLOR, GL_ONE);
|
||||||
|
// glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
|
||||||
|
// glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE);
|
||||||
// glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_DST_COLOR);
|
// glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_DST_COLOR);
|
||||||
// glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE);
|
// glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDepthFunc(GL_GEQUAL);
|
||||||
|
glAlphaFunc(GL_GREATER, 0.004);
|
||||||
|
// glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
glDisable(GL_FOG);
|
glDisable(GL_FOG);
|
||||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
glColor4f(0.15f, 0.15f, 0.15f, 0.25f);
|
||||||
glBindTexture(GL_TEXTURE_2D, light); // Select our texture
|
glBindTexture(GL_TEXTURE_2D, light); // Select our texture
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
float fSmudge =
|
float fSmudge =
|
||||||
Train->Dynamic()->MoverParameters->DimHalf.y + 7; // gdzie zaczynaæ smugê
|
Train->Dynamic()->MoverParameters->DimHalf.y + 7; // gdzie zaczynaæ smugê
|
||||||
if (Train->Controlled()->iLights[0] & 21)
|
if (Train->Controlled()->iLights[0] & 21)
|
||||||
{ // wystarczy jeden zapalony z przodu
|
{ // wystarczy jeden zapalony z przodu
|
||||||
glTexCoord2f(0, 0);
|
for (int i = 15; i <= 35; i++)
|
||||||
glVertex3f(15.0, 0.0, +fSmudge); // rysowanie wzglêdem po³o¿enia modelu
|
{
|
||||||
glTexCoord2f(1, 0);
|
float z = i * i * i * 0.01f;//25/4;
|
||||||
glVertex3f(-15.0, 0.0, +fSmudge);
|
float C = (36 - i*0.5)*0.05*0.1;
|
||||||
glTexCoord2f(1, 1);
|
glColor4f(C, C, C, 0.25f);
|
||||||
glVertex3f(-15.0, 2.5, 250.0);
|
glTexCoord2f(0, 0); glVertex3f(-10 / 2 - 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3);
|
||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(1, 0); glVertex3f(10 / 2 + 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3);
|
||||||
glVertex3f(15.0, 2.5, 250.0);
|
glTexCoord2f(1, 1); glVertex3f(10 / 2 + 2 * i / 4, -5.0 - 0.5*z, 13 + 1.7*z / 3);
|
||||||
|
glTexCoord2f(0, 1); glVertex3f(-10 / 2 - 2 * i / 4, -5.0 - 0.5*z, 13 + 1.7*z / 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Train->Controlled()->iLights[1] & 21)
|
if (Train->Controlled()->iLights[1] & 21)
|
||||||
{ // wystarczy jeden zapalony z ty³u
|
{ // wystarczy jeden zapalony z ty³u
|
||||||
glTexCoord2f(0, 0);
|
for (int i = 15; i <= 35; i++)
|
||||||
glVertex3f(-15.0, 0.0, -fSmudge);
|
{
|
||||||
glTexCoord2f(1, 0);
|
float z = i * i * i * 0.01f;//25/4;
|
||||||
glVertex3f(15.0, 0.0, -fSmudge);
|
glTexCoord2f(0, 0); glVertex3f(10 / 2 + 3 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3);
|
||||||
glTexCoord2f(1, 1);
|
glTexCoord2f(1, 0); glVertex3f(-10 / 2 - 3 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3);
|
||||||
glVertex3f(15.0, 2.5, -250.0);
|
glTexCoord2f(1, 1); glVertex3f(-10 / 2 - 3 * i / 4, -5.0 - 0.5*z, -13 - 1.7*z / 3);
|
||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(0, 1); glVertex3f(10 / 2 + 3 * i / 4, -5.0 - 0.5*z, -13 - 1.7*z / 3);
|
||||||
glVertex3f(-15.0, 2.5, -250.0);
|
}
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glEnable(GL_DEPTH_TEST);
|
// glEnable(GL_DEPTH_TEST);
|
||||||
// glEnable(GL_LIGHTING); //i tak siê w³¹czy potem
|
glAlphaFunc(GL_GREATER, 0.04);
|
||||||
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
glEnable(GL_LIGHTING); //i tak siê w³¹czy potem
|
||||||
glEnable(GL_FOG);
|
glEnable(GL_FOG);
|
||||||
}
|
}
|
||||||
glEnable(GL_LIGHTING); // po renderowaniu smugi jest to wy³¹czone
|
glEnable(GL_LIGHTING); // po renderowaniu smugi jest to wy³¹czone
|
||||||
@@ -1900,8 +1909,22 @@ bool TWorld::Update()
|
|||||||
// u:")+FloatToStrF(tmp->MoverParameters->u,ffFixed,3,3);
|
// u:")+FloatToStrF(tmp->MoverParameters->u,ffFixed,3,3);
|
||||||
// OutText2+=AnsiString(",
|
// OutText2+=AnsiString(",
|
||||||
// N:")+FloatToStrF(tmp->MoverParameters->Ntotal,ffFixed,4,0);
|
// N:")+FloatToStrF(tmp->MoverParameters->Ntotal,ffFixed,4,0);
|
||||||
OutText2 +=
|
OutText2 += AnsiString(", MED:") +
|
||||||
AnsiString(", Ft:") + FloatToStrF(tmp->MoverParameters->Ft, ffFixed, 4, 0);
|
FloatToStrF(tmp->MoverParameters->LocalBrakePosA, ffFixed, 6, 2);
|
||||||
|
OutText2 += AnsiString("+") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->AnPos, ffFixed, 6, 2);
|
||||||
|
OutText2 += AnsiString(", Ft:") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->Ft * 0.001f, ffFixed, 4, 0);
|
||||||
|
OutText2 += AnsiString(", HV0:") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->HVCouplers[0][1], ffFixed, 4, 0);
|
||||||
|
OutText2 += AnsiString("@") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->HVCouplers[0][0], ffFixed, 4, 0);
|
||||||
|
OutText2 += AnsiString("+HV1:") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->HVCouplers[1][1], ffFixed, 4, 0);
|
||||||
|
OutText2 += AnsiString("@") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->HVCouplers[1][0], ffFixed, 4, 0);
|
||||||
|
OutText2 += AnsiString(" TC:") +
|
||||||
|
FloatToStrF(tmp->MoverParameters->TotalCurrent, ffFixed, 4, 0);
|
||||||
// OutText3= AnsiString("BP:
|
// OutText3= AnsiString("BP:
|
||||||
// ")+FloatToStrF(tmp->MoverParameters->BrakePress,ffFixed,5,2)+AnsiString(",
|
// ")+FloatToStrF(tmp->MoverParameters->BrakePress,ffFixed,5,2)+AnsiString(",
|
||||||
// ");
|
// ");
|
||||||
@@ -2203,7 +2226,9 @@ bool TWorld::Update()
|
|||||||
FloatToStrF(Controlled->MoverParameters->dizel_engagedeltaomega, ffFixed, 6, 3);
|
FloatToStrF(Controlled->MoverParameters->dizel_engagedeltaomega, ffFixed, 6, 3);
|
||||||
OutText2 = AnsiString("HamZ=") +
|
OutText2 = AnsiString("HamZ=") +
|
||||||
FloatToStrF(Controlled->MoverParameters->fBrakeCtrlPos, ffFixed, 6, 1);
|
FloatToStrF(Controlled->MoverParameters->fBrakeCtrlPos, ffFixed, 6, 1);
|
||||||
OutText2 += AnsiString("; HamP=") + AnsiString(Controlled->MoverParameters->LocalBrakePos);
|
OutText2 += AnsiString("; HamP=") + AnsiString(mvControlled->LocalBrakePos);
|
||||||
|
OutText2 += AnsiString("/") +
|
||||||
|
FloatToStrF(Controlled->MoverParameters->LocalBrakePosA, ffFixed, 6, 2);
|
||||||
// mvControlled->MainCtrlPos;
|
// mvControlled->MainCtrlPos;
|
||||||
// if (mvControlled->MainCtrlPos<0)
|
// if (mvControlled->MainCtrlPos<0)
|
||||||
// OutText2+= AnsiString("; nastawnik 0");
|
// OutText2+= AnsiString("; nastawnik 0");
|
||||||
@@ -2228,7 +2253,13 @@ bool TWorld::Update()
|
|||||||
FloatToStrF(Controlled->MoverParameters->RunningShape.R, ffFixed, 4, 1);
|
FloatToStrF(Controlled->MoverParameters->RunningShape.R, ffFixed, 4, 1);
|
||||||
OutText2 += AnsiString(" An=") + FloatToStrF(Controlled->MoverParameters->AccN, ffFixed, 4,
|
OutText2 += AnsiString(" An=") + FloatToStrF(Controlled->MoverParameters->AccN, ffFixed, 4,
|
||||||
2); // przyspieszenie poprzeczne
|
2); // przyspieszenie poprzeczne
|
||||||
OutText2 += AnsiString("; As=") + FloatToStrF(Controlled->MoverParameters->AccS, ffFixed, 4,
|
if (tprev != int(GlobalTime->mr))
|
||||||
|
{
|
||||||
|
tprev = GlobalTime->mr;
|
||||||
|
Acc = (Controlled->MoverParameters->Vel - VelPrev) / 3.6;
|
||||||
|
VelPrev = Controlled->MoverParameters->Vel;
|
||||||
|
}
|
||||||
|
OutText2 += AnsiString("; As=") + FloatToStrF(Acc/*Controlled->MoverParameters->AccS*/, ffFixed, 4,
|
||||||
2); // przyspieszenie wzd³u¿ne
|
2); // przyspieszenie wzd³u¿ne
|
||||||
// OutText2+=AnsiString("; P=")+FloatToStrF(mvControlled->EnginePower,ffFixed,6,1);
|
// OutText2+=AnsiString("; P=")+FloatToStrF(mvControlled->EnginePower,ffFixed,6,1);
|
||||||
OutText3 += AnsiString("cyl.ham. ") +
|
OutText3 += AnsiString("cyl.ham. ") +
|
||||||
@@ -2263,6 +2294,27 @@ bool TWorld::Update()
|
|||||||
OutText4 = FloatToStrF(Controlled->MoverParameters->eimv[i], ffGeneral, 5, 3);
|
OutText4 = FloatToStrF(Controlled->MoverParameters->eimv[i], ffGeneral, 5, 3);
|
||||||
glPrint(OutText4.c_str());
|
glPrint(OutText4.c_str());
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i <= 10; i++)
|
||||||
|
{
|
||||||
|
glRasterPos2f(-0.15f, 0.16f - 0.01f * i);
|
||||||
|
OutText4 = FloatToStrF(Train->fPress[i][0], ffFixed, 6, 3);
|
||||||
|
glPrint(OutText4.c_str());
|
||||||
|
}
|
||||||
|
for (int i = 0; i <= 8; i++)
|
||||||
|
{
|
||||||
|
glRasterPos2f(-0.15f, 0.04f - 0.01f * i);
|
||||||
|
OutText4 = FloatToStrF(Controlled->MED[0][i], ffFixed, 6, 3);
|
||||||
|
glPrint(OutText4.c_str());
|
||||||
|
}
|
||||||
|
for (int i = 0; i <= 8; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j <= 9; j++)
|
||||||
|
{
|
||||||
|
glRasterPos2f(0.05f + 0.03f * i, 0.16f - 0.01f * j);
|
||||||
|
OutText4 = FloatToStrF(Train->fEIMParams[i][j], ffGeneral, 4, 2);
|
||||||
|
glPrint(OutText4.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
OutText4 = "";
|
OutText4 = "";
|
||||||
// glTranslatef(0.0f,0.0f,+0.50f);
|
// glTranslatef(0.0f,0.0f,+0.50f);
|
||||||
glColor3f(1.0f, 0.0f, 0.0f); // a, damy czerwonym
|
glColor3f(1.0f, 0.0f, 0.0f); // a, damy czerwonym
|
||||||
@@ -2692,12 +2744,16 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
switch (pRozkaz->iComm)
|
switch (pRozkaz->iComm)
|
||||||
{
|
{
|
||||||
case 0: // odes³anie identyfikatora wersji
|
case 0: // odes³anie identyfikatora wersji
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " version" + " rcvd");
|
||||||
Ground.WyslijString(Global::asVersion, 0); // przedsatwienie siê
|
Ground.WyslijString(Global::asVersion, 0); // przedsatwienie siê
|
||||||
break;
|
break;
|
||||||
case 1: // odes³anie identyfikatora wersji
|
case 1: // odes³anie identyfikatora wersji
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " scenery" + " rcvd");
|
||||||
Ground.WyslijString(Global::szSceneryFile, 1); // nazwa scenerii
|
Ground.WyslijString(Global::szSceneryFile, 1); // nazwa scenerii
|
||||||
break;
|
break;
|
||||||
case 2: // event
|
case 2: // event
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])) + " rcvd");
|
||||||
if (Global::iMultiplayer)
|
if (Global::iMultiplayer)
|
||||||
{ // WriteLog("Komunikat: "+AnsiString(pRozkaz->Name1));
|
{ // WriteLog("Komunikat: "+AnsiString(pRozkaz->Name1));
|
||||||
TEvent *e = Ground.FindEvent(
|
TEvent *e = Ground.FindEvent(
|
||||||
@@ -2714,6 +2770,10 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
{
|
{
|
||||||
int i =
|
int i =
|
||||||
int(pRozkaz->cString[8]); // d³ugoœæ pierwszego ³añcucha (z przodu dwa floaty)
|
int(pRozkaz->cString[8]); // d³ugoœæ pierwszego ³añcucha (z przodu dwa floaty)
|
||||||
|
CommLog(
|
||||||
|
AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 11 + i, (unsigned)(pRozkaz->cString[10 + i])) +
|
||||||
|
" rcvd");
|
||||||
TGroundNode *t = Ground.DynamicFind(
|
TGroundNode *t = Ground.DynamicFind(
|
||||||
AnsiString(pRozkaz->cString + 11 + i,
|
AnsiString(pRozkaz->cString + 11 + i,
|
||||||
(unsigned)pRozkaz->cString[10 + i])); // nazwa pojazdu jest druga
|
(unsigned)pRozkaz->cString[10 + i])); // nazwa pojazdu jest druga
|
||||||
@@ -2729,6 +2789,8 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
break;
|
break;
|
||||||
case 4: // badanie zajêtoœci toru
|
case 4: // badanie zajêtoœci toru
|
||||||
{
|
{
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])) + " rcvd");
|
||||||
TGroundNode *t = Ground.FindGroundNode(
|
TGroundNode *t = Ground.FindGroundNode(
|
||||||
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])), TP_TRACK);
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])), TP_TRACK);
|
||||||
if (t)
|
if (t)
|
||||||
@@ -2738,6 +2800,9 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
break;
|
break;
|
||||||
case 5: // ustawienie parametrów
|
case 5: // ustawienie parametrów
|
||||||
{
|
{
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " params " +
|
||||||
|
IntToStr(*pRozkaz->iPar) + " rcvd");
|
||||||
|
if (*pRozkaz->iPar == 0) // sprawdzenie czasu
|
||||||
if (*pRozkaz->iPar & 1) // ustawienie czasu
|
if (*pRozkaz->iPar & 1) // ustawienie czasu
|
||||||
{
|
{
|
||||||
double t = pRozkaz->fPar[1];
|
double t = pRozkaz->fPar[1];
|
||||||
@@ -2760,6 +2825,9 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
case 6: // pobranie parametrów ruchu pojazdu
|
case 6: // pobranie parametrów ruchu pojazdu
|
||||||
if (Global::iMultiplayer)
|
if (Global::iMultiplayer)
|
||||||
{ // Ra 2014-12: to ma dzia³aæ równie¿ dla pojazdów bez obsady
|
{ // Ra 2014-12: to ma dzia³aæ równie¿ dla pojazdów bez obsady
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])) +
|
||||||
|
" rcvd");
|
||||||
if (pRozkaz->cString[0]) // jeœli d³ugoœæ nazwy jest niezerowa
|
if (pRozkaz->cString[0]) // jeœli d³ugoœæ nazwy jest niezerowa
|
||||||
{ // szukamy pierwszego pojazdu o takiej nazwie i odsy³amy parametry ramk¹ #7
|
{ // szukamy pierwszego pojazdu o takiej nazwie i odsy³amy parametry ramk¹ #7
|
||||||
TGroundNode *t;
|
TGroundNode *t;
|
||||||
@@ -2780,15 +2848,59 @@ void TWorld::OnCommandGet(DaneRozkaz *pRozkaz)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8: // ponowne wys³anie informacji o zajêtych odcinkach toru
|
case 8: // ponowne wys³anie informacji o zajêtych odcinkach toru
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " all busy track" + " rcvd");
|
||||||
Ground.TrackBusyList();
|
Ground.TrackBusyList();
|
||||||
break;
|
break;
|
||||||
case 9: // ponowne wys³anie informacji o zajêtych odcinkach izolowanych
|
case 9: // ponowne wys³anie informacji o zajêtych odcinkach izolowanych
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " all busy isolated" + " rcvd");
|
||||||
Ground.IsolatedBusyList();
|
Ground.IsolatedBusyList();
|
||||||
break;
|
break;
|
||||||
case 10: // badanie zajêtoœci jednego odcinka izolowanego
|
case 10: // badanie zajêtoœci jednego odcinka izolowanego
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])) + " rcvd");
|
||||||
Ground.IsolatedBusy(AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])));
|
Ground.IsolatedBusy(AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])));
|
||||||
break;
|
break;
|
||||||
case 11: // ustawienie paerametrów ruchu pojazdu
|
case 11: // ustawienie parametrów ruchu pojazdu
|
||||||
|
// Ground.IsolatedBusy(AnsiString(pRozkaz->cString+1,(unsigned)(pRozkaz->cString[0])));
|
||||||
|
break;
|
||||||
|
case 12: // skrocona ramka parametrow pojazdow AI (wszystkich!!)
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " obsadzone" + " rcvd");
|
||||||
|
Ground.WyslijObsadzone();
|
||||||
|
// Ground.IsolatedBusy(AnsiString(pRozkaz->cString+1,(unsigned)(pRozkaz->cString[0])));
|
||||||
|
break;
|
||||||
|
case 13: // ramka uszkodzenia i innych stanow pojazdu, np. wylaczenie CA, wlaczenie recznego itd.
|
||||||
|
// WriteLog("Przyszlo 13!");
|
||||||
|
// WriteLog(pRozkaz->cString);
|
||||||
|
CommLog(AnsiString(Now()) + " " + IntToStr(pRozkaz->iComm) + " " +
|
||||||
|
AnsiString(pRozkaz->cString + 1, (unsigned)(pRozkaz->cString[0])) +
|
||||||
|
" rcvd");
|
||||||
|
if (pRozkaz->cString[1]) // jeœli d³ugoœæ nazwy jest niezerowa
|
||||||
|
{ // szukamy pierwszego pojazdu o takiej nazwie i odsy³amy parametry ramk¹ #13
|
||||||
|
TGroundNode *t;
|
||||||
|
if (pRozkaz->cString[2] == '*')
|
||||||
|
t = Ground.DynamicFind(
|
||||||
|
Global::asHumanCtrlVehicle); // nazwa pojazdu u¿ytkownika
|
||||||
|
else
|
||||||
|
t = Ground.DynamicFindAny(
|
||||||
|
AnsiString(pRozkaz->cString + 2,
|
||||||
|
(unsigned)pRozkaz->cString[1])); // nazwa pojazdu
|
||||||
|
if (t)
|
||||||
|
{
|
||||||
|
TDynamicObject *d = t->DynamicObject;
|
||||||
|
while (d)
|
||||||
|
{
|
||||||
|
d->Damage(pRozkaz->cString[0]);
|
||||||
|
d = d->Next(); // pozosta³e te¿
|
||||||
|
}
|
||||||
|
d = t->DynamicObject->Prev();
|
||||||
|
while (d)
|
||||||
|
{
|
||||||
|
d->Damage(pRozkaz->cString[0]);
|
||||||
|
d = d->Prev(); // w drug¹ stronê te¿
|
||||||
|
}
|
||||||
|
Ground.WyslijUszkodzenia(t->asName, t->DynamicObject->MoverParameters->EngDmgFlag); // zwrot informacji o pojeŸdzie
|
||||||
|
}
|
||||||
|
}
|
||||||
// Ground.IsolatedBusy(AnsiString(pRozkaz->cString+1,(unsigned)(pRozkaz->cString[0])));
|
// Ground.IsolatedBusy(AnsiString(pRozkaz->cString+1,(unsigned)(pRozkaz->cString[0])));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
3
World.h
3
World.h
@@ -62,6 +62,9 @@ class TWorld
|
|||||||
double fTimeBuffer; // bufor czasu aktualizacji dla sta³ego kroku fizyki
|
double fTimeBuffer; // bufor czasu aktualizacji dla sta³ego kroku fizyki
|
||||||
double fMaxDt; //[s] krok czasowy fizyki (0.01 dla normalnych warunków)
|
double fMaxDt; //[s] krok czasowy fizyki (0.01 dla normalnych warunków)
|
||||||
int iPause; // wykrywanie zmian w zapauzowaniu
|
int iPause; // wykrywanie zmian w zapauzowaniu
|
||||||
|
double VelPrev; // poprzednia prêdkoœæ
|
||||||
|
int tprev; // poprzedni czas
|
||||||
|
double Acc; // przyspieszenie styczne
|
||||||
public:
|
public:
|
||||||
void ModifyTGA(const AnsiString &dir = "");
|
void ModifyTGA(const AnsiString &dir = "");
|
||||||
void CreateE3D(const AnsiString &dir = "", bool dyn = false);
|
void CreateE3D(const AnsiString &dir = "", bool dyn = false);
|
||||||
|
|||||||
Reference in New Issue
Block a user