Skip to content

Commit

Permalink
Merge pull request #107 from flash62au/master
Browse files Browse the repository at this point in the history
various changes
  • Loading branch information
flash62au authored Dec 9, 2024
2 parents d82dcc9 + 68fdb2b commit eb43d79
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 12 deletions.
19 changes: 19 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Version 1.3.36
- bug fix for only two turnouts/points

# Version 1.3.35
- bug fix for separate Stop button

# Version 1.3.34
- Added separate Stop button

# Version 1.3.33
- Removed the centre position for the direction toggle

# Version 1.3.32
- request an update for the loco as soon as it is acquired
- [Handoff] label for automation buttons

# Version 1.3.31
- responses for functions 29, 30, 31 were ignored

# Version 1.3.30
- bug fix if there are only two Routes

Expand Down
1 change: 0 additions & 1 deletion css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ input:checked + .slider.debug-slider:before{
padding: 12px;
box-shadow: 0 0 5px 2px #000000;
border: 1px solid #ececec;
background: #ddd;
}

.rotaryswitchPlugin.big.light {
Expand Down
27 changes: 22 additions & 5 deletions css/throttle.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,37 @@ label.formbuilder-file-label {
width: 44px;
height: 44px;
border-radius: 24px;
color: #d60000;
color: #ffffff;
font-size: 18px;
padding: 9px;
outline: none;
cursor: pointer;
background-color: #c7c7c7;
background-color: #d60000;
border: 4px solid #ddd;
box-shadow: 0 4px 4px #5d5d5d;
box-shadow: 2px 2px 4px #5d5d5d;
margin-bottom: 20px;
}
.em-btn button.em-stop:active{
box-shadow: none;
}
.em-btn button.normal-stop{
width: 44px;
height: 44px;
border-radius: 24px;
color: #d60000;
font-size: 18px;
padding: 9px;
outline: none;
cursor: pointer;
background-color: #c7c7c7;
border: 4px solid #d60000;
box-shadow: 2px 2px 4px #5d5d5d;
}
.em-btn button.normal-stop:active{
box-shadow: none;
}
.dir-toggle{
height: 219px;
height: 152px;
background-color: #cecece;
width: 48px;
margin: 8px auto;
Expand Down Expand Up @@ -297,7 +314,7 @@ label.formbuilder-file-label {
background: #da0000;
}
.dir-toggle.backward:before{
top: 141px;
top: 72px;
background: #00ac4d;
}
.dir-btn{
Expand Down
11 changes: 8 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<link rel="manifest" href="manifest.json">
<script>
var version = "1.3.30";
var version = "1.3.36";
</script>

<link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon">
Expand Down Expand Up @@ -189,14 +189,19 @@
<div class=" column-2">
<div class="em-btn">
<button class="em-stop" id="emergency-stop" title="Emergency Stop">
<span class="icon-stop"></span>
<span class="icon-stop2"></span>
</button>
</div>
<div class="dir-toggle">
<button class="dir-btn forward selected" id="dir-f" aria-label="forward" ><span class="arrow-up icon-up"></span></button>
<button class="dir-btn stop" id="dir-S" aria-label="stop"> <span class="stop"></span></button>
<!-- <button class="dir-btn stop" id="dir-S" aria-label="stop"> <span class="stop"></span></button> -->
<button class="dir-btn backward" id="dir-b" aria-label="backward"> <span class="arrow-down icon-down"></button>
</div>
<div class="em-btn">
<button class="normal-stop" id="normal-stop" title="Stop">
<span class="icon-stop2"></span>
</button>
</div>
</div>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions js/commandController.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function parseResponse(cmd) { // some basic ones only
} else {
console.log('[i] Ignoring Received Speed - too soon since last speed sent.');
}
for (i = 0; i <= 28; i++) {
for (i = 0; i <= 31; i++) {
fnState = (functMap >> i) & 0x1;
fnStateText = (fnState == 1) ? "true" : "false";
if (getFunCurrentVal("f" + i) != fnStateText) {
Expand Down Expand Up @@ -436,6 +436,9 @@ function parseResponse(cmd) { // some basic ones only
if (routesIds[i] == cmdArrayClean[1]) {
routesTypes[i] = cmdArrayClean[2];
routesNames[i] = cmdArrayClean[3].substring(1,cmdArrayClean[3].length-1);
if (routesTypes[i]=="A") {
routesLabels[i] = "Handoff";
}
}
}
for (i=0;i<routesIds.length;i++) {
Expand Down Expand Up @@ -489,7 +492,7 @@ function parseResponse(cmd) { // some basic ones only
} else if (cmdArray[0].charAt(2) == 'T') { //turnouts/points
last = cmdArray.length-1;
if (cmdArrayClean.length > 1) { // if ==1, then no turnouts
if ( (cmdArrayClean.length == 2 ) ||
if ( (cmdArrayClean.length == 2 ) || (cmdArrayClean.length == 3 ) ||
( (cmdArrayClean.length > 3 ) && (cmdArrayClean[3].charAt(0) != '"' ) ) ) {
turnoutsCount = cmdArrayClean.length-1;
console.log(getTimeStamp() + ' Processing turnouts: ' + turnoutsCount);
Expand Down
15 changes: 14 additions & 1 deletion js/exwebthrottle.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function uiDisable(status) {
$("#power-switch").parent().addClass("ui-state-disabled")
$("#dir-f").parent().addClass("ui-state-disabled")
$("#emergency-stop").addClass("ui-state-disabled")
$("#normal-stop").addClass("ui-state-disabled")
$("#button-right").addClass("ui-state-disabled")
$("#button-left").addClass("ui-state-disabled")
for (i = 0; i <= 28; i++) {
Expand All @@ -159,6 +160,7 @@ function uiDisable(status) {
$("#power-switch").parent().removeClass("ui-state-disabled")
$("#dir-f").parent().removeClass("ui-state-disabled")
$("#emergency-stop").removeClass("ui-state-disabled")
$("#normal-stop").removeClass("ui-state-disabled")
$("#button-right").removeClass("ui-state-disabled")
$("#button-left").removeClass("ui-state-disabled")
for (i = 0; i <= 28; i++) {
Expand All @@ -176,7 +178,7 @@ function uiDisable(status) {
}

$("#dir-f").prop('disabled', status)
$("#dir-S").prop('disabled', status)
// $("#dir-S").prop('disabled', status)
$("#dir-b").prop('disabled', status)
if (status) {
//$("#throttle").roundSlider("disable");
Expand Down Expand Up @@ -638,6 +640,7 @@ $(document).ready(function () {
acButton.data("acquired", true);
acButton.html('<span class="icon-cross"></span>');
toggleThrottleState(!isDirectionToggleStopped);
writeToStream('t ' + locoid_input); // request an update for the loco
// $("#select-map").focus();
$("#power-switch").focus();

Expand Down Expand Up @@ -847,6 +850,16 @@ $(document).ready(function () {
}
});

$("#normal-stop").on("click", function () {
if (getCV() != 0) {
isStopped = true;
dir = getDirection();
setSpeed(0);
setSpeedofControllers();
sendSpeed(getCV(), 0, lastDir);
}
});

// Hide/Show the Loco, Connect server fields (on top)
$("#button-hide").on("click", function () {
if ($(".details-panel").is(":visible")) {
Expand Down

0 comments on commit eb43d79

Please sign in to comment.