Poprawki do działania tabelki rozkładów. Poprawka funkcji konwersji int na string.

This commit is contained in:
firleju
2016-09-12 22:10:13 +02:00
parent 803cefc71d
commit 38f25f5235
5 changed files with 21 additions and 16 deletions

View File

@@ -838,7 +838,7 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
// następny postój
TrainParams->UpdateMTable(
GlobalTime->hh, GlobalTime->mm,
asNextStop.substr(20, asNextStop.length()));
asNextStop.substr(19, asNextStop.length()));
TrainParams->StationIndexInc(); // przejście do następnej
asNextStop =
TrainParams->NextStop(); // pobranie kolejnego miejsca zatrzymania
@@ -5292,20 +5292,18 @@ TCommandType TController::BackwardScan()
std::string TController::NextStop()
{ // informacja o następnym zatrzymaniu, wyświetlane pod [F1]
if (asNextStop.length() < 20)
if (asNextStop.length() < 19)
return ""; // nie zawiera nazwy stacji, gdy dojechał do końca
// dodać godzinę odjazdu
if (!TrainParams)
return ""; // tu nie powinno nigdy wejść
TMTableLine *t = TrainParams->TimeTable + TrainParams->StationIndex;
std::string tmp = "";
if (t->Dh >= 0) // jeśli jest godzina odjazdu
return asNextStop.substr(20, 30) + " " + Global::to_string(t->Dh) +
":" + Global::to_string(100 + t->Dm).substr(2, 2); // odjazd
return asNextStop.substr(19, 30) + " " + Global::to_string(t->Dh) + ":" +
Global::to_string(t->Dm); // odjazd
else if (t->Ah >= 0) // przyjazd
return asNextStop.substr(20, 30) + " (" + Global::to_string(t->Ah) +
":" + Global::to_string(100 + t->Am).substr(2, 2) +
")"; // przyjazd
return asNextStop.substr(19, 30) + " (" + Global::to_string(t->Ah) + ":" +
Global::to_string(t->Am) + ")"; // przyjazd
return "";
};