mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
Added optional train category to the timetable
This commit is contained in:
committed by
tmj-fstate
parent
b0342c7447
commit
8dd1ca19d4
25
mtable.cpp
25
mtable.cpp
@@ -310,14 +310,38 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
|||||||
// pliku}
|
// pliku}
|
||||||
// ConversionError:=-7 {błąd niezgodności}
|
// ConversionError:=-7 {błąd niezgodności}
|
||||||
TrainName = s; // nadanie nazwy z pliku TXT (bez ścieżki do pliku)
|
TrainName = s; // nadanie nazwy z pliku TXT (bez ścieżki do pliku)
|
||||||
|
bool isCategory = false;
|
||||||
|
while (fin >> s || fin.bad())
|
||||||
|
{
|
||||||
|
if (s.find("_______|") != std::string::npos)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (s == "Kategoria")
|
||||||
|
{
|
||||||
|
isCategory = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} // while (!(s == "Seria"));
|
||||||
|
if (isCategory)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
fin >> s;
|
||||||
|
} while (!((s == "|") || (fin.bad())));
|
||||||
|
fin >> TrainCategory;
|
||||||
|
}
|
||||||
// else
|
// else
|
||||||
{ /*czytaj naglowek*/
|
{ /*czytaj naglowek*/
|
||||||
|
if (isCategory)
|
||||||
|
{
|
||||||
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 == "[")
|
||||||
@@ -622,6 +646,7 @@ bool TTrainParameters::DirectionChange()
|
|||||||
void TTrainParameters::serialize( dictionary_source *Output ) const {
|
void TTrainParameters::serialize( dictionary_source *Output ) const {
|
||||||
|
|
||||||
Output->insert( "trainnumber", TrainName );
|
Output->insert( "trainnumber", TrainName );
|
||||||
|
Output->insert( "traincategory", TrainCategory );
|
||||||
Output->insert( "train_brakingmassratio", BrakeRatio );
|
Output->insert( "train_brakingmassratio", BrakeRatio );
|
||||||
Output->insert( "train_enginetype", LocSeries );
|
Output->insert( "train_enginetype", LocSeries );
|
||||||
Output->insert( "train_engineload", LocLoad );
|
Output->insert( "train_engineload", LocLoad );
|
||||||
|
|||||||
1
mtable.h
1
mtable.h
@@ -50,6 +50,7 @@ class TTrainParameters
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string TrainName;
|
std::string TrainName;
|
||||||
|
std::string TrainCategory;
|
||||||
double TTVmax;
|
double TTVmax;
|
||||||
std::string Relation1;
|
std::string Relation1;
|
||||||
std::string Relation2; // nazwy stacji danego odcinka
|
std::string Relation2; // nazwy stacji danego odcinka
|
||||||
|
|||||||
Reference in New Issue
Block a user