mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 21:21:24 +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*.h
|
||||||
!my*.example.h
|
!my*.example.h
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
newcode.txt.old
|
||||||
|
@ -557,3 +557,23 @@ bool TrackManager::isProg(byte t) {
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
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 void streamTrackState(Print* stream, byte t);
|
||||||
static bool isPowerOn(byte t);
|
static bool isPowerOn(byte t);
|
||||||
static bool isProg(byte t);
|
static bool isProg(byte t);
|
||||||
|
static byte returnMode(byte t);
|
||||||
|
static const char* getModeName(byte Mode);
|
||||||
|
|
||||||
static int16_t joinRelay;
|
static int16_t joinRelay;
|
||||||
static bool progTrackSyncMain; // true when prog track is a siding switched to main
|
static bool progTrackSyncMain; // true when prog track is a siding switched to main
|
||||||
|
Loading…
Reference in New Issue
Block a user