mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Poprawki do działania tabelki rozkładów. Poprawka funkcji konwersji int na string.
This commit is contained in:
14
Driver.cpp
14
Driver.cpp
@@ -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 "";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user