mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 14:39:18 +02:00
radio channel selection tweak, minor bug fixes
This commit is contained in:
15
mtable.cpp
15
mtable.cpp
@@ -329,6 +329,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
{
|
||||
fin >> s;
|
||||
} while (!(s.find("[______________") != std::string::npos || fin.bad()));
|
||||
auto activeradiochannel{ -1 };
|
||||
while (!fin.bad() && !EndTable)
|
||||
{
|
||||
++StationCount;
|
||||
@@ -421,13 +422,23 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
auto const stationware { Split( record->StationWare, ',' ) };
|
||||
for( auto const &entry : stationware ) {
|
||||
if( entry[ 0 ] == 'R' ) {
|
||||
auto const entrysplit { split_index( entry ) };
|
||||
auto const entrysplit { split_string_and_number( entry ) };
|
||||
if( ( entrysplit.first == "R" )
|
||||
&& ( entrysplit.second <= 10 ) ) {
|
||||
record->radio_channel = entrysplit.second;
|
||||
auto const radiochannel { entrysplit.second };
|
||||
if( ( record->radio_channel == -1 )
|
||||
|| ( radiochannel != activeradiochannel ) ) {
|
||||
// if the station has more than one radiochannel listed,
|
||||
// it generally means we should switch to the one we weren't using so far
|
||||
// TODO: reverse this behaviour (keep the channel used so far) once W28 signs are included in the system
|
||||
record->radio_channel = radiochannel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if( record->radio_channel != -1 ) {
|
||||
activeradiochannel == record->radio_channel;
|
||||
}
|
||||
}
|
||||
record->TrackNo = atoi(s.c_str());
|
||||
fin >> s;
|
||||
|
||||
Reference in New Issue
Block a user