mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
Add getModeName()
Add facility to get the name of the track mode
This commit is contained in:
parent
52cfc18754
commit
fe618d0b85
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ myFilter.cpp
|
||||
my*.h
|
||||
!my*.example.h
|
||||
compile_commands.json
|
||||
newcode.txt.old
|
||||
|
@ -556,4 +556,24 @@ bool TrackManager::isProg(byte t) {
|
||||
if (track[t]->getMode()==TRACK_MODE_PROG)
|
||||
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 "----";
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user