1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

Add getModeName()

Add facility to get the name of the track mode
This commit is contained in:
Colin Murdoch 2023-10-06 19:11:11 +01:00
parent 52cfc18754
commit fe618d0b85
3 changed files with 24 additions and 1 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ myFilter.cpp
my*.h
!my*.example.h
compile_commands.json
newcode.txt.old

View File

@ -557,3 +557,23 @@ bool TrackManager::isProg(byte t) {
return true;
return false;
}
byte TrackManager::returnMode(byte t) {
return (track[t]->getMode());
}
static const char* TrackManager::getModeName(byte Mode) {
//DIAG(F("PowerMode %d"), Mode);
switch (Mode)
{
case 1: return "NONE";
case 2: return "MAIN";
case 4: return "PROG";
case 8: return "DC";
case 16: return "DCX";
case 32: return "EXT";
default: return "----";
}
}

View File

@ -90,6 +90,8 @@ class TrackManager {
static void streamTrackState(Print* stream, byte t);
static bool isPowerOn(byte t);
static bool isProg(byte t);
static byte returnMode(byte t);
static const char* getModeName(byte Mode);
static int16_t joinRelay;
static bool progTrackSyncMain; // true when prog track is a siding switched to main