1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

Allow left/right turnout labels WiThrottle

TPL assist
This commit is contained in:
Asbelos 2020-07-24 17:29:48 +01:00
parent 9b58eb29a2
commit 6fadd18827
2 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,7 @@
if (myLocos[loco].throttle==THROTTLECHAR && (CAB<0 || myLocos[loco].cab==CAB))
WiThrottle * WiThrottle::firstThrottle=NULL;
bool WiThrottle::annotateLeftRight=false;
WiThrottle* WiThrottle::getThrottle( int wifiClient) {
for (WiThrottle* wt=firstThrottle; wt!=NULL ; wt=wt->nextThrottle)
@ -99,7 +100,10 @@ void WiThrottle::parse(Print & stream, byte * cmdx) {
switch (callState) {
case 0: // first call in
callState++;
StringFormatter::send(stream,F("VN2.0\nHTDCC++EX\nRL0\nPPA%x\nPTT]\\[Turnouts}|{Turnout]\\[Closed}|{2]\\[Thrown}|{4\n*10\n"),
StringFormatter::send(stream,F("VN2.0\nHTDCC++EX\nRL0\nPPA%x\n"));
if (annotateLeftRight) StringFormatter::send(stream,F("PTT]\\[Turnouts}|{Turnout]\\[Left}|{2]\\[Right}|{4\n"));
else StringFormatter::send(stream,F("PTT]\\[Turnouts}|{Turnout]\\[Closed}|{2]\\[Thrown}|{4\n"));
StringFormatter::send(stream,F("*10\n"),
DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON);
break;
case 1: // second call... send the turnout table if we have one

View File

@ -30,7 +30,7 @@ class WiThrottle {
static void loop();
void parse(Print & stream, byte * cmd);
static WiThrottle* getThrottle( int wifiClient);
static bool annotateLeftRight;
private:
WiThrottle( int wifiClientId);
~WiThrottle();