mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-31 11:23:44 +02:00
Compare commits
18 Commits
v4.1.2-Pro
...
revert-333
Author | SHA1 | Date | |
---|---|---|---|
|
a07ab9484f | ||
|
fcf05206b4 | ||
|
cc3aba1feb | ||
|
91d36ae909 | ||
|
98af5c45ed | ||
|
d3eceb6d6c | ||
|
79eaaa85fa | ||
|
0f5b8adb6b | ||
|
da8faa808b | ||
|
7311f2ce64 | ||
|
7e4f9eb0e1 | ||
|
1f5eafbcca | ||
|
7e16ec7088 | ||
|
912646f8ff | ||
|
dd309a3705 | ||
|
5376c9f410 | ||
|
b1d110ecbf | ||
|
5b7801ca6c |
4
.github/ISSUE_TEMPLATE/support_request.yml
vendored
4
.github/ISSUE_TEMPLATE/support_request.yml
vendored
@@ -35,5 +35,5 @@ body:
|
||||
label: Hardware
|
||||
description: If appropriate, please provide details of the hardware in use.
|
||||
placeholder: |
|
||||
Elegoo Mega2560
|
||||
Arduino Motor Shield R3
|
||||
Elegoo Mega2560
|
||||
Arduino Motor Shield R3
|
61
.github/workflows/new-items.yml
vendored
61
.github/workflows/new-items.yml
vendored
@@ -13,7 +13,7 @@ on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types:
|
||||
- ready_for_review
|
||||
- opened
|
||||
@@ -42,26 +42,35 @@ jobs:
|
||||
gh api graphql -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
projectV2(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
... on ProjectV2Field {
|
||||
id
|
||||
name
|
||||
}
|
||||
... on ProjectV2SingleSelectField {
|
||||
id
|
||||
name
|
||||
options {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org=$ORG -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'BACKLOG_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Backlog") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TO_DO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="To Do") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'NEEDS_REVIEW_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Needs Review") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'BACKLOG_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="Backlog") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TO_DO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="To Do") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'NEEDS_REVIEW_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="Needs Review") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
@@ -70,12 +79,12 @@ jobs:
|
||||
run: |
|
||||
project_item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $item:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $item}) {
|
||||
projectNextItem {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $item}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Add PR to project
|
||||
@@ -86,12 +95,12 @@ jobs:
|
||||
run: |
|
||||
project_item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $item:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $item}) {
|
||||
projectNextItem {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $item}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Set status - To Do
|
||||
@@ -106,13 +115,15 @@ jobs:
|
||||
$status_field: ID!
|
||||
$status_value: String!
|
||||
){
|
||||
set_status: updateProjectNextItemField(input: {
|
||||
set_status: updateProjectV2ItemFieldValue(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $status_field
|
||||
value: $status_value
|
||||
value: {
|
||||
singleSelectOptionId: $status_value
|
||||
}
|
||||
}) {
|
||||
projectNextItem {
|
||||
projectV2Item {
|
||||
id
|
||||
}
|
||||
}
|
||||
@@ -130,13 +141,15 @@ jobs:
|
||||
$status_field: ID!
|
||||
$status_value: String!
|
||||
){
|
||||
set_status: updateProjectNextItemField(input: {
|
||||
set_status: updateProjectV2ItemFieldValue(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $status_field
|
||||
value: $status_value
|
||||
value: {
|
||||
singleSelectOptionId: $status_value
|
||||
}
|
||||
}) {
|
||||
projectNextItem {
|
||||
projectV2Item {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
@@ -599,14 +599,17 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||
else { // <JT id>
|
||||
Turnout * t=Turnout::get(id);
|
||||
if (!t || t->isHidden()) StringFormatter::send(stream, F(" %d X"),id);
|
||||
else StringFormatter::send(stream, F(" %d %c \"%S\""),
|
||||
id,t->isThrown()?'T':'C',
|
||||
else {
|
||||
const FSH *tdesc = NULL;
|
||||
#ifdef EXRAIL_ACTIVE
|
||||
RMFT2::getTurnoutDescription(id)
|
||||
#else
|
||||
F("")
|
||||
#endif
|
||||
);
|
||||
tdesc = RMFT2::getTurnoutDescription(id);
|
||||
#endif
|
||||
if (tdesc == NULL)
|
||||
tdesc = F("");
|
||||
StringFormatter::send(stream, F(" %d %c \"%S\""),
|
||||
id,t->isThrown()?'T':'C',
|
||||
tdesc);
|
||||
}
|
||||
}
|
||||
StringFormatter::send(stream, F(">\n"));
|
||||
return;
|
||||
|
@@ -36,11 +36,11 @@ EthernetInterface * EthernetInterface::singleton=NULL;
|
||||
*/
|
||||
void EthernetInterface::setup()
|
||||
{
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware)
|
||||
DIAG(F("Ethernet shield not detected or is a W5100"));
|
||||
if (singleton!=NULL)
|
||||
if (singleton!=NULL) {
|
||||
DIAG(F("Prog Error!"));
|
||||
if (singleton=new EthernetInterface())
|
||||
return;
|
||||
}
|
||||
if ((singleton=new EthernetInterface()))
|
||||
return;
|
||||
DIAG(F("Ethernet not initialized"));
|
||||
};
|
||||
@@ -67,6 +67,16 @@ EthernetInterface::EthernetInterface()
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware)
|
||||
DIAG(F("Ethernet shield not detected or is a W5100"));
|
||||
|
||||
unsigned long startmilli = millis();
|
||||
while ((millis() - startmilli) < 5500) { // Loop to give time to check for cable connection
|
||||
if (Ethernet.linkStatus() == LinkON)
|
||||
break;
|
||||
DIAG(F("Ethernet waiting for link (1sec) "));
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
2
LCN.cpp
2
LCN.cpp
@@ -43,7 +43,7 @@ void LCN::loop() {
|
||||
|
||||
while (stream->available()) {
|
||||
int ch = stream->read();
|
||||
if (ch >= 0 && ch <= '9') { // accumulate id value
|
||||
if (ch >= '0' && ch <= '9') { // accumulate id value
|
||||
id = 10 * id + ch - '0';
|
||||
}
|
||||
else if (ch == 't' || ch == 'T') { // Turnout opcodes
|
||||
|
@@ -3,72 +3,74 @@ Throttle Assist updates for versiuon 4.?
|
||||
Chris Harlow April 2022
|
||||
|
||||
There are a number of additional throttle information commands that have been implemented to assist throttle authors to obtain information from the Command Station in order to implement turnout, route/automation and roster features which are already found in the Withrottle implementations.
|
||||
These commands are new and not overlapped with the existing commands which are probabaly due to be obsoleted as they are over complex and unfit for purpose.
|
||||
These commands are new and not overlapped with the existing commands which are probabaly due to be obsoleted as they are over complex and unfit for purpose.
|
||||
|
||||
Turnouts:
|
||||
# Turnouts
|
||||
|
||||
The conventional turnout definition commands and the ```<H>``` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than T123 and having a list helps the throttle UI build a suitable set of buttons.
|
||||
The conventional turnout definition commands and the ```<H>``` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than the cryptic "T123", and having a list helps the throttle UI build a suitable set of buttons.
|
||||
|
||||
```<JT>``` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state.
|
||||
```<JT>``` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state.
|
||||
e.g. response ```<jT 1 17 22 19>```
|
||||
|
||||
```<JT 17>`` requests info on turnout 17.
|
||||
e.g. response ```<jT 17 T "Coal yard exit">``` or ```<jT 17 C "Coal yard exit">```
|
||||
(T=thrown, C=closed)
|
||||
or ```<jT 17 C "">``` indicating turnout description not given.
|
||||
or ```<jT 17 X>``` indicating turnout unknown (or possibly hidden.)
|
||||
```<JT 17>``` requests info on turnout 17\
|
||||
e.g. response ```<jT 17 T "Coal yard exit">``` or ```<jT 17 C "Coal yard exit">```\
|
||||
(T=thrown, C=closed)\
|
||||
or ```<jT 17 C "">``` indicating turnout description not given.\
|
||||
or ```<jT 17 X>``` indicating turnout unknown (or possibly hidden.)
|
||||
|
||||
Note: It is still the throttles responsibility to monitor the status broadcasts.\
|
||||
(TBD I'm thinking that the existing broadcast is messy and needs cleaning up)\
|
||||
However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started.
|
||||
Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands.
|
||||
|
||||
Note: It is still the throttles responsibility to monitor the status broadcasts.
|
||||
(TBD I'm thinking that the existing broadcast is messy and needs cleaning up)
|
||||
However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started.
|
||||
Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands.
|
||||
# Automations/Routes
|
||||
|
||||
|
||||
Automations/Routes
|
||||
|
||||
A throttle need to know which EXRAIL Automations and Routes it can show the user.
|
||||
|
||||
```<JA>``` Returns a list of Automations/Routes
|
||||
e.g. ```<jA 13 16 23>```
|
||||
Indicates route/automation ids.
|
||||
Information on each route needs to be obtained by
|
||||
```<JA 13>```
|
||||
returns e.g. ```<jA 13 R "description">``` for a route
|
||||
or ```<jA 13 A "description">``` for an automation.
|
||||
or ```<jA 13 X>``` for id not found
|
||||
|
||||
Whats the difference:
|
||||
A Route is just a call to an EXRAIL ROUTE, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco.
|
||||
Thus a route can be triggered by sending in for example ```</START 13>```.
|
||||
A throttle need to know which EXRAIL Automations and Routes it can show the user.
|
||||
|
||||
An Automation is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away.
|
||||
Thus an Automation expects a start command with a cab id
|
||||
```<JA>``` Returns a list of Automations/Routes\
|
||||
e.g. ```<jA 13 16 23>```\
|
||||
Indicates route/automation ids.\
|
||||
Information on each route needs to be obtained by\
|
||||
```<JA 13>```\
|
||||
returns e.g. ```<jA 13 R "description">``` for a route\
|
||||
or ```<jA 13 A "description">``` for an automation.\
|
||||
or ```<jA 13 X>``` for id not found
|
||||
|
||||
## What's the difference?
|
||||
|
||||
A *Route* is just a call to an **EXRAIL ROUTE**, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco.
|
||||
|
||||
Thus, a route can be triggered by sending in for example ```</START 13>```.
|
||||
|
||||
An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away.
|
||||
|
||||
Thus an Automation expects a start command with a cab id\
|
||||
e.g. ```</START 13 3>```
|
||||
|
||||
### Roster Information
|
||||
|
||||
Roster Information:
|
||||
The ```<JR>``` command requests a list of cab ids from the roster.
|
||||
e.g. responding ```<jR 3 200 6336>```
|
||||
or <jR> for none.
|
||||
The ```<JR>``` command requests a list of cab ids from the roster\
|
||||
e.g. responding ```<jR 3 200 6336>```\
|
||||
or <jR> for none.
|
||||
|
||||
Each Roster entry had a name and function map obtained by:
|
||||
```<JR 200>``` reply like ```<jR 200 "Thomas" "whistle/*bell/squeal/panic">
|
||||
Each Roster entry had a name and function map obtained by:\
|
||||
```<JR 200>``` reply like ```<jR 200 "Thomas" "whistle/*bell/squeal/panic">
|
||||
|
||||
Refer to EXRAIL ROSTER command for function map format.
|
||||
Refer to EXRAIL ROSTER command for function map format.
|
||||
|
||||
### Obtaining throttle status
|
||||
|
||||
```<t cabid>``` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast\
|
||||
```<l cabid slot speedbyte functionMap>```
|
||||
|
||||
Obtaining throttle status.
|
||||
```<t cabid>``` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast.
|
||||
```<l cabid slot speedbyte functionMap>```
|
||||
Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled.
|
||||
Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled.
|
||||
|
||||
# COMMANDS TO AVOID
|
||||
|
||||
COMMANDS TO AVOID
|
||||
|
||||
```<f cab func1 func2>``` Use ```<F cab function 1/0>```
|
||||
```<t slot cab speed dir>``` Just drop the slot number
|
||||
```<T commands>``` other than ```<T id 0/1>```
|
||||
```<s>```
|
||||
```<f cab func1 func2>``` Instead Use ```<F cab function 1/0>```\
|
||||
```<t slot cab speed dir>``` Just drop the slot number\
|
||||
```<T commands>``` other than ```<T id 0/1>```\
|
||||
```<s>```\
|
||||
```<c>```
|
||||
|
||||
|
||||
|
@@ -3,7 +3,10 @@
|
||||
|
||||
#include "StringFormatter.h"
|
||||
|
||||
#define VERSION "4.1.2"
|
||||
#define VERSION "4.1.5"
|
||||
// 4.1.5 Bugfix LCN number parsing
|
||||
// 4.1.4 Bugfix for issue #299 TurnoutDescription NULL
|
||||
// 4.1.3 Bugfix: Ethernet init order
|
||||
// 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level
|
||||
// 4.1.1 Bugfix: preserve turnout format
|
||||
// Bugfix: parse multiple commands in one buffer string correctly (ex: <s><Q>)
|
||||
@@ -16,7 +19,7 @@
|
||||
// UNO Progmem optimized to allow for small EXRAIL Automation scipts
|
||||
// 4.0.2 Command Station and EX-RAIL Ehancements & Additions:
|
||||
// New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications
|
||||
// Change ACK defaults now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders
|
||||
// Change ACK defaults now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders
|
||||
// New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor
|
||||
// </RED signal_id> to turn a individual LED Signal On & Off
|
||||
// </AMBER signal_id> "
|
||||
|
Reference in New Issue
Block a user