1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 08:36:14 +01:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Harald Barth
29ea746062 version 5.2.6 2023-11-21 11:54:43 +01:00
Harald Barth
e6f33cfdee Trackmanager broadcast power state on track mode change 2023-11-21 11:51:26 +01:00
5 changed files with 11 additions and 8 deletions

View File

@ -668,7 +668,7 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
break; break;
#endif #endif
case '=': // TRACK MANAGER CONTROL <= [params]> case '=': // TRACK MANAGER CONTROL <= [params]>
if (TrackManager::parseJ(stream, params, p)) if (TrackManager::parseEqualSign(stream, params, p))
return; return;
break; break;

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202311200731Z" #define GITHUB_SHA "devel-202311211053Z"

View File

@ -350,7 +350,7 @@ void TrackManager::applyDCSpeed(byte t) {
track[t]->setDCSignal(speedByte); track[t]->setDCSignal(speedByte);
} }
bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[]) bool TrackManager::parseEqualSign(Print *stream, int16_t params, int16_t p[])
{ {
if (params==0) { // <=> List track assignments if (params==0) { // <=> List track assignments
@ -397,8 +397,8 @@ bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[])
return false; return false;
} }
void TrackManager::streamTrackState(Print* stream, byte t) {
// null stream means send to commandDistributor for broadcast // null stream means send to commandDistributor for broadcast
void TrackManager::streamTrackState(Print* stream, byte t) {
if (track[t]==NULL) return; if (track[t]==NULL) return;
auto format=F("<= %d XXX>\n"); auto format=F("<= %d XXX>\n");
TRACK_MODE tm = track[t]->getMode(); TRACK_MODE tm = track[t]->getMode();
@ -433,10 +433,12 @@ void TrackManager::streamTrackState(Print* stream, byte t) {
format=F("<= %c DC %d>\n"); format=F("<= %c DC %d>\n");
} }
if (stream) if (stream) { // null stream means send to commandDistributor for broadcast
StringFormatter::send(stream,format,'A'+t, trackDCAddr[t]); StringFormatter::send(stream,format,'A'+t, trackDCAddr[t]);
else } else {
CommandDistributor::broadcastTrackState(format,'A'+t, trackDCAddr[t]); CommandDistributor::broadcastTrackState(format,'A'+t, trackDCAddr[t]);
CommandDistributor::broadcastPower();
}
} }

View File

@ -73,7 +73,7 @@ class TrackManager {
static const int16_t MAX_TRACKS=8; static const int16_t MAX_TRACKS=8;
static bool setTrackMode(byte track, TRACK_MODE mode, int16_t DCaddr=0); static bool setTrackMode(byte track, TRACK_MODE mode, int16_t DCaddr=0);
static bool parseJ(Print * stream, int16_t params, int16_t p[]); static bool parseEqualSign(Print * stream, int16_t params, int16_t p[]);
static void loop(); static void loop();
static POWERMODE getMainPower(); static POWERMODE getMainPower();
static POWERMODE getProgPower(); static POWERMODE getProgPower();

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "5.2.5" #define VERSION "5.2.6"
// 5.2.6 - Trackmanager broadcast power state on track mode change
// 5.2.5 - Trackmanager: Do not treat TRACK_MODE_ALL as TRACK_MODE_DC // 5.2.5 - Trackmanager: Do not treat TRACK_MODE_ALL as TRACK_MODE_DC
// 5.2.4 - LCD macro will not do diag if that duplicates @ to same target. // 5.2.4 - LCD macro will not do diag if that duplicates @ to same target.
// - Added ROUTE_DISABLED macro in EXRAIL // - Added ROUTE_DISABLED macro in EXRAIL