From 9d92fd9451a60cf68d5022e33a75d3da3c2e17ca Mon Sep 17 00:00:00 2001 From: mstevetodd Date: Sun, 27 Dec 2020 10:20:11 -0500 Subject: [PATCH 1/5] add turnout, sensor and output states to 's'tatus message (#108) * add support for FireBox_Mk1, reduce heartbeat, separate eStop time * make match master * make match master * Update defines.h * FIX: return WiThrottle speedstep, not DCC speedstep, in response to speed change request. Should close #104 * use int, not byte for witSpeed * add turnout, sensor and output states to 's'tatus message --- DCCEXParser.cpp | 10 ++++++---- Outputs.cpp | 6 ++++++ Outputs.h | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index e4949ce..0a78676 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -445,9 +445,11 @@ void DCCEXParser::parse(Print *stream, byte *com, bool blocking) case 's': // StringFormatter::send(stream, F(""), DCCWaveform::mainTrack.getPowerMode() == POWERMODE::ON); StringFormatter::send(stream, F(""), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA)); + parseT(stream, 0, p); //send all Turnout states + Output::printAll(stream); //send all Output states + Sensor::printAll(stream); //send all Sensor states // TODO Send stats of speed reminders table - // TODO send status of turnouts etc etc - return; + return; case 'E': // STORE EPROM EEStore::store(); @@ -589,7 +591,7 @@ bool DCCEXParser::parseT(Print *stream, int params, int p[]) { switch (params) { - case 0: // show all turnouts + case 0: // list all turnout states { bool gotOne = false; for (Turnout *tt = Turnout::firstTurnout; tt != NULL; tt = tt->nextTurnout) @@ -644,7 +646,7 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[]) StringFormatter::send(stream, F("")); return true; - case 0: // lit sensor states + case 0: // list sensor states if (Sensor::firstSensor == NULL) return false; for (Sensor *tt = Sensor::firstSensor; tt != NULL; tt = tt->nextSensor) diff --git a/Outputs.cpp b/Outputs.cpp index 84290fe..b135d0f 100644 --- a/Outputs.cpp +++ b/Outputs.cpp @@ -83,7 +83,13 @@ the state of any outputs being monitored or controlled by a separate interface o #include "Outputs.h" #include "EEStore.h" +#include "StringFormatter.h" +// print all output states to stream +void Output::printAll(Print *stream){ + for (Output *tt = Output::firstOutput; tt != NULL; tt = tt->nextOutput) + StringFormatter::send(stream, F(""), tt->data.id, tt->data.oStatus); +} // Output::printAll void Output::activate(int s){ data.oStatus=(s>0); // if s>0, set status to active, else inactive diff --git a/Outputs.h b/Outputs.h index 891cd9b..319f704 100644 --- a/Outputs.h +++ b/Outputs.h @@ -39,6 +39,7 @@ class Output{ static Output *firstOutput; struct OutputData data; Output *nextOutput; + static void printAll(Print *); private: int num; // Chris has no idea what this is all about! From 72aa0f2c2b35917e3185e6d19105b79b7febaecd Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 27 Dec 2020 10:38:51 -0500 Subject: [PATCH 2/5] Update Prod-Release-Notes.md --- Release - Architecture Doc/Prod-Release-Notes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Release - Architecture Doc/Prod-Release-Notes.md b/Release - Architecture Doc/Prod-Release-Notes.md index 5d5046e..a5db1f1 100644 --- a/Release - Architecture Doc/Prod-Release-Notes.md +++ b/Release - Architecture Doc/Prod-Release-Notes.md @@ -5,6 +5,10 @@ The DCC-EX Team is pleased to release CommandStation-EX-v3.0.0 as a Production R - **Wi-Fi** - works, but can be challenging to use if you want to switch between AP mode and STA station mode. - **Pololu Motor Shield** - is supported with this release, but the user may have to play around with some timings to enable programming mode due to limitation in its current sensing circuitry +**Summary of the key new features added to CommandStation-EX V3.0.1:** + - **Add back fix for jitter + - **Add Turnouts, Outputs and Sensors to command output + **Summary of the key new features added to CommandStation-EX V3.0.0:** - **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains. - **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients. From a34b51a63d49548b05169fd4183de331d532dc4f Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 27 Dec 2020 10:41:14 -0500 Subject: [PATCH 3/5] Update Prod-Release-Notes.md Fix formatting. --- Release - Architecture Doc/Prod-Release-Notes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Release - Architecture Doc/Prod-Release-Notes.md b/Release - Architecture Doc/Prod-Release-Notes.md index a5db1f1..6986879 100644 --- a/Release - Architecture Doc/Prod-Release-Notes.md +++ b/Release - Architecture Doc/Prod-Release-Notes.md @@ -6,10 +6,11 @@ The DCC-EX Team is pleased to release CommandStation-EX-v3.0.0 as a Production R - **Pololu Motor Shield** - is supported with this release, but the user may have to play around with some timings to enable programming mode due to limitation in its current sensing circuitry **Summary of the key new features added to CommandStation-EX V3.0.1:** - - **Add back fix for jitter - - **Add Turnouts, Outputs and Sensors to command output + - **Add back fix for jitter** + - **Add Turnouts, Outputs and Sensors to command output** **Summary of the key new features added to CommandStation-EX V3.0.0:** + - **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains. - **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients. - **Withrottle Integrations** - Act as a host for up to four WiThrottle clients concurrently. From b674869427d86b30dfd849f12512471ab710d2da Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 27 Dec 2020 10:43:17 -0500 Subject: [PATCH 4/5] Update Prod-Release-Notes.md --- Release - Architecture Doc/Prod-Release-Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Release - Architecture Doc/Prod-Release-Notes.md b/Release - Architecture Doc/Prod-Release-Notes.md index 6986879..acc2e2e 100644 --- a/Release - Architecture Doc/Prod-Release-Notes.md +++ b/Release - Architecture Doc/Prod-Release-Notes.md @@ -7,7 +7,7 @@ The DCC-EX Team is pleased to release CommandStation-EX-v3.0.0 as a Production R **Summary of the key new features added to CommandStation-EX V3.0.1:** - **Add back fix for jitter** - - **Add Turnouts, Outputs and Sensors to command output** + - **Add Turnouts, Outputs and Sensors to '''' command output** **Summary of the key new features added to CommandStation-EX V3.0.0:** From fd6784a2c207d350b418e1decf12cbe3e83dde45 Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 27 Dec 2020 10:48:17 -0500 Subject: [PATCH 5/5] Update Prod-Release-Notes.md --- Release - Architecture Doc/Prod-Release-Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Release - Architecture Doc/Prod-Release-Notes.md b/Release - Architecture Doc/Prod-Release-Notes.md index acc2e2e..1a04b09 100644 --- a/Release - Architecture Doc/Prod-Release-Notes.md +++ b/Release - Architecture Doc/Prod-Release-Notes.md @@ -7,7 +7,7 @@ The DCC-EX Team is pleased to release CommandStation-EX-v3.0.0 as a Production R **Summary of the key new features added to CommandStation-EX V3.0.1:** - **Add back fix for jitter** - - **Add Turnouts, Outputs and Sensors to '''' command output** + - **Add Turnouts, Outputs and Sensors to `````` command output** **Summary of the key new features added to CommandStation-EX V3.0.0:**