From 68fd56e7fccc74be4c06a11eae04c8bec846538e Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Tue, 10 Oct 2023 11:52:46 +0100 Subject: [PATCH] Added returnDCAddr Added function to return DC address --- TrackManager.cpp | 7 ++++++- TrackManager.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TrackManager.cpp b/TrackManager.cpp index 3ea9877..7d86de0 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -356,6 +356,7 @@ void TrackManager::streamTrackState(Print* stream, byte t) { if (track[t]==NULL) return; auto format=F(""); bool pstate = TrackManager::isPowerOn(t); + switch(track[t]->getMode()) { case TRACK_MODE_MAIN: if (pstate) {format=F("<= %c MAIN ON>\n");} else {format = F("<= %c MAIN OFF>\n");} @@ -562,7 +563,11 @@ byte TrackManager::returnMode(byte t) { return (track[t]->getMode()); } -static const char* TrackManager::getModeName(byte Mode) { +int16_t TrackManager::returnDCAddr(byte t) { + return (trackDCAddr[t]); +} + +const char* TrackManager::getModeName(byte Mode) { //DIAG(F("PowerMode %d"), Mode); diff --git a/TrackManager.h b/TrackManager.h index 486057a..d197751 100644 --- a/TrackManager.h +++ b/TrackManager.h @@ -91,6 +91,7 @@ class TrackManager { static bool isPowerOn(byte t); static bool isProg(byte t); static byte returnMode(byte t); + static int16_t returnDCAddr(byte t); static const char* getModeName(byte Mode); static int16_t joinRelay;