mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 20:59:19 +02:00
Poprawka na parsowanie wpisu hamulca. Formatowanie plików.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -64,3 +64,7 @@ MaSzyna.sln
|
|||||||
MaSzyna.vcxproj
|
MaSzyna.vcxproj
|
||||||
MaSzyna.vcxproj.filters
|
MaSzyna.vcxproj.filters
|
||||||
*.suo
|
*.suo
|
||||||
|
EU07.tds
|
||||||
|
MaSzyna.VC.VC.opendb
|
||||||
|
MaSzyna.VC.db
|
||||||
|
.vs/
|
||||||
|
|||||||
@@ -1763,10 +1763,10 @@ TDynamicObject::Init(string Name, // nazwa pojazdu, np. "EU07-424"
|
|||||||
// kropkę na koniec
|
// kropkę na koniec
|
||||||
int kropka = MoreParams.find("."); // znajdź kropke
|
int kropka = MoreParams.find("."); // znajdź kropke
|
||||||
string ActPar; // na parametry
|
string ActPar; // na parametry
|
||||||
while (kropka > 0) // jesli sa kropki jeszcze
|
while (kropka != std::string::npos) // jesli sa kropki jeszcze
|
||||||
{
|
{
|
||||||
int dlugosc = MoreParams.length();
|
int dlugosc = MoreParams.length();
|
||||||
ActPar = ToUpper(MoreParams.substr(0, kropka - 1)); // pierwszy parametr;
|
ActPar = ToUpper(MoreParams.substr(0, kropka)); // pierwszy parametr;
|
||||||
MoreParams = MoreParams.substr(kropka + 1, dlugosc - kropka); // reszta do dalszej
|
MoreParams = MoreParams.substr(kropka + 1, dlugosc - kropka); // reszta do dalszej
|
||||||
// obrobki
|
// obrobki
|
||||||
kropka = MoreParams.find(".");
|
kropka = MoreParams.find(".");
|
||||||
|
|||||||
13
EU07.bpr
13
EU07.bpr
@@ -41,8 +41,7 @@
|
|||||||
<OPTIONS>
|
<OPTIONS>
|
||||||
<IDLCFLAGS value="-src_suffix cpp -DGLEW_STATIC -D_DEBUG -IConsole -Iopengl -IMcZapkie
|
<IDLCFLAGS value="-src_suffix cpp -DGLEW_STATIC -D_DEBUG -IConsole -Iopengl -IMcZapkie
|
||||||
-I$(BCB)\include -I$(BCB)\include\vcl -Ipython\include -boa"/>
|
-I$(BCB)\include -I$(BCB)\include\vcl -Ipython\include -boa"/>
|
||||||
<CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -w- -Vx -Ve -X- -r- -a1 -6 -b- -k -y -v
|
<CFLAG1 value="-Od -w- -Vx -Ve -X- -r- -a1 -6 -b- -k -y -v -vi- -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"/>
|
||||||
@@ -58,9 +57,9 @@
|
|||||||
IncludeVerInfo=1
|
IncludeVerInfo=1
|
||||||
AutoIncBuild=0
|
AutoIncBuild=0
|
||||||
MajorVer=16
|
MajorVer=16
|
||||||
MinorVer=0
|
MinorVer=1
|
||||||
Release=1173
|
Release=1174
|
||||||
Build=481
|
Build=483
|
||||||
Debug=1
|
Debug=1
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
@@ -72,13 +71,13 @@ CodePage=1250
|
|||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=EU07 Team
|
CompanyName=EU07 Team
|
||||||
FileDescription=MaSzyna EU07-424
|
FileDescription=MaSzyna EU07-424
|
||||||
FileVersion=16.0.1173.481
|
FileVersion=16.1.1174.483
|
||||||
InternalName=DP+SPKS+asynch+python
|
InternalName=DP+SPKS+asynch+python
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
OriginalFilename=eu07.exe
|
OriginalFilename=eu07.exe
|
||||||
ProductName=MaSzyna EU07-424
|
ProductName=MaSzyna EU07-424
|
||||||
ProductVersion=16.0
|
ProductVersion=16.1
|
||||||
Comments=
|
Comments=
|
||||||
|
|
||||||
[Excluded Packages]
|
[Excluded Packages]
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ double Global::fLuminance = 1.0; // jasno
|
|||||||
int Global::iReCompile = 0; // zwiêkszany, gdy trzeba odœwie¿yæ siatki
|
int Global::iReCompile = 0; // zwiêkszany, gdy trzeba odœwie¿yæ siatki
|
||||||
HWND Global::hWnd = NULL; // uchwyt okna
|
HWND Global::hWnd = NULL; // uchwyt okna
|
||||||
int Global::iCameraLast = -1;
|
int Global::iCameraLast = -1;
|
||||||
std::string Global::asRelease = "16.0.1172.481";
|
std::string Global::asRelease = "16.1.1174.483";
|
||||||
std::string Global::asVersion =
|
std::string Global::asVersion =
|
||||||
"Compilation 2016-08-24, release " + Global::asRelease + "."; // tutaj, bo wysy³any
|
"Compilation 2017-01-13, release " + Global::asRelease + "."; // tutaj, bo wysy³any
|
||||||
int Global::iViewMode = 0; // co aktualnie widaæ: 0-kabina, 1-latanie, 2-sprzêgi, 3-dokumenty
|
int Global::iViewMode = 0; // co aktualnie widaæ: 0-kabina, 1-latanie, 2-sprzêgi, 3-dokumenty
|
||||||
int Global::iTextMode = 0; // tryb pracy wyœwietlacza tekstowego
|
int Global::iTextMode = 0; // tryb pracy wyœwietlacza tekstowego
|
||||||
int Global::iScreenMode[12] = {0, 0, 0, 0, 0, 0,
|
int Global::iScreenMode[12] = {0, 0, 0, 0, 0, 0,
|
||||||
|
|||||||
@@ -1809,7 +1809,7 @@ TGroundNode * TGround::AddGroundNode(cParser *parser)
|
|||||||
if (int2 != string::npos) // yB: jesli znalazl kropke, to ja przetwarza jako parametry
|
if (int2 != string::npos) // yB: jesli znalazl kropke, to ja przetwarza jako parametry
|
||||||
{
|
{
|
||||||
int dlugosc = str4.length();
|
int dlugosc = str4.length();
|
||||||
int1 = atoi(str4.substr(0, int2 - 1).c_str()); // niech sprzegiem bedzie do kropki cos
|
int1 = atoi(str4.substr(0, int2).c_str()); // niech sprzegiem bedzie do kropki cos
|
||||||
str4 = str4.substr(int2 + 1, dlugosc - int2);
|
str4 = str4.substr(int2 + 1, dlugosc - int2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
666
McZapkie/MOVER.h
666
McZapkie/MOVER.h
File diff suppressed because it is too large
Load Diff
@@ -7,26 +7,26 @@ obtain one at
|
|||||||
http://mozilla.org/MPL/2.0/.
|
http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <MATH.H>
|
|
||||||
#include <FLOAT.H>
|
#include <FLOAT.H>
|
||||||
#include <typeinfo>
|
#include <MATH.H>
|
||||||
#include <fstream> // std::ifstream
|
|
||||||
#include <sstream>
|
|
||||||
#include <istream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <stdio.h> // sprintf()
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <fstream> // std::ifstream
|
||||||
|
#include <iostream>
|
||||||
|
#include <istream>
|
||||||
|
#include <math.h>
|
||||||
|
#include <sstream>
|
||||||
|
#include <stdio.h> // sprintf()
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <typeinfo>
|
||||||
|
|
||||||
#include "Mover.h"
|
|
||||||
#include "../globals.h"
|
#include "../globals.h"
|
||||||
|
#include "Mover.h"
|
||||||
//#include "../qutils.h"
|
//#include "../qutils.h"
|
||||||
#include "mctools.h"
|
|
||||||
#include "../logs.h"
|
#include "../logs.h"
|
||||||
#include "hamulce.h"
|
|
||||||
#include "Oerlikon_ESt.h"
|
#include "Oerlikon_ESt.h"
|
||||||
|
#include "hamulce.h"
|
||||||
|
#include "mctools.h"
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#pragma package(smart_init)
|
#pragma package(smart_init)
|
||||||
|
|
||||||
@@ -200,8 +200,8 @@ double TMoverParameters::current(double n, double U)
|
|||||||
if ((DynamicBrakeType == dbrake_switch) && (TrainType == dt_ET42))
|
if ((DynamicBrakeType == dbrake_switch) && (TrainType == dt_ET42))
|
||||||
{ // z Megapacka
|
{ // z Megapacka
|
||||||
Rz = WindingRes + R;
|
Rz = WindingRes + R;
|
||||||
MotorCurrent =
|
MotorCurrent = -MotorParam[SP].fi * n /
|
||||||
-MotorParam[SP].fi * n / Rz; //{hamowanie silnikiem na oporach rozruchowych}
|
Rz; //{hamowanie silnikiem na oporach rozruchowych}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -282,11 +282,10 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
|||||||
std::string NameInit, int LoadInitial,
|
std::string NameInit, int LoadInitial,
|
||||||
std::string LoadTypeInitial,
|
std::string LoadTypeInitial,
|
||||||
int Cab) //: T_MoverParameters(VelInitial, TypeNameInit,
|
int Cab) //: T_MoverParameters(VelInitial, TypeNameInit,
|
||||||
//NameInit, LoadInitial, LoadTypeInitial, Cab)
|
// NameInit, LoadInitial, LoadTypeInitial, Cab)
|
||||||
{
|
{
|
||||||
int b, k;
|
int b, k;
|
||||||
WriteLog(
|
WriteLog("------------------------------------------------------");
|
||||||
"------------------------------------------------------");
|
|
||||||
WriteLog("init default physic values for " + NameInit + ", [" + TypeNameInit + "], [" +
|
WriteLog("init default physic values for " + NameInit + ", [" + TypeNameInit + "], [" +
|
||||||
LoadTypeInitial + "]");
|
LoadTypeInitial + "]");
|
||||||
Dim = TDimension();
|
Dim = TDimension();
|
||||||
@@ -384,38 +383,37 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
|||||||
nmax = 0.0;
|
nmax = 0.0;
|
||||||
Voltage = 0.0;
|
Voltage = 0.0;
|
||||||
|
|
||||||
|
|
||||||
HeatingPowerSource = TPowerParameters();
|
HeatingPowerSource = TPowerParameters();
|
||||||
//HeatingPowerSource.MaxVoltage = 0.0;
|
// HeatingPowerSource.MaxVoltage = 0.0;
|
||||||
//HeatingPowerSource.MaxCurrent = 0.0;
|
// HeatingPowerSource.MaxCurrent = 0.0;
|
||||||
//HeatingPowerSource.IntR = 0.001;
|
// HeatingPowerSource.IntR = 0.001;
|
||||||
//HeatingPowerSource.SourceType = NotDefined;
|
// HeatingPowerSource.SourceType = NotDefined;
|
||||||
//HeatingPowerSource.PowerType = NoPower;
|
// HeatingPowerSource.PowerType = NoPower;
|
||||||
//HeatingPowerSource.RPowerCable.PowerTrans = NoPower;
|
// HeatingPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||||
|
|
||||||
AlterHeatPowerSource = TPowerParameters();
|
AlterHeatPowerSource = TPowerParameters();
|
||||||
//AlterHeatPowerSource.MaxVoltage = 0.0;
|
// AlterHeatPowerSource.MaxVoltage = 0.0;
|
||||||
//AlterHeatPowerSource.MaxCurrent = 0.0;
|
// AlterHeatPowerSource.MaxCurrent = 0.0;
|
||||||
//AlterHeatPowerSource.IntR = 0.001;
|
// AlterHeatPowerSource.IntR = 0.001;
|
||||||
//AlterHeatPowerSource.SourceType = NotDefined;
|
// AlterHeatPowerSource.SourceType = NotDefined;
|
||||||
//AlterHeatPowerSource.PowerType = NoPower;
|
// AlterHeatPowerSource.PowerType = NoPower;
|
||||||
//AlterHeatPowerSource.RPowerCable.PowerTrans = NoPower;
|
// AlterHeatPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||||
|
|
||||||
LightPowerSource = TPowerParameters();
|
LightPowerSource = TPowerParameters();
|
||||||
//LightPowerSource.MaxVoltage = 0.0;
|
// LightPowerSource.MaxVoltage = 0.0;
|
||||||
//LightPowerSource.MaxCurrent = 0.0;
|
// LightPowerSource.MaxCurrent = 0.0;
|
||||||
//LightPowerSource.IntR = 0.001;
|
// LightPowerSource.IntR = 0.001;
|
||||||
//LightPowerSource.SourceType = NotDefined;
|
// LightPowerSource.SourceType = NotDefined;
|
||||||
//LightPowerSource.PowerType = NoPower;
|
// LightPowerSource.PowerType = NoPower;
|
||||||
//LightPowerSource.RPowerCable.PowerTrans = NoPower;
|
// LightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||||
|
|
||||||
AlterLightPowerSource = TPowerParameters();
|
AlterLightPowerSource = TPowerParameters();
|
||||||
//AlterLightPowerSource.MaxVoltage = 0.0;
|
// AlterLightPowerSource.MaxVoltage = 0.0;
|
||||||
//AlterLightPowerSource.MaxCurrent = 0.0;
|
// AlterLightPowerSource.MaxCurrent = 0.0;
|
||||||
//AlterLightPowerSource.IntR = 0.001;
|
// AlterLightPowerSource.IntR = 0.001;
|
||||||
//AlterLightPowerSource.SourceType = NotDefined;
|
// AlterLightPowerSource.SourceType = NotDefined;
|
||||||
//AlterLightPowerSource.PowerType = NoPower;
|
// AlterLightPowerSource.PowerType = NoPower;
|
||||||
//AlterLightPowerSource.RPowerCable.PowerTrans = NoPower;
|
// AlterLightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||||
|
|
||||||
TypeName = TypeNameInit;
|
TypeName = TypeNameInit;
|
||||||
HighPipePress = 0.0;
|
HighPipePress = 0.0;
|
||||||
@@ -691,12 +689,12 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
|||||||
OffsetTrackV = 0.0;
|
OffsetTrackV = 0.0;
|
||||||
|
|
||||||
CommandIn = TCommand();
|
CommandIn = TCommand();
|
||||||
//CommandIn.Command = "";
|
// CommandIn.Command = "";
|
||||||
//CommandIn.Value1 = 0.0;
|
// CommandIn.Value1 = 0.0;
|
||||||
//CommandIn.Value2 = 0.0;
|
// CommandIn.Value2 = 0.0;
|
||||||
//CommandIn.Location.X = 0.0;
|
// CommandIn.Location.X = 0.0;
|
||||||
//CommandIn.Location.Y = 0.0;
|
// CommandIn.Location.Y = 0.0;
|
||||||
//CommandIn.Location.Z = 0.0;
|
// CommandIn.Location.Z = 0.0;
|
||||||
CommandLast, CommandOut = "";
|
CommandLast, CommandOut = "";
|
||||||
ValueOut = 0.0;
|
ValueOut = 0.0;
|
||||||
// czesciowo stale, czesciowo zmienne}
|
// czesciowo stale, czesciowo zmienne}
|
||||||
@@ -811,7 +809,7 @@ bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *
|
|||||||
};
|
};
|
||||||
|
|
||||||
// to jest już niepotrzebne bo nie ma Delphi
|
// to jest już niepotrzebne bo nie ma Delphi
|
||||||
//bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *ConnectTo,
|
// bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *ConnectTo,
|
||||||
// int CouplingType, bool Forced)
|
// int CouplingType, bool Forced)
|
||||||
//{ //łączenie do (ConnectNo) pojazdu (ConnectTo) stroną (ConnectToNr)
|
//{ //łączenie do (ConnectNo) pojazdu (ConnectTo) stroną (ConnectToNr)
|
||||||
// return Attach(ConnectNo, ConnectToNr, (TMoverParameters *)ConnectTo, CouplingType, Forced);
|
// return Attach(ConnectNo, ConnectToNr, (TMoverParameters *)ConnectTo, CouplingType, Forced);
|
||||||
@@ -1276,10 +1274,10 @@ double TMoverParameters::PipeRatio(void)
|
|||||||
else
|
else
|
||||||
pr = (HighPipePress - 1.0 / 3.0 * DeltaPipePress - Max0R(LowPipePress, PipePress)) /
|
pr = (HighPipePress - 1.0 / 3.0 * DeltaPipePress - Max0R(LowPipePress, PipePress)) /
|
||||||
(DeltaPipePress * 2.0 / 3.0);
|
(DeltaPipePress * 2.0 / 3.0);
|
||||||
//if (not TestFlag(BrakeStatus, b_Ractive))
|
// if (not TestFlag(BrakeStatus, b_Ractive))
|
||||||
// and(BrakeMethod and 1 = 0) and TestFlag(BrakeDelays, bdelay_R) and (Power < 1) and
|
// and(BrakeMethod and 1 = 0) and TestFlag(BrakeDelays, bdelay_R) and (Power < 1) and
|
||||||
// (BrakeCtrlPos < 1) then pr : = Min0R(0.5, pr);
|
// (BrakeCtrlPos < 1) then pr : = Min0R(0.5, pr);
|
||||||
//if (Compressor > 0.5)
|
// if (Compressor > 0.5)
|
||||||
// then pr : = pr * 1.333; // dziwny rapid wywalamy
|
// then pr : = pr * 1.333; // dziwny rapid wywalamy
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1377,7 +1375,8 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
|||||||
(((Couplers[b].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
(((Couplers[b].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||||
{
|
{
|
||||||
HVCouplers[1 - b][1] =
|
HVCouplers[1 - b][1] =
|
||||||
Max0R(abs(hvc), Couplers[b].Connected->HVCouplers[Couplers[b].ConnectedNr][1] -
|
Max0R(abs(hvc),
|
||||||
|
Couplers[b].Connected->HVCouplers[Couplers[b].ConnectedNr][1] -
|
||||||
HVCouplers[b][0] * 0.02);
|
HVCouplers[b][0] * 0.02);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1408,12 +1407,10 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
|||||||
{
|
{
|
||||||
if (((Couplers[0].CouplingFlag & ctrain_power) == ctrain_power) ||
|
if (((Couplers[0].CouplingFlag & ctrain_power) == ctrain_power) ||
|
||||||
(((Couplers[0].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
(((Couplers[0].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||||
TotalCurrent +=
|
TotalCurrent += Couplers[0].Connected->HVCouplers[1 - Couplers[0].ConnectedNr][0];
|
||||||
Couplers[0].Connected->HVCouplers[1 - Couplers[0].ConnectedNr][0];
|
|
||||||
if (((Couplers[1].CouplingFlag & ctrain_power) == ctrain_power) ||
|
if (((Couplers[1].CouplingFlag & ctrain_power) == ctrain_power) ||
|
||||||
(((Couplers[1].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
(((Couplers[1].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||||
TotalCurrent +=
|
TotalCurrent += Couplers[1].Connected->HVCouplers[1 - Couplers[1].ConnectedNr][0];
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -1425,11 +1422,11 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
|||||||
RunningTrack = Track;
|
RunningTrack = Track;
|
||||||
RunningTraction = ElectricTraction;
|
RunningTraction = ElectricTraction;
|
||||||
|
|
||||||
//if (!DynamicBrakeFlag)
|
// if (!DynamicBrakeFlag)
|
||||||
// RunningTraction.TractionVoltage = ElectricTraction.TractionVoltage /*-
|
// RunningTraction.TractionVoltage = ElectricTraction.TractionVoltage /*-
|
||||||
// abs(ElectricTraction.TractionResistivity *
|
// abs(ElectricTraction.TractionResistivity *
|
||||||
// (Itot + HVCouplers[0][0] + HVCouplers[1][0]))*/;
|
// (Itot + HVCouplers[0][0] + HVCouplers[1][0]))*/;
|
||||||
//else
|
// else
|
||||||
// RunningTraction.TractionVoltage =
|
// RunningTraction.TractionVoltage =
|
||||||
// ElectricTraction.TractionVoltage /*-
|
// ElectricTraction.TractionVoltage /*-
|
||||||
// abs(ElectricTraction.TractionResistivity * Itot *
|
// abs(ElectricTraction.TractionResistivity * Itot *
|
||||||
@@ -2638,8 +2635,8 @@ bool TMoverParameters::IncBrakeLevelOld(void)
|
|||||||
(BrakePressureTable[BrakeCtrlPos - 1].PipePressureVal > 0))
|
(BrakePressureTable[BrakeCtrlPos - 1].PipePressureVal > 0))
|
||||||
LimPipePress = PipePress;
|
LimPipePress = PipePress;
|
||||||
|
|
||||||
//ten kawałek jest bez sensu gdyż nic nie robił. Zakomntowałem. GF 20161124
|
// ten kawałek jest bez sensu gdyż nic nie robił. Zakomntowałem. GF 20161124
|
||||||
//if (BrakeSystem == ElectroPneumatic)
|
// if (BrakeSystem == ElectroPneumatic)
|
||||||
// if (BrakeSubsystem != ss_K)
|
// if (BrakeSubsystem != ss_K)
|
||||||
// {
|
// {
|
||||||
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
||||||
@@ -2681,7 +2678,7 @@ bool TMoverParameters::DecBrakeLevelOld(void)
|
|||||||
{
|
{
|
||||||
BrakeCtrlPos--;
|
BrakeCtrlPos--;
|
||||||
// BrakeCtrlPosR:=BrakeCtrlPos;
|
// BrakeCtrlPosR:=BrakeCtrlPos;
|
||||||
//if (EmergencyBrakeFlag)
|
// if (EmergencyBrakeFlag)
|
||||||
//{
|
//{
|
||||||
// EmergencyBrakeFlag = false; //!!!
|
// EmergencyBrakeFlag = false; //!!!
|
||||||
// SendCtrlToNext("Emergency_brake", 0, CabNo);
|
// SendCtrlToNext("Emergency_brake", 0, CabNo);
|
||||||
@@ -2713,7 +2710,7 @@ bool TMoverParameters::DecBrakeLevelOld(void)
|
|||||||
// LimPipePress:=PipePress;
|
// LimPipePress:=PipePress;
|
||||||
|
|
||||||
// to nic nie robi. Zakomentowałem. GF 20161124
|
// to nic nie robi. Zakomentowałem. GF 20161124
|
||||||
//if (BrakeSystem == ElectroPneumatic)
|
// if (BrakeSystem == ElectroPneumatic)
|
||||||
// if (BrakeSubsystem != ss_K)
|
// if (BrakeSubsystem != ss_K)
|
||||||
// {
|
// {
|
||||||
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
||||||
@@ -2949,7 +2946,7 @@ bool TMoverParameters::AntiSlippingBrake(void)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
bool TMoverParameters::BrakeReleaser(int state)
|
bool TMoverParameters::BrakeReleaser(int state)
|
||||||
{
|
{
|
||||||
bool OK = true; //false tylko jeśli nie uda się wysłać, GF 20161124
|
bool OK = true; // false tylko jeśli nie uda się wysłać, GF 20161124
|
||||||
Hamulec->Releaser(state);
|
Hamulec->Releaser(state);
|
||||||
if (CabNo != 0) // rekurencyjne wysłanie do następnego
|
if (CabNo != 0) // rekurencyjne wysłanie do następnego
|
||||||
OK = SendCtrlToNext("BrakeReleaser", state, CabNo);
|
OK = SendCtrlToNext("BrakeReleaser", state, CabNo);
|
||||||
@@ -3124,8 +3121,8 @@ bool TMoverParameters::DecBrakeMult(void)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
void TMoverParameters::UpdateBrakePressure(double dt)
|
void TMoverParameters::UpdateBrakePressure(double dt)
|
||||||
{
|
{
|
||||||
//const double LBDelay = 5.0; // stala czasowa hamulca
|
// const double LBDelay = 5.0; // stala czasowa hamulca
|
||||||
//double Rate, Speed, dp, sm;
|
// double Rate, Speed, dp, sm;
|
||||||
|
|
||||||
dpLocalValve = 0;
|
dpLocalValve = 0;
|
||||||
dpBrake = 0;
|
dpBrake = 0;
|
||||||
@@ -3156,10 +3153,11 @@ void TMoverParameters::CompressorCheck(double dt)
|
|||||||
(DElist[MainCtrlPos].RPM / DElist[MainCtrlPosNo].RPM);
|
(DElist[MainCtrlPos].RPM / DElist[MainCtrlPosNo].RPM);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CompressedVolume +=
|
CompressedVolume += dt * CompressorSpeed *
|
||||||
dt * CompressorSpeed * (2.0 * MaxCompressor - Compressor) / MaxCompressor;
|
(2.0 * MaxCompressor - Compressor) / MaxCompressor;
|
||||||
TotalCurrent += 0.0015
|
TotalCurrent +=
|
||||||
* Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
0.0015 *
|
||||||
|
Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3192,8 +3190,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
|||||||
CompressorFlag = false; // bez tamtego członu nie zadziała
|
CompressorFlag = false; // bez tamtego członu nie zadziała
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CompressorFlag = (CompressorAllow) &&
|
CompressorFlag =
|
||||||
((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
(CompressorAllow) && ((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||||
if (Compressor >
|
if (Compressor >
|
||||||
MaxCompressor) // wyłącznik ciśnieniowy jest niezależny od sposobu zasilania
|
MaxCompressor) // wyłącznik ciśnieniowy jest niezależny od sposobu zasilania
|
||||||
CompressorFlag = false;
|
CompressorFlag = false;
|
||||||
@@ -3221,8 +3219,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
|||||||
CompressorFlag = false; // bez tamtego członu nie zadziała
|
CompressorFlag = false; // bez tamtego członu nie zadziała
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CompressorFlag = (CompressorAllow) &&
|
CompressorFlag =
|
||||||
((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
(CompressorAllow) && ((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||||
if (CompressorFlag) // jeśli została załączona
|
if (CompressorFlag) // jeśli została załączona
|
||||||
LastSwitchingTime = 0; // to trzeba ograniczyć ponowne włączenie
|
LastSwitchingTime = 0; // to trzeba ograniczyć ponowne włączenie
|
||||||
}
|
}
|
||||||
@@ -3250,7 +3248,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
|||||||
// sprężarki, tak z 5A na
|
// sprężarki, tak z 5A na
|
||||||
// sprężarkę
|
// sprężarkę
|
||||||
else
|
else
|
||||||
TotalCurrent += 0.0015 *
|
TotalCurrent +=
|
||||||
|
0.0015 *
|
||||||
Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3279,8 +3278,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
// with BrakePressureTable[BrakeCtrlPos] do
|
// with BrakePressureTable[BrakeCtrlPos] do
|
||||||
{
|
{
|
||||||
if ((EngineType != ElectricInductionMotor))
|
if ((EngineType != ElectricInductionMotor))
|
||||||
dpLocalValve =
|
dpLocalValve = LocHandle->GetPF(Max0R(LocalBrakePos / LocalBrakePosNo, LocalBrakePosA),
|
||||||
LocHandle->GetPF(Max0R(LocalBrakePos / LocalBrakePosNo, LocalBrakePosA),
|
|
||||||
Hamulec->GetBCP(), ScndPipePress, dt, 0);
|
Hamulec->GetBCP(), ScndPipePress, dt, 0);
|
||||||
else
|
else
|
||||||
dpLocalValve =
|
dpLocalValve =
|
||||||
@@ -3312,8 +3310,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
|
|
||||||
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then //ulepszony hamulec bezp.
|
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then //ulepszony hamulec bezp.
|
||||||
if ((EmergencyBrakeFlag) || (TestFlag(SecuritySystem.Status, s_SHPebrake)) ||
|
if ((EmergencyBrakeFlag) || (TestFlag(SecuritySystem.Status, s_SHPebrake)) ||
|
||||||
(TestFlag(SecuritySystem.Status, s_CAebrake)) ||
|
(TestFlag(SecuritySystem.Status, s_CAebrake)) || (s_CAtestebrake == true) ||
|
||||||
(s_CAtestebrake == true) ||
|
|
||||||
(TestFlag(EngDmgFlag, 32)) /* or (not Battery)*/) // ulepszony hamulec bezp.
|
(TestFlag(EngDmgFlag, 32)) /* or (not Battery)*/) // ulepszony hamulec bezp.
|
||||||
dpMainValve = dpMainValve + PF(0, PipePress, 0.15) * dt;
|
dpMainValve = dpMainValve + PF(0, PipePress, 0.15) * dt;
|
||||||
// 0.2*Spg
|
// 0.2*Spg
|
||||||
@@ -3361,7 +3358,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
((Couplers[b].CouplingFlag & 36) == 36))
|
((Couplers[b].CouplingFlag & 36) == 36))
|
||||||
LocBrakePress = Max0R(Couplers[b].Connected->LocHandle->GetCP(), LocBrakePress);
|
LocBrakePress = Max0R(Couplers[b].Connected->LocHandle->GetCP(), LocBrakePress);
|
||||||
|
|
||||||
//if ((DynamicBrakeFlag) && (EngineType == ElectricInductionMotor))
|
// if ((DynamicBrakeFlag) && (EngineType == ElectricInductionMotor))
|
||||||
//{
|
//{
|
||||||
// //if (Vel > 10)
|
// //if (Vel > 10)
|
||||||
// // LocBrakePress = 0;
|
// // LocBrakePress = 0;
|
||||||
@@ -3562,11 +3559,12 @@ double TMoverParameters::GetDVc(double dt)
|
|||||||
c->Physic_ReActivation();
|
c->Physic_ReActivation();
|
||||||
c->Pipe->Flow(-dv2);
|
c->Pipe->Flow(-dv2);
|
||||||
}
|
}
|
||||||
//if ((Couplers[1].Connected != NULL) && (Couplers[0].Connected != NULL))
|
// if ((Couplers[1].Connected != NULL) && (Couplers[0].Connected != NULL))
|
||||||
// if ((TestFlag(Couplers[0].CouplingFlag, ctrain_pneumatic)) &&
|
// if ((TestFlag(Couplers[0].CouplingFlag, ctrain_pneumatic)) &&
|
||||||
// (TestFlag(Couplers[1].CouplingFlag, ctrain_pneumatic)))
|
// (TestFlag(Couplers[1].CouplingFlag, ctrain_pneumatic)))
|
||||||
// {
|
// {
|
||||||
// dV = 0.05 * dt * PF(Couplers[0].Connected->PipePress, Couplers[1].Connected->PipePress,
|
// dV = 0.05 * dt * PF(Couplers[0].Connected->PipePress,
|
||||||
|
// Couplers[1].Connected->PipePress,
|
||||||
// (Spg * 0.85) / (1 + 0.03 * Dim.L)) *
|
// (Spg * 0.85) / (1 + 0.03 * Dim.L)) *
|
||||||
// 0; // ktoś mi powie jaki jest sens tego bloku jeśli przepływ mnożony przez zero?
|
// 0; // ktoś mi powie jaki jest sens tego bloku jeśli przepływ mnożony przez zero?
|
||||||
// Couplers[0].Connected->Pipe->Flow(+dV);
|
// Couplers[0].Connected->Pipe->Flow(+dV);
|
||||||
@@ -3701,7 +3699,7 @@ void TMoverParameters::ComputeTotalForce(double dt, double dt1, bool FullVer)
|
|||||||
Max0R(Max0R(RunningTraction.TractionVoltage, HVCouplers[0][1]), HVCouplers[1][1]);
|
Max0R(Max0R(RunningTraction.TractionVoltage, HVCouplers[0][1]), HVCouplers[1][1]);
|
||||||
else
|
else
|
||||||
Voltage = 0;
|
Voltage = 0;
|
||||||
//if (Mains && /*(abs(CabNo) < 2) &&*/ (
|
// if (Mains && /*(abs(CabNo) < 2) &&*/ (
|
||||||
// EngineType == ElectricInductionMotor)) // potem ulepszyc! pantogtrafy!
|
// EngineType == ElectricInductionMotor)) // potem ulepszyc! pantogtrafy!
|
||||||
// Voltage = RunningTraction.TractionVoltage;
|
// Voltage = RunningTraction.TractionVoltage;
|
||||||
|
|
||||||
@@ -3734,9 +3732,8 @@ void TMoverParameters::ComputeTotalForce(double dt, double dt1, bool FullVer)
|
|||||||
Couplers[b].CForce = 0;
|
Couplers[b].CForce = 0;
|
||||||
// FStand:=Fb+FrictionForce(RunningShape.R,RunningTrack.DamageFlag);
|
// FStand:=Fb+FrictionForce(RunningShape.R,RunningTrack.DamageFlag);
|
||||||
FStand += Fb;
|
FStand += Fb;
|
||||||
FTrain +=
|
FTrain += TotalMassxg * RunningShape.dHtrack; // doliczenie składowej stycznej grawitacji
|
||||||
TotalMassxg * RunningShape.dHtrack; // doliczenie składowej stycznej grawitacji
|
//! niejawne przypisanie zmiennej!
|
||||||
//!niejawne przypisanie zmiennej!
|
|
||||||
FTotal = FTrain - Sign(V) * FStand;
|
FTotal = FTrain - Sign(V) * FStand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4488,7 +4485,8 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
else if (((dtrans < 0.25) && (LocHandle->GetCP() < 0.25) && (AnPos < 0.01)) ||
|
else if (((dtrans < 0.25) && (LocHandle->GetCP() < 0.25) && (AnPos < 0.01)) ||
|
||||||
((dtrans < 0.25) && (ShuntModeAllow) && (LocalBrakePos == 0)))
|
((dtrans < 0.25) && (ShuntModeAllow) && (LocalBrakePos == 0)))
|
||||||
DynamicBrakeFlag = false;
|
DynamicBrakeFlag = false;
|
||||||
else if ((((BrakePress > 0.25) && (dtrans > 0.25) || (LocHandle->GetCP() > 0.25))) ||
|
else if ((((BrakePress > 0.25) && (dtrans > 0.25) ||
|
||||||
|
(LocHandle->GetCP() > 0.25))) ||
|
||||||
(AnPos > 0.02))
|
(AnPos > 0.02))
|
||||||
DynamicBrakeFlag = true;
|
DynamicBrakeFlag = true;
|
||||||
dtrans = Hamulec->GetEDBCP() * eimc[eimc_p_abed]; // stala napedu
|
dtrans = Hamulec->GetEDBCP() * eimc[eimc_p_abed]; // stala napedu
|
||||||
@@ -4510,7 +4508,8 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
Hamulec->SetED(Max0R(0.0, Min0R(PosRatio, 1)));
|
Hamulec->SetED(Max0R(0.0, Min0R(PosRatio, 1)));
|
||||||
// (Hamulec as TLSt).SetLBP(LocBrakePress*(1-PosRatio));
|
// (Hamulec as TLSt).SetLBP(LocBrakePress*(1-PosRatio));
|
||||||
PosRatio = -Max0R(Min0R(dtrans * 1.0 / MaxBrakePress[0], 1), AnPos) *
|
PosRatio = -Max0R(Min0R(dtrans * 1.0 / MaxBrakePress[0], 1), AnPos) *
|
||||||
Max0R(0, Min0R(1, (Vel - eimc[eimc_p_Vh0]) /
|
Max0R(0, Min0R(1,
|
||||||
|
(Vel - eimc[eimc_p_Vh0]) /
|
||||||
(eimc[eimc_p_Vh1] - eimc[eimc_p_Vh0])));
|
(eimc[eimc_p_Vh1] - eimc[eimc_p_Vh0])));
|
||||||
eimv[eimv_Fzad] = -Max0R(LocalBrakeRatio(), dtrans / MaxBrakePress[0]);
|
eimv[eimv_Fzad] = -Max0R(LocalBrakeRatio(), dtrans / MaxBrakePress[0]);
|
||||||
tmp = 5;
|
tmp = 5;
|
||||||
@@ -4527,7 +4526,8 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
else
|
else
|
||||||
PosRatio =
|
PosRatio =
|
||||||
Min0R(PosRatio, Max0R(-1, 0.5 * (ScndCtrlActualPos * 2 - Vel)));
|
Min0R(PosRatio, Max0R(-1, 0.5 * (ScndCtrlActualPos * 2 - Vel)));
|
||||||
// PosRatio = 1.0 * (PosRatio * 0 + 1) * PosRatio; // 1 * 1 * PosRatio = PosRatio
|
// PosRatio = 1.0 * (PosRatio * 0 + 1) * PosRatio; // 1 * 1 * PosRatio =
|
||||||
|
// PosRatio
|
||||||
Hamulec->SetED(0);
|
Hamulec->SetED(0);
|
||||||
// (Hamulec as TLSt).SetLBP(LocBrakePress);
|
// (Hamulec as TLSt).SetLBP(LocBrakePress);
|
||||||
if ((PosRatio > dizel_fill))
|
if ((PosRatio > dizel_fill))
|
||||||
@@ -4620,18 +4620,16 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
if ((abs(eimv[eimv_fp]) <= eimv[eimv_fkr]))
|
if ((abs(eimv[eimv_fp]) <= eimv[eimv_fkr]))
|
||||||
eimv[eimv_pole] = eimc[eimc_f_cfu] / eimc[eimc_s_cfu];
|
eimv[eimv_pole] = eimc[eimc_f_cfu] / eimc[eimc_s_cfu];
|
||||||
else
|
else
|
||||||
eimv[eimv_pole] =
|
eimv[eimv_pole] = eimv[eimv_Uzsmax] / eimc[eimc_s_cfu] / abs(eimv[eimv_fp]);
|
||||||
eimv[eimv_Uzsmax] / eimc[eimc_s_cfu] / abs(eimv[eimv_fp]);
|
|
||||||
eimv[eimv_U] = eimv[eimv_pole] * eimv[eimv_fp] * eimc[eimc_s_cfu];
|
eimv[eimv_U] = eimv[eimv_pole] * eimv[eimv_fp] * eimc[eimc_s_cfu];
|
||||||
eimv[eimv_Ic] = (eimv[eimv_fp] - DirAbsolute * enrot * eimc[eimc_s_p]) *
|
eimv[eimv_Ic] = (eimv[eimv_fp] - DirAbsolute * enrot * eimc[eimc_s_p]) *
|
||||||
eimc[eimc_s_dfic] * eimv[eimv_pole];
|
eimc[eimc_s_dfic] * eimv[eimv_pole];
|
||||||
eimv[eimv_If] = eimv[eimv_Ic] * eimc[eimc_s_icif];
|
eimv[eimv_If] = eimv[eimv_Ic] * eimc[eimc_s_icif];
|
||||||
eimv[eimv_M] = eimv[eimv_pole] * eimv[eimv_Ic] * eimc[eimc_s_cim];
|
eimv[eimv_M] = eimv[eimv_pole] * eimv[eimv_Ic] * eimc[eimc_s_cim];
|
||||||
eimv[eimv_Ipoj] = (eimv[eimv_Ic] * NPoweredAxles * eimv[eimv_U]) /
|
eimv[eimv_Ipoj] =
|
||||||
(Voltage - eimc[eimc_f_DU]) +
|
(eimv[eimv_Ic] * NPoweredAxles * eimv[eimv_U]) / (Voltage - eimc[eimc_f_DU]) +
|
||||||
eimc[eimc_f_I0];
|
eimc[eimc_f_I0];
|
||||||
eimv[eimv_Pm] =
|
eimv[eimv_Pm] = ActiveDir * eimv[eimv_M] * NPoweredAxles * enrot * Pirazy2 / 1000;
|
||||||
ActiveDir * eimv[eimv_M] * NPoweredAxles * enrot * Pirazy2 / 1000;
|
|
||||||
eimv[eimv_Pe] = eimv[eimv_Ipoj] * Voltage / 1000;
|
eimv[eimv_Pe] = eimv[eimv_Ipoj] * Voltage / 1000;
|
||||||
eimv[eimv_eta] = eimv[eimv_Pm] / eimv[eimv_Pe];
|
eimv[eimv_eta] = eimv[eimv_Pm] / eimv[eimv_Pe];
|
||||||
|
|
||||||
@@ -4653,8 +4651,7 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
i = 0;
|
i = 0;
|
||||||
while ((i < RlistSize - 1) && (DElist[i + 1].RPM < abs(tmpV)))
|
while ((i < RlistSize - 1) && (DElist[i + 1].RPM < abs(tmpV)))
|
||||||
i++;
|
i++;
|
||||||
RventRot = (abs(tmpV) - DElist[i].RPM) /
|
RventRot = (abs(tmpV) - DElist[i].RPM) / (DElist[i + 1].RPM - DElist[i].RPM) *
|
||||||
(DElist[i + 1].RPM - DElist[i].RPM) *
|
|
||||||
(DElist[i + 1].GenPower - DElist[i].GenPower) +
|
(DElist[i + 1].GenPower - DElist[i].GenPower) +
|
||||||
DElist[i].GenPower;
|
DElist[i].GenPower;
|
||||||
}
|
}
|
||||||
@@ -4697,7 +4694,7 @@ double TMoverParameters::TractionForce(double dt)
|
|||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// Q: 20160713
|
// Q: 20160713
|
||||||
//Obliczenie predkości obrotowej kół???
|
// Obliczenie predkości obrotowej kół???
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
double TMoverParameters::ComputeRotatingWheel(double WForce, double dt, double n)
|
double TMoverParameters::ComputeRotatingWheel(double WForce, double dt, double n)
|
||||||
{
|
{
|
||||||
@@ -5742,7 +5739,7 @@ std::string TMoverParameters::EngineDescription(int what)
|
|||||||
// Funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
// Funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
double TMoverParameters::GetTrainsetVoltage(void)
|
double TMoverParameters::GetTrainsetVoltage(void)
|
||||||
{//ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
{ // ABu: funkcja zwracajaca napiecie dla calego skladu, przydatna dla EZT
|
||||||
return Max0R(HVCouplers[1][1], HVCouplers[0][1]);
|
return Max0R(HVCouplers[1][1], HVCouplers[0][1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5854,7 +5851,7 @@ std::string tS(std::string val)
|
|||||||
int Pos(std::string str_find, std::string in)
|
int Pos(std::string str_find, std::string in)
|
||||||
{
|
{
|
||||||
size_t pos = in.find(str_find);
|
size_t pos = in.find(str_find);
|
||||||
return (pos != string::npos ? pos+1 : 0);
|
return (pos != string::npos ? pos + 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
@@ -5962,14 +5959,14 @@ bool TMoverParameters::readMPT(int ln, std::string line)
|
|||||||
x = Split(line);
|
x = Split(line);
|
||||||
|
|
||||||
int s = x.size();
|
int s = x.size();
|
||||||
if ( s < 7 && s > 8)
|
if (s < 7 && s > 8)
|
||||||
{
|
{
|
||||||
WriteLog("Read MPT: wrong argument number of arguments in line " + to_string(ln -1));
|
WriteLog("Read MPT: wrong argument number of arguments in line " + to_string(ln - 1));
|
||||||
MPTLINE++;
|
MPTLINE++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < s; i++)
|
for (int i = 0; i < s; i++)
|
||||||
x[i] = TrimSpace(x[i]);
|
x[i] = TrimSpace(x[i]);
|
||||||
|
|
||||||
bl = atoi(x[0].c_str()); // numer pozycji
|
bl = atoi(x[0].c_str()); // numer pozycji
|
||||||
@@ -5980,10 +5977,10 @@ bool TMoverParameters::readMPT(int ln, std::string line)
|
|||||||
MotorParam[bl].fi = atof(x[4].c_str());
|
MotorParam[bl].fi = atof(x[4].c_str());
|
||||||
MotorParam[bl].Isat = atof(x[5].c_str());
|
MotorParam[bl].Isat = atof(x[5].c_str());
|
||||||
MotorParam[bl].fi0 = atof(x[6].c_str());
|
MotorParam[bl].fi0 = atof(x[6].c_str());
|
||||||
MotorParam[bl].AutoSwitch = s == 8 ? atoi(x[7].c_str()): false;
|
MotorParam[bl].AutoSwitch = s == 8 ? atoi(x[7].c_str()) : false;
|
||||||
|
|
||||||
//--WriteLog(":::: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4 + "," + p5 + "," +
|
//--WriteLog(":::: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4 + "," + p5 + "," +
|
||||||
//p6);
|
// p6);
|
||||||
}
|
}
|
||||||
MPTLINE++;
|
MPTLINE++;
|
||||||
return true;
|
return true;
|
||||||
@@ -6010,7 +6007,7 @@ bool TMoverParameters::readRLIST(int ln, std::string line)
|
|||||||
x = Split(xxx); // split je wskaznik na char jak i std::string
|
x = Split(xxx); // split je wskaznik na char jak i std::string
|
||||||
|
|
||||||
int s = x.size();
|
int s = x.size();
|
||||||
if ( s < 5 && s > 6)
|
if (s < 5 && s > 6)
|
||||||
{
|
{
|
||||||
WriteLog("Read RLIST: wrong argument number of arguments in line " + to_string(ln - 1));
|
WriteLog("Read RLIST: wrong argument number of arguments in line " + to_string(ln - 1));
|
||||||
delete[] xxx;
|
delete[] xxx;
|
||||||
@@ -6032,7 +6029,7 @@ bool TMoverParameters::readRLIST(int ln, std::string line)
|
|||||||
RList[k].Bn = atoi(x[2].c_str()); // int
|
RList[k].Bn = atoi(x[2].c_str()); // int
|
||||||
RList[k].Mn = atoi(x[3].c_str()); // int
|
RList[k].Mn = atoi(x[3].c_str()); // int
|
||||||
RList[k].AutoSwitch = (bool)atoi(x[4].c_str()); // p4.ToInt();
|
RList[k].AutoSwitch = (bool)atoi(x[4].c_str()); // p4.ToInt();
|
||||||
RList[k].ScndAct = s == 6 ? atoi(x[5].c_str()) : 0; //jeśli ma boczniki w nastawniku
|
RList[k].ScndAct = s == 6 ? atoi(x[5].c_str()) : 0; // jeśli ma boczniki w nastawniku
|
||||||
//--WriteLog("RLIST: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
|
//--WriteLog("RLIST: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
|
||||||
}
|
}
|
||||||
delete[] xxx;
|
delete[] xxx;
|
||||||
@@ -6080,7 +6077,8 @@ bool TMoverParameters::readBPT(int ln, std::string line)
|
|||||||
BrakePressureTable[k].BrakeType = Individual;
|
BrakePressureTable[k].BrakeType = Individual;
|
||||||
|
|
||||||
// WriteLog("BPTx: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
|
// WriteLog("BPTx: " + p0 + "," + p1 + "," + p2 + "," + p3 + "," + p4);
|
||||||
//WriteLog("BPTk: " + to_string(k) + "," + to_string(BrakePressureTable[k].PipePressureVal) +
|
// WriteLog("BPTk: " + to_string(k) + "," + to_string(BrakePressureTable[k].PipePressureVal)
|
||||||
|
// +
|
||||||
// "," + to_string(BrakePressureTable[k].BrakePressureVal) + "," +
|
// "," + to_string(BrakePressureTable[k].BrakePressureVal) + "," +
|
||||||
// to_string(BrakePressureTable[k].FlowSpeedVal) + "," + p4);
|
// to_string(BrakePressureTable[k].FlowSpeedVal) + "," + p4);
|
||||||
|
|
||||||
@@ -6258,11 +6256,11 @@ void TMoverParameters::PowerParamDecode(std::string lines, std::string prefix,
|
|||||||
{
|
{
|
||||||
//--case NotDefined : PowerType = PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
//--case NotDefined : PowerType = PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
||||||
//--case InternalSource : PowerType =
|
//--case InternalSource : PowerType =
|
||||||
//PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
// PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
||||||
//--case Transducer : InputVoltage =
|
//--case Transducer : InputVoltage =
|
||||||
//s2rE(DUE(ExtractKeyWord(lines,prefix+'TransducerInputV=')));
|
// s2rE(DUE(ExtractKeyWord(lines,prefix+'TransducerInputV=')));
|
||||||
//--case Generator :
|
//--case Generator :
|
||||||
//GeneratorEngine:=EngineDecode(DUE(ExtractKeyWord(lines,prefix+'GeneratorEngine=')));
|
// GeneratorEngine:=EngineDecode(DUE(ExtractKeyWord(lines,prefix+'GeneratorEngine=')));
|
||||||
//--case Accumulator:
|
//--case Accumulator:
|
||||||
//--{
|
//--{
|
||||||
//-- RAccumulator.MaxCapacity:=s2r(DUE(ExtractKeyWord(lines,prefix+'Cap=')));
|
//-- RAccumulator.MaxCapacity:=s2r(DUE(ExtractKeyWord(lines,prefix+'Cap=')));
|
||||||
@@ -6370,10 +6368,10 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool secBPT = false, secMotorParamTable0 = false, secPower = false, secEngine = false,
|
bool secBPT = false, secMotorParamTable0 = false, secPower = false, secEngine = false,
|
||||||
secParam = false, secLoad = false, secDimensions = false,
|
secParam = false, secLoad = false, secDimensions = false, secWheels = false,
|
||||||
secWheels = false, secBrake = false, secBuffCoupl = false, secCntrl = false,
|
secBrake = false, secBuffCoupl = false, secCntrl = false, secSecurity = false,
|
||||||
secSecurity = false, secLight = false, secCircuit = false, secRList = false,
|
secLight = false, secCircuit = false, secRList = false, secDList = false,
|
||||||
secDList = false, secWWList = false, secffList = false, secTurboPos = false;
|
secWWList = false, secffList = false, secTurboPos = false;
|
||||||
|
|
||||||
ConversionError = 0;
|
ConversionError = 0;
|
||||||
|
|
||||||
@@ -7283,7 +7281,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
// WriteLog("----------------------------------------------------------------------------------------");
|
// WriteLog("----------------------------------------------------------------------------------------");
|
||||||
WriteLog("CERROR: " + to_string(ConversionError) + ", SUCCES: " + to_string(OK));
|
WriteLog("CERROR: " + to_string(ConversionError) + ", SUCCES: " + to_string(OK));
|
||||||
// WriteLogSS();
|
// WriteLogSS();
|
||||||
//WriteLog("");
|
// WriteLog("");
|
||||||
return OK;
|
return OK;
|
||||||
} // LoadFIZ()
|
} // LoadFIZ()
|
||||||
|
|
||||||
@@ -7334,7 +7332,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
|
|||||||
if ((TestFlag(BrakeDelays, bdelay_R)) && !(TestFlag(BrakeDelays, bdelay_G)))
|
if ((TestFlag(BrakeDelays, bdelay_R)) && !(TestFlag(BrakeDelays, bdelay_G)))
|
||||||
BrakeDelayFlag = bdelay_R;
|
BrakeDelayFlag = bdelay_R;
|
||||||
|
|
||||||
int DefBrakeTable[8] = { 15, 4, 25, 25, 13, 3, 12, 2 };
|
int DefBrakeTable[8] = {15, 4, 25, 25, 13, 3, 12, 2};
|
||||||
|
|
||||||
if (LoadFlag > 0)
|
if (LoadFlag > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
1032
McZapkie/hamulce.h
1032
McZapkie/hamulce.h
File diff suppressed because it is too large
Load Diff
79
mtable.cpp
79
mtable.cpp
@@ -14,7 +14,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "mtable.h"
|
#include "mtable.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
//using namespace Mtable;
|
// using namespace Mtable;
|
||||||
TMTableTime *Mtable::GlobalTime;
|
TMTableTime *Mtable::GlobalTime;
|
||||||
|
|
||||||
double CompareTime(double t1h, double t1m, double t2h, double t2m) /*roznica czasu w minutach*/
|
double CompareTime(double t1h, double t1m, double t2h, double t2m) /*roznica czasu w minutach*/
|
||||||
@@ -46,7 +46,7 @@ double TTrainParameters::CheckTrainLatency()
|
|||||||
}
|
}
|
||||||
|
|
||||||
double TTrainParameters::WatchMTable(double DistCounter)
|
double TTrainParameters::WatchMTable(double DistCounter)
|
||||||
{ //zwraca odlegloϾ do najblizszej stacji z zatrzymaniem
|
{ // zwraca odlegloϾ do najblizszej stacji z zatrzymaniem
|
||||||
double dist;
|
double dist;
|
||||||
|
|
||||||
if (Direction == 1)
|
if (Direction == 1)
|
||||||
@@ -81,7 +81,8 @@ bool TTrainParameters::UpdateMTable(double hh, double mm, std::string NewName)
|
|||||||
{
|
{
|
||||||
if (NewName == NextStationName) // jeœli dojechane do nastêpnego
|
if (NewName == NextStationName) // jeœli dojechane do nastêpnego
|
||||||
{ // Ra: wywo³anie mo¿e byæ powtarzane, jak stoi na W4
|
{ // Ra: wywo³anie mo¿e byæ powtarzane, jak stoi na W4
|
||||||
if (TimeTable[StationIndex + 1].km - TimeTable[StationIndex].km < 0) // to jest bez sensu
|
if (TimeTable[StationIndex + 1].km - TimeTable[StationIndex].km <
|
||||||
|
0) // to jest bez sensu
|
||||||
Direction = -1;
|
Direction = -1;
|
||||||
else
|
else
|
||||||
Direction = 1; // prowizorka bo moze byc zmiana kilometrazu
|
Direction = 1; // prowizorka bo moze byc zmiana kilometrazu
|
||||||
@@ -187,7 +188,7 @@ void TTrainParameters::UpdateVelocity(int StationCount, double vActual)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
// bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||||
//{
|
//{
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
@@ -216,10 +217,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
s = scnpath + TrainName + ".txt";
|
s = scnpath + TrainName + ".txt";
|
||||||
// Ra 2014-09: ustaliæ zasady wyznaczenia pierwotnego pliku przy przesuniêtych rozk³adach
|
// Ra 2014-09: ustaliæ zasady wyznaczenia pierwotnego pliku przy przesuniêtych rozk³adach
|
||||||
// (kolejny poci¹g dostaje numer +2)
|
// (kolejny poci¹g dostaje numer +2)
|
||||||
fin.open(s.c_str()); //otwieranie pliku
|
fin.open(s.c_str()); // otwieranie pliku
|
||||||
|
|
||||||
if (!fin.is_open())
|
if (!fin.is_open())
|
||||||
{ //jeœli nie ma pliku
|
{ // jeœli nie ma pliku
|
||||||
vmax = atoi(TrainName.c_str()); // nie ma pliku ale jest liczba
|
vmax = atoi(TrainName.c_str()); // nie ma pliku ale jest liczba
|
||||||
if ((vmax > 10) && (vmax < 200))
|
if ((vmax > 10) && (vmax < 200))
|
||||||
{
|
{
|
||||||
@@ -235,7 +236,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
ConversionError = 0;
|
ConversionError = 0;
|
||||||
while (fin.good() && !((ConversionError != 0) || EndTable))
|
while (fin.good() && !((ConversionError != 0) || EndTable))
|
||||||
{
|
{
|
||||||
std::getline(fin,lines); /*wczytanie linii*/
|
std::getline(fin, lines); /*wczytanie linii*/
|
||||||
if (lines.find("___________________") != std::string::npos) /*linia pozioma górna*/
|
if (lines.find("___________________") != std::string::npos) /*linia pozioma górna*/
|
||||||
{
|
{
|
||||||
fin >> s;
|
fin >> s;
|
||||||
@@ -261,48 +262,48 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
TrainName = s; // nadanie nazwy z pliku TXT (bez œcie¿ki do pliku)
|
TrainName = s; // nadanie nazwy z pliku TXT (bez œcie¿ki do pliku)
|
||||||
// else
|
// else
|
||||||
{ /*czytaj naglowek*/
|
{ /*czytaj naglowek*/
|
||||||
while(fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s.find("_______|") != std::string::npos)
|
if (s.find("_______|") != std::string::npos)
|
||||||
break;
|
break;
|
||||||
//fin >> s;
|
// fin >> s;
|
||||||
} //while (!(s.find("_______|") != std::string::npos) || fin.eof());
|
} // while (!(s.find("_______|") != std::string::npos) || fin.eof());
|
||||||
while (fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s == "[")
|
if (s == "[")
|
||||||
break;
|
break;
|
||||||
} //while (!() || (fin.eof())); /*pierwsza linia z relacj¹*/
|
} // while (!() || (fin.eof())); /*pierwsza linia z relacj¹*/
|
||||||
while(fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s != "|")
|
if (s != "|")
|
||||||
break;
|
break;
|
||||||
} //while (!(() || fin.eof()));
|
} // while (!(() || fin.eof()));
|
||||||
if (s != "|")
|
if (s != "|")
|
||||||
Relation1 = s;
|
Relation1 = s;
|
||||||
else
|
else
|
||||||
ConversionError = -5;
|
ConversionError = -5;
|
||||||
while(fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s == "Relacja")
|
if (s == "Relacja")
|
||||||
break;
|
break;
|
||||||
} //while (
|
} // while (
|
||||||
// !( || (fin.eof()))); /*druga linia z relacj¹*/
|
// !( || (fin.eof()))); /*druga linia z relacj¹*/
|
||||||
while (fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s == "|")
|
if (s == "|")
|
||||||
break;
|
break;
|
||||||
} //while (!( || (fin.eof())));
|
} // while (!( || (fin.eof())));
|
||||||
fin >> Relation2;
|
fin >> Relation2;
|
||||||
while (fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if (s == "Wymagany")
|
if (s == "Wymagany")
|
||||||
break;
|
break;
|
||||||
}// while (!();
|
} // while (!();
|
||||||
while (fin >> s || !fin.bad())
|
while (fin >> s || !fin.bad())
|
||||||
{
|
{
|
||||||
if ((s == "|") || (s == "\n"))
|
if ((s == "|") || (s == "\n"))
|
||||||
break;
|
break;
|
||||||
} //while (!());
|
} // while (!());
|
||||||
fin >> s;
|
fin >> s;
|
||||||
s = s.substr(0, s.find("%"));
|
s = s.substr(0, s.find("%"));
|
||||||
BrakeRatio = atof(s.c_str());
|
BrakeRatio = atof(s.c_str());
|
||||||
@@ -310,13 +311,13 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
{
|
{
|
||||||
if (s == "Seria")
|
if (s == "Seria")
|
||||||
break;
|
break;
|
||||||
} //while (!(s == "Seria"));
|
} // while (!(s == "Seria"));
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
fin >> s;
|
fin >> s;
|
||||||
} while (!((s == "|") || (fin.bad())));
|
} while (!((s == "|") || (fin.bad())));
|
||||||
fin >> LocSeries;
|
fin >> LocSeries;
|
||||||
fin >> LocLoad;// = s2rE(ReadWord(fin));
|
fin >> LocLoad; // = s2rE(ReadWord(fin));
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
fin >> s;
|
fin >> s;
|
||||||
@@ -339,7 +340,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
record->km = atof(s.c_str());
|
record->km = atof(s.c_str());
|
||||||
fin >> s;
|
fin >> s;
|
||||||
}
|
}
|
||||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
if (s.find("|_____|") !=
|
||||||
|
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||||
UpdateVelocity(StationCount, vActual);
|
UpdateVelocity(StationCount, vActual);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -360,9 +362,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
{
|
{
|
||||||
if (s.find(hrsd) != std::string::npos)
|
if (s.find(hrsd) != std::string::npos)
|
||||||
{
|
{
|
||||||
record->Ah = atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina przyjazdu
|
record->Ah = atoi(
|
||||||
record->Am = atoi(
|
s.substr(0, s.find(hrsd)).c_str()); // godzina przyjazdu
|
||||||
s.substr(s.find(hrsd) + 1, s.length()).c_str()); // minuta przyjazdu
|
record->Am = atoi(s.substr(s.find(hrsd) + 1, s.length())
|
||||||
|
.c_str()); // minuta przyjazdu
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -387,7 +390,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
||||||
fin >> s;
|
fin >> s;
|
||||||
}
|
}
|
||||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
if (s.find("|_____|") !=
|
||||||
|
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||||
UpdateVelocity(StationCount, vActual);
|
UpdateVelocity(StationCount, vActual);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -408,9 +412,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
{
|
{
|
||||||
if (s.find(hrsd) != std::string::npos)
|
if (s.find(hrsd) != std::string::npos)
|
||||||
{
|
{
|
||||||
record->Dh = atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina odjazdu
|
record->Dh =
|
||||||
record->Dm = atoi(
|
atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina odjazdu
|
||||||
s.substr(s.find(hrsd) + 1, s.length()).c_str()); // minuta odjazdu
|
record->Dm = atoi(s.substr(s.find(hrsd) + 1, s.length())
|
||||||
|
.c_str()); // minuta odjazdu
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -421,11 +426,15 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
record->Dh = record->Ah; // odjazd o tej samej, co przyjazd (dla ostatniego te¿)
|
record->Dh = record->Ah; // odjazd o tej samej, co przyjazd (dla
|
||||||
record->Dm = record->Am; // bo s¹ u¿ywane do wyliczenia opóŸnienia po dojechaniu
|
// ostatniego te¿)
|
||||||
|
record->Dm = record->Am; // bo s¹ u¿ywane do wyliczenia opóŸnienia
|
||||||
|
// po dojechaniu
|
||||||
}
|
}
|
||||||
if ((record->Ah >= 0))
|
if ((record->Ah >= 0))
|
||||||
record->WaitTime = (int)(CompareTime(record->Ah, record->Am, record->Dh, record->Dm) + 0.1);
|
record->WaitTime = (int)(CompareTime(record->Ah, record->Am,
|
||||||
|
record->Dh, record->Dm) +
|
||||||
|
0.1);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
fin >> s;
|
fin >> s;
|
||||||
@@ -443,7 +452,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
||||||
fin >> s;
|
fin >> s;
|
||||||
}
|
}
|
||||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
if (s.find("|_____|") !=
|
||||||
|
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||||
UpdateVelocity(StationCount, vActual);
|
UpdateVelocity(StationCount, vActual);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -540,8 +550,3 @@ bool TTrainParameters::DirectionChange()
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
32
mtable.h
32
mtable.h
@@ -18,14 +18,14 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
namespace Mtable
|
namespace Mtable
|
||||||
{
|
{
|
||||||
|
|
||||||
static int const MaxTTableSize = 100; // mo¿na by to robiæ dynamicznie
|
static int const MaxTTableSize = 100; // mo¿na by to robiæ dynamicznie
|
||||||
static char const *hrsd = ".";
|
static char const *hrsd = ".";
|
||||||
|
|
||||||
// Ra: pozycja zerowa rozk³adu chyba nie ma sensu
|
// Ra: pozycja zerowa rozk³adu chyba nie ma sensu
|
||||||
// Ra: numeracja przystanków jest 1..StationCount
|
// Ra: numeracja przystanków jest 1..StationCount
|
||||||
|
|
||||||
struct TMTableLine
|
struct TMTableLine
|
||||||
{
|
{
|
||||||
double km; // kilometraz linii
|
double km; // kilometraz linii
|
||||||
double vmax; // predkosc rozkladowa przed przystankiem
|
double vmax; // predkosc rozkladowa przed przystankiem
|
||||||
// StationName:string[32]; //nazwa stacji ('_' zamiast spacji)
|
// StationName:string[32]; //nazwa stacji ('_' zamiast spacji)
|
||||||
@@ -48,14 +48,14 @@ namespace Mtable
|
|||||||
Ah, Am, Dh, Dm = -1;
|
Ah, Am, Dh, Dm = -1;
|
||||||
WaitTime, tm = 0;
|
WaitTime, tm = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef TMTableLine TMTable[MaxTTableSize + 1];
|
typedef TMTableLine TMTable[MaxTTableSize + 1];
|
||||||
|
|
||||||
//typedef TTrainParameters *PTrainParameters;
|
// typedef TTrainParameters *PTrainParameters;
|
||||||
|
|
||||||
class TTrainParameters
|
class TTrainParameters
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string TrainName;
|
std::string TrainName;
|
||||||
double TTVmax;
|
double TTVmax;
|
||||||
@@ -84,11 +84,11 @@ namespace Mtable
|
|||||||
bool LoadTTfile(std::string scnpath, int iPlus, double vmax);
|
bool LoadTTfile(std::string scnpath, int iPlus, double vmax);
|
||||||
bool DirectionChange();
|
bool DirectionChange();
|
||||||
void StationIndexInc();
|
void StationIndexInc();
|
||||||
};
|
};
|
||||||
|
|
||||||
class TMTableTime
|
class TMTableTime
|
||||||
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
double GameTime;
|
double GameTime;
|
||||||
int dd;
|
int dd;
|
||||||
@@ -101,9 +101,9 @@ namespace Mtable
|
|||||||
double mr;
|
double mr;
|
||||||
void UpdateMTableTime(double deltaT);
|
void UpdateMTableTime(double deltaT);
|
||||||
TMTableTime(int InitH, int InitM, int InitSRH, int InitSRM, int InitSSH, int InitSSM);
|
TMTableTime(int InitH, int InitM, int InitSRH, int InitSRM, int InitSSH, int InitSSM);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern TMTableTime *GlobalTime;
|
extern TMTableTime *GlobalTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
|
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
|
||||||
|
|||||||
Reference in New Issue
Block a user