mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 21:21:24 +01:00
Fix non-routestate code eliminator
This commit is contained in:
parent
6c18226cb5
commit
d877fc315e
@ -122,7 +122,7 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
|
|||||||
|
|
||||||
case 'J': // throttle info commands
|
case 'J': // throttle info commands
|
||||||
// This entire code block is compiled out if FEATURE_ROUTESTATE macros not used
|
// This entire code block is compiled out if FEATURE_ROUTESTATE macros not used
|
||||||
if (paramCount<1 || !(compileFeatures & FEATURE_ROUTESTATE)) return;
|
if (paramCount<1) return;
|
||||||
switch(p[0])
|
switch(p[0])
|
||||||
case HASH_KEYWORD_A: // <JA> returns automations/routes
|
case HASH_KEYWORD_A: // <JA> returns automations/routes
|
||||||
if (paramCount==1) {// <JA>
|
if (paramCount==1) {// <JA>
|
||||||
@ -137,13 +137,15 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
|
|||||||
StringFormatter::send(stream,F("<jA %d %c \"%S\">\n"),
|
StringFormatter::send(stream,F("<jA %d %c \"%S\">\n"),
|
||||||
id, getRouteType(id), getRouteDescription(id));
|
id, getRouteType(id), getRouteDescription(id));
|
||||||
|
|
||||||
// Send any non-default button states or captions
|
if (compileFeatures & FEATURE_ROUTESTATE) {
|
||||||
int16_t statePos=routeLookup->findPosition(id);
|
// Send any non-default button states or captions
|
||||||
if (statePos>=0) {
|
int16_t statePos=routeLookup->findPosition(id);
|
||||||
if (routeStateArray[statePos])
|
if (statePos>=0) {
|
||||||
StringFormatter::send(stream,F("<jB %d %d>\n"), id, routeStateArray[statePos]);
|
if (routeStateArray[statePos])
|
||||||
if (routeCaptionArray[statePos])
|
StringFormatter::send(stream,F("<jB %d %d>\n"), id, routeStateArray[statePos]);
|
||||||
StringFormatter::send(stream,F("<jB %d \"%S\">\n"), id,routeCaptionArray[statePos]);
|
if (routeCaptionArray[statePos])
|
||||||
|
StringFormatter::send(stream,F("<jB %d \"%S\">\n"), id,routeCaptionArray[statePos]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
opcode=0;
|
opcode=0;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user