1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-27 20:58:52 +01:00

<JL display row> now requires display selection and starting row

This commit is contained in:
Ash-4 2025-01-14 00:49:29 -06:00
parent f325c9d18f
commit 3c69c869cb
3 changed files with 11 additions and 11 deletions

View File

@ -771,9 +771,9 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
TrackManager::reportCurrent(stream); // <g limit...limit>
return;
case "L"_hk: // <JL> current values
if (params>1) break;
TrackManager::reportCurrentLCD(stream); // Track power status
case "L"_hk: // <JL display row> track state and mA value on display
if (params<3) break;
TrackManager::reportCurrentLCD(p[1], p[2]); // Track power status
return;
case "A"_hk: // <JA> intercepted by EXRAIL// <JA> returns automations/routes

View File

@ -646,28 +646,28 @@ void TrackManager::reportCurrent(Print* stream) {
StringFormatter::send(stream,F(">\n"));
}
void TrackManager::reportCurrentLCD(Print* stream) {
void TrackManager::reportCurrentLCD(uint8_t display, byte row) {
FOR_EACH_TRACK(t) {
bool pstate = TrackManager::isPowerOn(t); // checks if power is on or off
TRACK_MODE tMode=(TrackManager::getMode(t)); // gets to current power mode
int16_t DCAddr=(TrackManager::returnDCAddr(t));
int16_t tPwr_mA= (track[t]->getPower()==POWERMODE::OVERLOAD) ? -1 :
track[t]->raw2mA(track[t]->getCurrentRaw(false));
if (pstate) { // if power is on do this section
int16_t tPwr_mA= (track[t]->getPower()==POWERMODE::OVERLOAD) ? -1 :
track[t]->raw2mA(track[t]->getCurrentRaw(false));
if (tMode & TRACK_MODE_DC) { // Test if track is in DC or DCX mode
LCD(8+t, F("%c: %S %d ON %dmA"), t+'A', (TrackManager::getModeName(tMode)),DCAddr, tPwr_mA);
SCREEN(display, row+t, F("%c: %S %d ON %dmA"), t+'A', (TrackManager::getModeName(tMode)),DCAddr, tPwr_mA);
}
else { // formats without DCAddress
LCD(8+t, F("%c: %S ON %dmA"), t+'A', (TrackManager::getModeName(tMode)), tPwr_mA);
SCREEN(display, row+t, F("%c: %S ON %dmA"), t+'A', (TrackManager::getModeName(tMode)), tPwr_mA);
}
}
else { // if power is off do this section
if (tMode & TRACK_MODE_DC) { // DC / DCX
LCD(8+t, F("Track %c: %S %d OFF"), t+'A', (TrackManager::getModeName(tMode)),DCAddr);
SCREEN(display, row+t, F("Track %c: %S %d OFF"), t+'A', (TrackManager::getModeName(tMode)),DCAddr);
}
else { // Not DC or DCX
LCD(8+t, F("Track %c: %S OFF"), t+'A', (TrackManager::getModeName(tMode)));
SCREEN(display, row+t, F("Track %c: %S OFF"), t+'A', (TrackManager::getModeName(tMode)));
}
}
}

View File

@ -88,7 +88,7 @@ class TrackManager {
static void sampleCurrent();
static void reportGauges(Print* stream);
static void reportCurrent(Print* stream);
static void reportCurrentLCD(Print* stream);
static void reportCurrentLCD(uint8_t display, byte row);
static void reportObsoleteCurrent(Print* stream);
static void streamTrackState(Print* stream, byte t);
static bool isPowerOn(byte t);