mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01: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.filters
|
||||
*.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
|
||||
int kropka = MoreParams.find("."); // znajdź kropke
|
||||
string ActPar; // na parametry
|
||||
while (kropka > 0) // jesli sa kropki jeszcze
|
||||
while (kropka != std::string::npos) // jesli sa kropki jeszcze
|
||||
{
|
||||
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
|
||||
// obrobki
|
||||
kropka = MoreParams.find(".");
|
||||
|
||||
13
EU07.bpr
13
EU07.bpr
@@ -41,8 +41,7 @@
|
||||
<OPTIONS>
|
||||
<IDLCFLAGS value="-src_suffix cpp -DGLEW_STATIC -D_DEBUG -IConsole -Iopengl -IMcZapkie
|
||||
-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
|
||||
-vi- -c -tW -tWM"/>
|
||||
<CFLAG1 value="-Od -w- -Vx -Ve -X- -r- -a1 -6 -b- -k -y -v -vi- -c -tW -tWM"/>
|
||||
<PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
|
||||
<RFLAGS value=""/>
|
||||
<AFLAGS value="/mx /w2 /zi"/>
|
||||
@@ -58,9 +57,9 @@
|
||||
IncludeVerInfo=1
|
||||
AutoIncBuild=0
|
||||
MajorVer=16
|
||||
MinorVer=0
|
||||
Release=1173
|
||||
Build=481
|
||||
MinorVer=1
|
||||
Release=1174
|
||||
Build=483
|
||||
Debug=1
|
||||
PreRelease=0
|
||||
Special=0
|
||||
@@ -72,13 +71,13 @@ CodePage=1250
|
||||
[Version Info Keys]
|
||||
CompanyName=EU07 Team
|
||||
FileDescription=MaSzyna EU07-424
|
||||
FileVersion=16.0.1173.481
|
||||
FileVersion=16.1.1174.483
|
||||
InternalName=DP+SPKS+asynch+python
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=eu07.exe
|
||||
ProductName=MaSzyna EU07-424
|
||||
ProductVersion=16.0
|
||||
ProductVersion=16.1
|
||||
Comments=
|
||||
|
||||
[Excluded Packages]
|
||||
|
||||
@@ -54,9 +54,9 @@ double Global::fLuminance = 1.0; // jasno
|
||||
int Global::iReCompile = 0; // zwiêkszany, gdy trzeba odœwie¿yæ siatki
|
||||
HWND Global::hWnd = NULL; // uchwyt okna
|
||||
int Global::iCameraLast = -1;
|
||||
std::string Global::asRelease = "16.0.1172.481";
|
||||
std::string Global::asRelease = "16.1.1174.483";
|
||||
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::iTextMode = 0; // tryb pracy wyœwietlacza tekstowego
|
||||
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
|
||||
{
|
||||
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);
|
||||
}
|
||||
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/.
|
||||
*/
|
||||
|
||||
#include <MATH.H>
|
||||
#include <FLOAT.H>
|
||||
#include <typeinfo>
|
||||
#include <fstream> // std::ifstream
|
||||
#include <sstream>
|
||||
#include <istream>
|
||||
#include <iostream>
|
||||
#include <stdio.h> // sprintf()
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <MATH.H>
|
||||
#include <cmath>
|
||||
#include <fstream> // std::ifstream
|
||||
#include <iostream>
|
||||
#include <istream>
|
||||
#include <math.h>
|
||||
#include <sstream>
|
||||
#include <stdio.h> // sprintf()
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <typeinfo>
|
||||
|
||||
#include "Mover.h"
|
||||
#include "../globals.h"
|
||||
#include "Mover.h"
|
||||
//#include "../qutils.h"
|
||||
#include "mctools.h"
|
||||
#include "../logs.h"
|
||||
#include "hamulce.h"
|
||||
#include "Oerlikon_ESt.h"
|
||||
#include "hamulce.h"
|
||||
#include "mctools.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
|
||||
@@ -200,8 +200,8 @@ double TMoverParameters::current(double n, double U)
|
||||
if ((DynamicBrakeType == dbrake_switch) && (TrainType == dt_ET42))
|
||||
{ // z Megapacka
|
||||
Rz = WindingRes + R;
|
||||
MotorCurrent =
|
||||
-MotorParam[SP].fi * n / Rz; //{hamowanie silnikiem na oporach rozruchowych}
|
||||
MotorCurrent = -MotorParam[SP].fi * n /
|
||||
Rz; //{hamowanie silnikiem na oporach rozruchowych}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -282,11 +282,10 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
||||
std::string NameInit, int LoadInitial,
|
||||
std::string LoadTypeInitial,
|
||||
int Cab) //: T_MoverParameters(VelInitial, TypeNameInit,
|
||||
//NameInit, LoadInitial, LoadTypeInitial, Cab)
|
||||
// NameInit, LoadInitial, LoadTypeInitial, Cab)
|
||||
{
|
||||
int b, k;
|
||||
WriteLog(
|
||||
"------------------------------------------------------");
|
||||
WriteLog("------------------------------------------------------");
|
||||
WriteLog("init default physic values for " + NameInit + ", [" + TypeNameInit + "], [" +
|
||||
LoadTypeInitial + "]");
|
||||
Dim = TDimension();
|
||||
@@ -384,38 +383,37 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
||||
nmax = 0.0;
|
||||
Voltage = 0.0;
|
||||
|
||||
|
||||
HeatingPowerSource = TPowerParameters();
|
||||
//HeatingPowerSource.MaxVoltage = 0.0;
|
||||
//HeatingPowerSource.MaxCurrent = 0.0;
|
||||
//HeatingPowerSource.IntR = 0.001;
|
||||
//HeatingPowerSource.SourceType = NotDefined;
|
||||
//HeatingPowerSource.PowerType = NoPower;
|
||||
//HeatingPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
// HeatingPowerSource.MaxVoltage = 0.0;
|
||||
// HeatingPowerSource.MaxCurrent = 0.0;
|
||||
// HeatingPowerSource.IntR = 0.001;
|
||||
// HeatingPowerSource.SourceType = NotDefined;
|
||||
// HeatingPowerSource.PowerType = NoPower;
|
||||
// HeatingPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
|
||||
AlterHeatPowerSource = TPowerParameters();
|
||||
//AlterHeatPowerSource.MaxVoltage = 0.0;
|
||||
//AlterHeatPowerSource.MaxCurrent = 0.0;
|
||||
//AlterHeatPowerSource.IntR = 0.001;
|
||||
//AlterHeatPowerSource.SourceType = NotDefined;
|
||||
//AlterHeatPowerSource.PowerType = NoPower;
|
||||
//AlterHeatPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
// AlterHeatPowerSource.MaxVoltage = 0.0;
|
||||
// AlterHeatPowerSource.MaxCurrent = 0.0;
|
||||
// AlterHeatPowerSource.IntR = 0.001;
|
||||
// AlterHeatPowerSource.SourceType = NotDefined;
|
||||
// AlterHeatPowerSource.PowerType = NoPower;
|
||||
// AlterHeatPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
|
||||
LightPowerSource = TPowerParameters();
|
||||
//LightPowerSource.MaxVoltage = 0.0;
|
||||
//LightPowerSource.MaxCurrent = 0.0;
|
||||
//LightPowerSource.IntR = 0.001;
|
||||
//LightPowerSource.SourceType = NotDefined;
|
||||
//LightPowerSource.PowerType = NoPower;
|
||||
//LightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
// LightPowerSource.MaxVoltage = 0.0;
|
||||
// LightPowerSource.MaxCurrent = 0.0;
|
||||
// LightPowerSource.IntR = 0.001;
|
||||
// LightPowerSource.SourceType = NotDefined;
|
||||
// LightPowerSource.PowerType = NoPower;
|
||||
// LightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
|
||||
AlterLightPowerSource = TPowerParameters();
|
||||
//AlterLightPowerSource.MaxVoltage = 0.0;
|
||||
//AlterLightPowerSource.MaxCurrent = 0.0;
|
||||
//AlterLightPowerSource.IntR = 0.001;
|
||||
//AlterLightPowerSource.SourceType = NotDefined;
|
||||
//AlterLightPowerSource.PowerType = NoPower;
|
||||
//AlterLightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
// AlterLightPowerSource.MaxVoltage = 0.0;
|
||||
// AlterLightPowerSource.MaxCurrent = 0.0;
|
||||
// AlterLightPowerSource.IntR = 0.001;
|
||||
// AlterLightPowerSource.SourceType = NotDefined;
|
||||
// AlterLightPowerSource.PowerType = NoPower;
|
||||
// AlterLightPowerSource.RPowerCable.PowerTrans = NoPower;
|
||||
|
||||
TypeName = TypeNameInit;
|
||||
HighPipePress = 0.0;
|
||||
@@ -691,12 +689,12 @@ TMoverParameters::TMoverParameters(double VelInitial, std::string TypeNameInit,
|
||||
OffsetTrackV = 0.0;
|
||||
|
||||
CommandIn = TCommand();
|
||||
//CommandIn.Command = "";
|
||||
//CommandIn.Value1 = 0.0;
|
||||
//CommandIn.Value2 = 0.0;
|
||||
//CommandIn.Location.X = 0.0;
|
||||
//CommandIn.Location.Y = 0.0;
|
||||
//CommandIn.Location.Z = 0.0;
|
||||
// CommandIn.Command = "";
|
||||
// CommandIn.Value1 = 0.0;
|
||||
// CommandIn.Value2 = 0.0;
|
||||
// CommandIn.Location.X = 0.0;
|
||||
// CommandIn.Location.Y = 0.0;
|
||||
// CommandIn.Location.Z = 0.0;
|
||||
CommandLast, CommandOut = "";
|
||||
ValueOut = 0.0;
|
||||
// czesciowo stale, czesciowo zmienne}
|
||||
@@ -811,7 +809,7 @@ bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *
|
||||
};
|
||||
|
||||
// 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)
|
||||
//{ //łączenie do (ConnectNo) pojazdu (ConnectTo) stroną (ConnectToNr)
|
||||
// return Attach(ConnectNo, ConnectToNr, (TMoverParameters *)ConnectTo, CouplingType, Forced);
|
||||
@@ -1276,10 +1274,10 @@ double TMoverParameters::PipeRatio(void)
|
||||
else
|
||||
pr = (HighPipePress - 1.0 / 3.0 * DeltaPipePress - Max0R(LowPipePress, PipePress)) /
|
||||
(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
|
||||
// (BrakeCtrlPos < 1) then pr : = Min0R(0.5, pr);
|
||||
//if (Compressor > 0.5)
|
||||
// if (Compressor > 0.5)
|
||||
// then pr : = pr * 1.333; // dziwny rapid wywalamy
|
||||
}
|
||||
else
|
||||
@@ -1377,7 +1375,8 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
||||
(((Couplers[b].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
@@ -1408,12 +1407,10 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
||||
{
|
||||
if (((Couplers[0].CouplingFlag & ctrain_power) == ctrain_power) ||
|
||||
(((Couplers[0].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||
TotalCurrent +=
|
||||
Couplers[0].Connected->HVCouplers[1 - Couplers[0].ConnectedNr][0];
|
||||
TotalCurrent += Couplers[0].Connected->HVCouplers[1 - Couplers[0].ConnectedNr][0];
|
||||
if (((Couplers[1].CouplingFlag & ctrain_power) == ctrain_power) ||
|
||||
(((Couplers[1].CouplingFlag & ctrain_heating) == ctrain_heating) && (Heating)))
|
||||
TotalCurrent +=
|
||||
Couplers[1].Connected->HVCouplers[1 - Couplers[1].ConnectedNr][0];
|
||||
TotalCurrent += Couplers[1].Connected->HVCouplers[1 - Couplers[1].ConnectedNr][0];
|
||||
HVCouplers[0][0] = 0;
|
||||
HVCouplers[1][0] = 0;
|
||||
}
|
||||
@@ -1425,11 +1422,11 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
||||
RunningTrack = Track;
|
||||
RunningTraction = ElectricTraction;
|
||||
|
||||
//if (!DynamicBrakeFlag)
|
||||
// if (!DynamicBrakeFlag)
|
||||
// RunningTraction.TractionVoltage = ElectricTraction.TractionVoltage /*-
|
||||
// abs(ElectricTraction.TractionResistivity *
|
||||
// (Itot + HVCouplers[0][0] + HVCouplers[1][0]))*/;
|
||||
//else
|
||||
// else
|
||||
// RunningTraction.TractionVoltage =
|
||||
// ElectricTraction.TractionVoltage /*-
|
||||
// abs(ElectricTraction.TractionResistivity * Itot *
|
||||
@@ -2638,8 +2635,8 @@ bool TMoverParameters::IncBrakeLevelOld(void)
|
||||
(BrakePressureTable[BrakeCtrlPos - 1].PipePressureVal > 0))
|
||||
LimPipePress = PipePress;
|
||||
|
||||
//ten kawałek jest bez sensu gdyż nic nie robił. Zakomntowałem. GF 20161124
|
||||
//if (BrakeSystem == ElectroPneumatic)
|
||||
// ten kawałek jest bez sensu gdyż nic nie robił. Zakomntowałem. GF 20161124
|
||||
// if (BrakeSystem == ElectroPneumatic)
|
||||
// if (BrakeSubsystem != ss_K)
|
||||
// {
|
||||
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
||||
@@ -2681,7 +2678,7 @@ bool TMoverParameters::DecBrakeLevelOld(void)
|
||||
{
|
||||
BrakeCtrlPos--;
|
||||
// BrakeCtrlPosR:=BrakeCtrlPos;
|
||||
//if (EmergencyBrakeFlag)
|
||||
// if (EmergencyBrakeFlag)
|
||||
//{
|
||||
// EmergencyBrakeFlag = false; //!!!
|
||||
// SendCtrlToNext("Emergency_brake", 0, CabNo);
|
||||
@@ -2713,7 +2710,7 @@ bool TMoverParameters::DecBrakeLevelOld(void)
|
||||
// LimPipePress:=PipePress;
|
||||
|
||||
// to nic nie robi. Zakomentowałem. GF 20161124
|
||||
//if (BrakeSystem == ElectroPneumatic)
|
||||
// if (BrakeSystem == ElectroPneumatic)
|
||||
// if (BrakeSubsystem != ss_K)
|
||||
// {
|
||||
// if ((BrakeCtrlPos * BrakeCtrlPos) == 1)
|
||||
@@ -2949,7 +2946,7 @@ bool TMoverParameters::AntiSlippingBrake(void)
|
||||
// *************************************************************************************************
|
||||
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);
|
||||
if (CabNo != 0) // rekurencyjne wysłanie do następnego
|
||||
OK = SendCtrlToNext("BrakeReleaser", state, CabNo);
|
||||
@@ -3124,8 +3121,8 @@ bool TMoverParameters::DecBrakeMult(void)
|
||||
// *************************************************************************************************
|
||||
void TMoverParameters::UpdateBrakePressure(double dt)
|
||||
{
|
||||
//const double LBDelay = 5.0; // stala czasowa hamulca
|
||||
//double Rate, Speed, dp, sm;
|
||||
// const double LBDelay = 5.0; // stala czasowa hamulca
|
||||
// double Rate, Speed, dp, sm;
|
||||
|
||||
dpLocalValve = 0;
|
||||
dpBrake = 0;
|
||||
@@ -3156,10 +3153,11 @@ void TMoverParameters::CompressorCheck(double dt)
|
||||
(DElist[MainCtrlPos].RPM / DElist[MainCtrlPosNo].RPM);
|
||||
else
|
||||
{
|
||||
CompressedVolume +=
|
||||
dt * CompressorSpeed * (2.0 * MaxCompressor - Compressor) / MaxCompressor;
|
||||
TotalCurrent += 0.0015
|
||||
* Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||
CompressedVolume += dt * CompressorSpeed *
|
||||
(2.0 * MaxCompressor - Compressor) / MaxCompressor;
|
||||
TotalCurrent +=
|
||||
0.0015 *
|
||||
Voltage; // tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3192,8 +3190,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
||||
CompressorFlag = false; // bez tamtego członu nie zadziała
|
||||
}
|
||||
else
|
||||
CompressorFlag = (CompressorAllow) &&
|
||||
((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||
CompressorFlag =
|
||||
(CompressorAllow) && ((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||
if (Compressor >
|
||||
MaxCompressor) // wyłącznik ciśnieniowy jest niezależny od sposobu zasilania
|
||||
CompressorFlag = false;
|
||||
@@ -3221,8 +3219,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
||||
CompressorFlag = false; // bez tamtego członu nie zadziała
|
||||
}
|
||||
else
|
||||
CompressorFlag = (CompressorAllow) &&
|
||||
((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||
CompressorFlag =
|
||||
(CompressorAllow) && ((ConverterFlag) || (CompressorPower == 0)) && (Mains);
|
||||
if (CompressorFlag) // jeśli została załączona
|
||||
LastSwitchingTime = 0; // to trzeba ograniczyć ponowne włączenie
|
||||
}
|
||||
@@ -3250,7 +3248,8 @@ void TMoverParameters::CompressorCheck(double dt)
|
||||
// sprężarki, tak z 5A na
|
||||
// sprężarkę
|
||||
else
|
||||
TotalCurrent += 0.0015 *
|
||||
TotalCurrent +=
|
||||
0.0015 *
|
||||
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
|
||||
{
|
||||
if ((EngineType != ElectricInductionMotor))
|
||||
dpLocalValve =
|
||||
LocHandle->GetPF(Max0R(LocalBrakePos / LocalBrakePosNo, LocalBrakePosA),
|
||||
dpLocalValve = LocHandle->GetPF(Max0R(LocalBrakePos / LocalBrakePosNo, LocalBrakePosA),
|
||||
Hamulec->GetBCP(), ScndPipePress, dt, 0);
|
||||
else
|
||||
dpLocalValve =
|
||||
@@ -3312,8 +3310,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
|
||||
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then //ulepszony hamulec bezp.
|
||||
if ((EmergencyBrakeFlag) || (TestFlag(SecuritySystem.Status, s_SHPebrake)) ||
|
||||
(TestFlag(SecuritySystem.Status, s_CAebrake)) ||
|
||||
(s_CAtestebrake == true) ||
|
||||
(TestFlag(SecuritySystem.Status, s_CAebrake)) || (s_CAtestebrake == true) ||
|
||||
(TestFlag(EngDmgFlag, 32)) /* or (not Battery)*/) // ulepszony hamulec bezp.
|
||||
dpMainValve = dpMainValve + PF(0, PipePress, 0.15) * dt;
|
||||
// 0.2*Spg
|
||||
@@ -3361,7 +3358,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
((Couplers[b].CouplingFlag & 36) == 36))
|
||||
LocBrakePress = Max0R(Couplers[b].Connected->LocHandle->GetCP(), LocBrakePress);
|
||||
|
||||
//if ((DynamicBrakeFlag) && (EngineType == ElectricInductionMotor))
|
||||
// if ((DynamicBrakeFlag) && (EngineType == ElectricInductionMotor))
|
||||
//{
|
||||
// //if (Vel > 10)
|
||||
// // LocBrakePress = 0;
|
||||
@@ -3562,11 +3559,12 @@ double TMoverParameters::GetDVc(double dt)
|
||||
c->Physic_ReActivation();
|
||||
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)) &&
|
||||
// (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)) *
|
||||
// 0; // ktoś mi powie jaki jest sens tego bloku jeśli przepływ mnożony przez zero?
|
||||
// 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]);
|
||||
else
|
||||
Voltage = 0;
|
||||
//if (Mains && /*(abs(CabNo) < 2) &&*/ (
|
||||
// if (Mains && /*(abs(CabNo) < 2) &&*/ (
|
||||
// EngineType == ElectricInductionMotor)) // potem ulepszyc! pantogtrafy!
|
||||
// Voltage = RunningTraction.TractionVoltage;
|
||||
|
||||
@@ -3734,9 +3732,8 @@ void TMoverParameters::ComputeTotalForce(double dt, double dt1, bool FullVer)
|
||||
Couplers[b].CForce = 0;
|
||||
// FStand:=Fb+FrictionForce(RunningShape.R,RunningTrack.DamageFlag);
|
||||
FStand += Fb;
|
||||
FTrain +=
|
||||
TotalMassxg * RunningShape.dHtrack; // doliczenie składowej stycznej grawitacji
|
||||
//!niejawne przypisanie zmiennej!
|
||||
FTrain += TotalMassxg * RunningShape.dHtrack; // doliczenie składowej stycznej grawitacji
|
||||
//! niejawne przypisanie zmiennej!
|
||||
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)) ||
|
||||
((dtrans < 0.25) && (ShuntModeAllow) && (LocalBrakePos == 0)))
|
||||
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))
|
||||
DynamicBrakeFlag = true;
|
||||
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 as TLSt).SetLBP(LocBrakePress*(1-PosRatio));
|
||||
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])));
|
||||
eimv[eimv_Fzad] = -Max0R(LocalBrakeRatio(), dtrans / MaxBrakePress[0]);
|
||||
tmp = 5;
|
||||
@@ -4527,7 +4526,8 @@ double TMoverParameters::TractionForce(double dt)
|
||||
else
|
||||
PosRatio =
|
||||
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 as TLSt).SetLBP(LocBrakePress);
|
||||
if ((PosRatio > dizel_fill))
|
||||
@@ -4620,18 +4620,16 @@ double TMoverParameters::TractionForce(double dt)
|
||||
if ((abs(eimv[eimv_fp]) <= eimv[eimv_fkr]))
|
||||
eimv[eimv_pole] = eimc[eimc_f_cfu] / eimc[eimc_s_cfu];
|
||||
else
|
||||
eimv[eimv_pole] =
|
||||
eimv[eimv_Uzsmax] / eimc[eimc_s_cfu] / abs(eimv[eimv_fp]);
|
||||
eimv[eimv_pole] = 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_Ic] = (eimv[eimv_fp] - DirAbsolute * enrot * eimc[eimc_s_p]) *
|
||||
eimc[eimc_s_dfic] * eimv[eimv_pole];
|
||||
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_Ipoj] = (eimv[eimv_Ic] * NPoweredAxles * eimv[eimv_U]) /
|
||||
(Voltage - eimc[eimc_f_DU]) +
|
||||
eimv[eimv_Ipoj] =
|
||||
(eimv[eimv_Ic] * NPoweredAxles * eimv[eimv_U]) / (Voltage - eimc[eimc_f_DU]) +
|
||||
eimc[eimc_f_I0];
|
||||
eimv[eimv_Pm] =
|
||||
ActiveDir * eimv[eimv_M] * NPoweredAxles * enrot * Pirazy2 / 1000;
|
||||
eimv[eimv_Pm] = ActiveDir * eimv[eimv_M] * NPoweredAxles * enrot * Pirazy2 / 1000;
|
||||
eimv[eimv_Pe] = eimv[eimv_Ipoj] * Voltage / 1000;
|
||||
eimv[eimv_eta] = eimv[eimv_Pm] / eimv[eimv_Pe];
|
||||
|
||||
@@ -4653,8 +4651,7 @@ double TMoverParameters::TractionForce(double dt)
|
||||
i = 0;
|
||||
while ((i < RlistSize - 1) && (DElist[i + 1].RPM < abs(tmpV)))
|
||||
i++;
|
||||
RventRot = (abs(tmpV) - DElist[i].RPM) /
|
||||
(DElist[i + 1].RPM - DElist[i].RPM) *
|
||||
RventRot = (abs(tmpV) - DElist[i].RPM) / (DElist[i + 1].RPM - DElist[i].RPM) *
|
||||
(DElist[i + 1].GenPower - DElist[i].GenPower) +
|
||||
DElist[i].GenPower;
|
||||
}
|
||||
@@ -4697,7 +4694,7 @@ double TMoverParameters::TractionForce(double dt)
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160713
|
||||
//Obliczenie predkości obrotowej kół???
|
||||
// Obliczenie predkości obrotowej kół???
|
||||
// *************************************************************************************************
|
||||
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
|
||||
// *************************************************************************************************
|
||||
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]);
|
||||
}
|
||||
|
||||
@@ -5854,7 +5851,7 @@ std::string tS(std::string val)
|
||||
int Pos(std::string str_find, std::string in)
|
||||
{
|
||||
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);
|
||||
|
||||
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++;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = 0; i < s; i++)
|
||||
for (int i = 0; i < s; i++)
|
||||
x[i] = TrimSpace(x[i]);
|
||||
|
||||
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].Isat = atof(x[5].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 + "," +
|
||||
//p6);
|
||||
// p6);
|
||||
}
|
||||
MPTLINE++;
|
||||
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
|
||||
|
||||
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));
|
||||
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].Mn = atoi(x[3].c_str()); // int
|
||||
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);
|
||||
}
|
||||
delete[] xxx;
|
||||
@@ -6080,7 +6077,8 @@ bool TMoverParameters::readBPT(int ln, std::string line)
|
||||
BrakePressureTable[k].BrakeType = Individual;
|
||||
|
||||
// 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].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 InternalSource : PowerType =
|
||||
//PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
||||
// PowerDecode(DUE(ExtractKeyWord(lines,prefix+'PowerType=')));
|
||||
//--case Transducer : InputVoltage =
|
||||
//s2rE(DUE(ExtractKeyWord(lines,prefix+'TransducerInputV=')));
|
||||
// s2rE(DUE(ExtractKeyWord(lines,prefix+'TransducerInputV=')));
|
||||
//--case Generator :
|
||||
//GeneratorEngine:=EngineDecode(DUE(ExtractKeyWord(lines,prefix+'GeneratorEngine=')));
|
||||
// GeneratorEngine:=EngineDecode(DUE(ExtractKeyWord(lines,prefix+'GeneratorEngine=')));
|
||||
//--case Accumulator:
|
||||
//--{
|
||||
//-- 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,
|
||||
secParam = false, secLoad = false, secDimensions = false,
|
||||
secWheels = false, secBrake = false, secBuffCoupl = false, secCntrl = false,
|
||||
secSecurity = false, secLight = false, secCircuit = false, secRList = false,
|
||||
secDList = false, secWWList = false, secffList = false, secTurboPos = false;
|
||||
secParam = false, secLoad = false, secDimensions = false, secWheels = false,
|
||||
secBrake = false, secBuffCoupl = false, secCntrl = false, secSecurity = false,
|
||||
secLight = false, secCircuit = false, secRList = false, secDList = false,
|
||||
secWWList = false, secffList = false, secTurboPos = false;
|
||||
|
||||
ConversionError = 0;
|
||||
|
||||
@@ -7283,7 +7281,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
// WriteLog("----------------------------------------------------------------------------------------");
|
||||
WriteLog("CERROR: " + to_string(ConversionError) + ", SUCCES: " + to_string(OK));
|
||||
// WriteLogSS();
|
||||
//WriteLog("");
|
||||
// WriteLog("");
|
||||
return OK;
|
||||
} // LoadFIZ()
|
||||
|
||||
@@ -7334,7 +7332,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
|
||||
if ((TestFlag(BrakeDelays, bdelay_R)) && !(TestFlag(BrakeDelays, bdelay_G)))
|
||||
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)
|
||||
{
|
||||
|
||||
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 <fstream>
|
||||
|
||||
//using namespace Mtable;
|
||||
// using namespace Mtable;
|
||||
TMTableTime *Mtable::GlobalTime;
|
||||
|
||||
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)
|
||||
{ //zwraca odlegloϾ do najblizszej stacji z zatrzymaniem
|
||||
{ // zwraca odlegloϾ do najblizszej stacji z zatrzymaniem
|
||||
double dist;
|
||||
|
||||
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
|
||||
{ // 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;
|
||||
else
|
||||
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;
|
||||
//}
|
||||
@@ -216,10 +217,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
s = scnpath + TrainName + ".txt";
|
||||
// Ra 2014-09: ustaliæ zasady wyznaczenia pierwotnego pliku przy przesuniêtych rozk³adach
|
||||
// (kolejny poci¹g dostaje numer +2)
|
||||
fin.open(s.c_str()); //otwieranie pliku
|
||||
fin.open(s.c_str()); // otwieranie pliku
|
||||
|
||||
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
|
||||
if ((vmax > 10) && (vmax < 200))
|
||||
{
|
||||
@@ -235,7 +236,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
ConversionError = 0;
|
||||
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*/
|
||||
{
|
||||
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)
|
||||
// else
|
||||
{ /*czytaj naglowek*/
|
||||
while(fin >> s || !fin.bad())
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s.find("_______|") != std::string::npos)
|
||||
break;
|
||||
//fin >> s;
|
||||
} //while (!(s.find("_______|") != std::string::npos) || fin.eof());
|
||||
// fin >> s;
|
||||
} // while (!(s.find("_______|") != std::string::npos) || fin.eof());
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s == "[")
|
||||
break;
|
||||
} //while (!() || (fin.eof())); /*pierwsza linia z relacj¹*/
|
||||
while(fin >> s || !fin.bad())
|
||||
} // while (!() || (fin.eof())); /*pierwsza linia z relacj¹*/
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s != "|")
|
||||
break;
|
||||
} //while (!(() || fin.eof()));
|
||||
} // while (!(() || fin.eof()));
|
||||
if (s != "|")
|
||||
Relation1 = s;
|
||||
else
|
||||
ConversionError = -5;
|
||||
while(fin >> s || !fin.bad())
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s == "Relacja")
|
||||
break;
|
||||
} //while (
|
||||
} // while (
|
||||
// !( || (fin.eof()))); /*druga linia z relacj¹*/
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s == "|")
|
||||
break;
|
||||
} //while (!( || (fin.eof())));
|
||||
} // while (!( || (fin.eof())));
|
||||
fin >> Relation2;
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if (s == "Wymagany")
|
||||
break;
|
||||
}// while (!();
|
||||
} // while (!();
|
||||
while (fin >> s || !fin.bad())
|
||||
{
|
||||
if ((s == "|") || (s == "\n"))
|
||||
break;
|
||||
} //while (!());
|
||||
} // while (!());
|
||||
fin >> s;
|
||||
s = s.substr(0, s.find("%"));
|
||||
BrakeRatio = atof(s.c_str());
|
||||
@@ -310,13 +311,13 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
{
|
||||
if (s == "Seria")
|
||||
break;
|
||||
} //while (!(s == "Seria"));
|
||||
} // while (!(s == "Seria"));
|
||||
do
|
||||
{
|
||||
fin >> s;
|
||||
} while (!((s == "|") || (fin.bad())));
|
||||
fin >> LocSeries;
|
||||
fin >> LocLoad;// = s2rE(ReadWord(fin));
|
||||
fin >> LocLoad; // = s2rE(ReadWord(fin));
|
||||
do
|
||||
{
|
||||
fin >> s;
|
||||
@@ -339,7 +340,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
record->km = atof(s.c_str());
|
||||
fin >> s;
|
||||
}
|
||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
if (s.find("|_____|") !=
|
||||
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
UpdateVelocity(StationCount, vActual);
|
||||
else
|
||||
{
|
||||
@@ -360,9 +362,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
{
|
||||
if (s.find(hrsd) != std::string::npos)
|
||||
{
|
||||
record->Ah = atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina przyjazdu
|
||||
record->Am = atoi(
|
||||
s.substr(s.find(hrsd) + 1, s.length()).c_str()); // minuta przyjazdu
|
||||
record->Ah = atoi(
|
||||
s.substr(0, s.find(hrsd)).c_str()); // godzina przyjazdu
|
||||
record->Am = atoi(s.substr(s.find(hrsd) + 1, s.length())
|
||||
.c_str()); // minuta przyjazdu
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,7 +390,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
||||
fin >> s;
|
||||
}
|
||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
if (s.find("|_____|") !=
|
||||
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
UpdateVelocity(StationCount, vActual);
|
||||
else
|
||||
{
|
||||
@@ -408,9 +412,10 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
{
|
||||
if (s.find(hrsd) != std::string::npos)
|
||||
{
|
||||
record->Dh = atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina odjazdu
|
||||
record->Dm = atoi(
|
||||
s.substr(s.find(hrsd) + 1, s.length()).c_str()); // minuta odjazdu
|
||||
record->Dh =
|
||||
atoi(s.substr(0, s.find(hrsd)).c_str()); // godzina odjazdu
|
||||
record->Dm = atoi(s.substr(s.find(hrsd) + 1, s.length())
|
||||
.c_str()); // minuta odjazdu
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -421,11 +426,15 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
}
|
||||
else
|
||||
{
|
||||
record->Dh = record->Ah; // odjazd o tej samej, co przyjazd (dla ostatniego te¿)
|
||||
record->Dm = record->Am; // bo s¹ u¿ywane do wyliczenia opóŸnienia po dojechaniu
|
||||
record->Dh = record->Ah; // odjazd o tej samej, co przyjazd (dla
|
||||
// ostatniego te¿)
|
||||
record->Dm = record->Am; // bo s¹ u¿ywane do wyliczenia opóŸnienia
|
||||
// po dojechaniu
|
||||
}
|
||||
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
|
||||
{
|
||||
fin >> s;
|
||||
@@ -443,7 +452,8 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
/*tu s moze byc miejscem zmiany predkosci szlakowej*/
|
||||
fin >> s;
|
||||
}
|
||||
if (s.find("|_____|") != std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
if (s.find("|_____|") !=
|
||||
std::string::npos) /*zmiana predkosci szlakowej*/
|
||||
UpdateVelocity(StationCount, vActual);
|
||||
else
|
||||
{
|
||||
@@ -540,8 +550,3 @@ bool TTrainParameters::DirectionChange()
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
mtable.h
32
mtable.h
@@ -18,14 +18,14 @@ http://mozilla.org/MPL/2.0/.
|
||||
namespace Mtable
|
||||
{
|
||||
|
||||
static int const MaxTTableSize = 100; // mo¿na by to robiæ dynamicznie
|
||||
static char const *hrsd = ".";
|
||||
static int const MaxTTableSize = 100; // mo¿na by to robiæ dynamicznie
|
||||
static char const *hrsd = ".";
|
||||
|
||||
// Ra: pozycja zerowa rozk³adu chyba nie ma sensu
|
||||
// Ra: numeracja przystanków jest 1..StationCount
|
||||
// Ra: pozycja zerowa rozk³adu chyba nie ma sensu
|
||||
// Ra: numeracja przystanków jest 1..StationCount
|
||||
|
||||
struct TMTableLine
|
||||
{
|
||||
struct TMTableLine
|
||||
{
|
||||
double km; // kilometraz linii
|
||||
double vmax; // predkosc rozkladowa przed przystankiem
|
||||
// StationName:string[32]; //nazwa stacji ('_' zamiast spacji)
|
||||
@@ -48,14 +48,14 @@ namespace Mtable
|
||||
Ah, Am, Dh, Dm = -1;
|
||||
WaitTime, tm = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
typedef TMTableLine TMTable[MaxTTableSize + 1];
|
||||
typedef TMTableLine TMTable[MaxTTableSize + 1];
|
||||
|
||||
//typedef TTrainParameters *PTrainParameters;
|
||||
// typedef TTrainParameters *PTrainParameters;
|
||||
|
||||
class TTrainParameters
|
||||
{
|
||||
class TTrainParameters
|
||||
{
|
||||
public:
|
||||
std::string TrainName;
|
||||
double TTVmax;
|
||||
@@ -84,11 +84,11 @@ namespace Mtable
|
||||
bool LoadTTfile(std::string scnpath, int iPlus, double vmax);
|
||||
bool DirectionChange();
|
||||
void StationIndexInc();
|
||||
};
|
||||
};
|
||||
|
||||
class TMTableTime
|
||||
class TMTableTime
|
||||
|
||||
{
|
||||
{
|
||||
public:
|
||||
double GameTime;
|
||||
int dd;
|
||||
@@ -101,9 +101,9 @@ namespace Mtable
|
||||
double mr;
|
||||
void UpdateMTableTime(double deltaT);
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user