From 4d8efcdd056a021023b8c7d7942a05e8530adafe Mon Sep 17 00:00:00 2001 From: Asbelos Date: Wed, 1 Mar 2023 16:32:05 +0000 Subject: [PATCH] Reinstate obsolete --- DCCEXParser.cpp | 6 ++++-- TrackManager.cpp | 9 +++++++++ TrackManager.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index c3895f7..9e2cf5f 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -503,8 +503,10 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) return; case 'c': // SEND METER RESPONSES - // No longer supported because of multiple tracks See and - break; + // No longer useful because of multiple tracks See and + if (params>0) break; + TrackManager::reportObsoleteCurrent(stream); + return; case 'Q': // SENSORS Sensor::printAll(stream); diff --git a/TrackManager.cpp b/TrackManager.cpp index 8521889..33d1d8a 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -424,6 +424,15 @@ POWERMODE TrackManager::getProgPower() { return POWERMODE::OFF; } +void TrackManager::reportObsoleteCurrent(Print* stream) { + // This function is for backward JMRI compatibility only + // It reports the first track only, as main, regardless of track settings. + // + int maxCurrent=track[0]->raw2mA(track[0]->getRawCurrentTripValue()); + StringFormatter::send(stream, F("\n"), + track[0]->raw2mA(track[0]->getCurrentRaw(false)), maxCurrent, maxCurrent); +} + void TrackManager::reportCurrent(Print* stream) { StringFormatter::send(stream,F("