mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 08:36:14 +01:00
Compare commits
No commits in common. "263ed18b253faff69227a843ad5fd419c4487027" and "29ea7460621b7948c45703121a131b6ea95662e2" have entirely different histories.
263ed18b25
...
29ea746062
|
@ -275,8 +275,8 @@ void CommandDistributor::broadcastRaw(clientType type, char * msg) {
|
|||
broadcastReply(type, F("%s"),msg);
|
||||
}
|
||||
|
||||
void CommandDistributor::broadcastTrackState(const FSH* format, byte trackLetter, const FSH *modename, int16_t dcAddr) {
|
||||
broadcastReply(COMMAND_TYPE, format, trackLetter, modename, dcAddr);
|
||||
void CommandDistributor::broadcastTrackState(const FSH* format,byte trackLetter, int16_t dcAddr) {
|
||||
broadcastReply(COMMAND_TYPE, format, trackLetter, dcAddr);
|
||||
}
|
||||
|
||||
void CommandDistributor::broadcastRouteState(uint16_t routeId, byte state ) {
|
||||
|
|
|
@ -55,7 +55,7 @@ public :
|
|||
static int16_t retClockTime();
|
||||
static void broadcastPower();
|
||||
static void broadcastRaw(clientType type,char * msg);
|
||||
static void broadcastTrackState(const FSH* format,byte trackLetter, const FSH* modename, int16_t dcAddr);
|
||||
static void broadcastTrackState(const FSH* format,byte trackLetter, int16_t dcAddr);
|
||||
template<typename... Targs> static void broadcastReply(clientType type, Targs... msg);
|
||||
static void forget(byte clientId);
|
||||
static void broadcastRouteState(uint16_t routeId,byte state);
|
||||
|
|
|
@ -121,14 +121,14 @@ const byte RMFT2::compileFeatures = 0
|
|||
#include "EXRAIL2MacroReset.h"
|
||||
#undef ROUTE
|
||||
#define ROUTE(id, description) id,
|
||||
const int16_t HIGHFLASH const RMFT2::routeIdList[]= {
|
||||
const int16_t HIGHFLASH RMFT2::routeIdList[]= {
|
||||
#include "myAutomation.h"
|
||||
INT16_MAX};
|
||||
// Pass 2a create throttle automation list
|
||||
#include "EXRAIL2MacroReset.h"
|
||||
#undef AUTOMATION
|
||||
#define AUTOMATION(id, description) id,
|
||||
const int16_t HIGHFLASH const RMFT2::automationIdList[]= {
|
||||
const int16_t HIGHFLASH RMFT2::automationIdList[]= {
|
||||
#include "myAutomation.h"
|
||||
INT16_MAX};
|
||||
|
||||
|
@ -150,7 +150,7 @@ const FSH * RMFT2::getRouteDescription(int16_t id) {
|
|||
const int StringMacroTracker1=__COUNTER__;
|
||||
#define THRUNGE(msg,mode) \
|
||||
case (__COUNTER__ - StringMacroTracker1) : {\
|
||||
static const char HIGHFLASH const thrunge[]=msg;\
|
||||
static const char HIGHFLASH thrunge[]=msg;\
|
||||
strfar=(uint32_t)GETFARPTR(thrunge);\
|
||||
tmode=mode;\
|
||||
break;\
|
||||
|
@ -186,7 +186,7 @@ case (__COUNTER__ - StringMacroTracker1) : {\
|
|||
#undef LCD
|
||||
#define LCD(id,msg) \
|
||||
case (__COUNTER__ - StringMacroTracker1) : {\
|
||||
static const char HIGHFLASH const thrunge[]=msg;\
|
||||
static const char HIGHFLASH thrunge[]=msg;\
|
||||
strfar=(uint32_t)GETFARPTR(thrunge);\
|
||||
tmode=thrunge_lcd; \
|
||||
lcdid=id;\
|
||||
|
@ -195,7 +195,7 @@ case (__COUNTER__ - StringMacroTracker1) : {\
|
|||
#undef SCREEN
|
||||
#define SCREEN(display,id,msg) \
|
||||
case (__COUNTER__ - StringMacroTracker1) : {\
|
||||
static const char HIGHFLASH const thrunge[]=msg;\
|
||||
static const char HIGHFLASH thrunge[]=msg;\
|
||||
strfar=(uint32_t)GETFARPTR(thrunge);\
|
||||
tmode=(thrunger)(thrunge_lcd+display); \
|
||||
lcdid=id;\
|
||||
|
@ -274,7 +274,7 @@ const byte RMFT2::rosterNameCount=0
|
|||
#include "EXRAIL2MacroReset.h"
|
||||
#undef ROSTER
|
||||
#define ROSTER(cabid,name,funcmap...) cabid,
|
||||
const int16_t HIGHFLASH const RMFT2::rosterIdList[]={
|
||||
const int16_t HIGHFLASH RMFT2::rosterIdList[]={
|
||||
#include "myAutomation.h"
|
||||
INT16_MAX};
|
||||
|
||||
|
@ -314,7 +314,7 @@ const FSH * RMFT2::getRosterFunctions(int16_t id) {
|
|||
#undef VIRTUAL_SIGNAL
|
||||
#define VIRTUAL_SIGNAL(id) id,0,0,0,
|
||||
|
||||
const HIGHFLASH int16_t const RMFT2::SignalDefinitions[] = {
|
||||
const HIGHFLASH int16_t RMFT2::SignalDefinitions[] = {
|
||||
#include "myAutomation.h"
|
||||
0,0,0,0 };
|
||||
|
||||
|
@ -503,7 +503,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
|
|||
|
||||
// Build RouteCode
|
||||
const int StringMacroTracker2=__COUNTER__;
|
||||
const HIGHFLASH byte const RMFT2::RouteCode[] = {
|
||||
const HIGHFLASH byte RMFT2::RouteCode[] = {
|
||||
#include "myAutomation.h"
|
||||
OPCODE_ENDTASK,0,0,OPCODE_ENDEXRAIL,0,0 };
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
#define GITHUB_SHA "devel-202311211437Z"
|
||||
#define GITHUB_SHA "devel-202311211053Z"
|
||||
|
|
|
@ -397,58 +397,46 @@ bool TrackManager::parseEqualSign(Print *stream, int16_t params, int16_t p[])
|
|||
return false;
|
||||
}
|
||||
|
||||
const FSH* TrackManager::getModeName(TRACK_MODE tm) {
|
||||
const FSH *modename=F("---");
|
||||
|
||||
// null stream means send to commandDistributor for broadcast
|
||||
void TrackManager::streamTrackState(Print* stream, byte t) {
|
||||
if (track[t]==NULL) return;
|
||||
auto format=F("<= %d XXX>\n");
|
||||
TRACK_MODE tm = track[t]->getMode();
|
||||
if (tm & TRACK_MODE_MAIN) {
|
||||
if(tm & TRACK_MODE_AUTOINV)
|
||||
modename=F("MAIN A");
|
||||
format=F("<= %c MAIN A>\n");
|
||||
else if (tm & TRACK_MODE_INV)
|
||||
modename=F("MAIN I>\n");
|
||||
format=F("<= %c MAIN I>\n");
|
||||
else
|
||||
modename=F("MAIN");
|
||||
format=F("<= %c MAIN>\n");
|
||||
}
|
||||
#ifndef DISABLE_PROG
|
||||
else if (tm & TRACK_MODE_PROG)
|
||||
modename=F("PROG");
|
||||
format=F("<= %c PROG>\n");
|
||||
#endif
|
||||
else if (tm & TRACK_MODE_NONE)
|
||||
modename=F("NONE");
|
||||
format=F("<= %c NONE>\n");
|
||||
else if(tm & TRACK_MODE_EXT)
|
||||
modename=F("EXT");
|
||||
format=F("<= %c EXT>\n");
|
||||
else if(tm & TRACK_MODE_BOOST) {
|
||||
if(tm & TRACK_MODE_AUTOINV)
|
||||
modename=F("B A");
|
||||
format=F("<= %c B A>\n");
|
||||
else if (tm & TRACK_MODE_INV)
|
||||
modename=F("B I");
|
||||
format=F("<= %c B I>\n");
|
||||
else
|
||||
modename=F("B");
|
||||
format=F("<= %c B>\n");
|
||||
}
|
||||
else if (tm & TRACK_MODE_DC) {
|
||||
if (tm & TRACK_MODE_INV)
|
||||
modename=F("DCX");
|
||||
format=F("<= %c DCX %d>\n");
|
||||
else
|
||||
modename=F("DC");
|
||||
format=F("<= %c DC %d>\n");
|
||||
}
|
||||
return modename;
|
||||
}
|
||||
|
||||
// null stream means send to commandDistributor for broadcast
|
||||
void TrackManager::streamTrackState(Print* stream, byte t) {
|
||||
const FSH *format;
|
||||
|
||||
if (track[t]==NULL) return;
|
||||
TRACK_MODE tm = track[t]->getMode();
|
||||
if (tm & TRACK_MODE_DC)
|
||||
format=F("<= %c %S %d>\n");
|
||||
else
|
||||
format=F("<= %c %S>\n");
|
||||
|
||||
const FSH *modename=getModeName(tm);
|
||||
if (stream) { // null stream means send to commandDistributor for broadcast
|
||||
StringFormatter::send(stream,format,'A'+t, modename, trackDCAddr[t]);
|
||||
StringFormatter::send(stream,format,'A'+t, trackDCAddr[t]);
|
||||
} else {
|
||||
CommandDistributor::broadcastTrackState(format,'A'+t, modename, trackDCAddr[t]);
|
||||
CommandDistributor::broadcastTrackState(format,'A'+t, trackDCAddr[t]);
|
||||
CommandDistributor::broadcastPower();
|
||||
}
|
||||
|
||||
|
@ -653,3 +641,18 @@ int16_t TrackManager::returnDCAddr(byte t) {
|
|||
return (trackDCAddr[t]);
|
||||
}
|
||||
|
||||
const char* TrackManager::getModeName(byte Mode) {
|
||||
|
||||
//DIAG(F("PowerMode %d"), Mode);
|
||||
|
||||
switch (Mode)
|
||||
{
|
||||
case 1: return "NONE";
|
||||
case 2: return "MAIN";
|
||||
case 4: return "PROG";
|
||||
case 8: return "DC";
|
||||
case 16: return "DCX";
|
||||
case 32: return "EXT";
|
||||
default: return "----";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class TrackManager {
|
|||
static bool isProg(byte t);
|
||||
static byte returnMode(byte t);
|
||||
static int16_t returnDCAddr(byte t);
|
||||
static const FSH* getModeName(TRACK_MODE Mode);
|
||||
static const char* getModeName(byte Mode);
|
||||
|
||||
static int16_t joinRelay;
|
||||
static bool progTrackSyncMain; // true when prog track is a siding switched to main
|
||||
|
|
Loading…
Reference in New Issue
Block a user