Skip to content

Commit

Permalink
added setting to turn off the timestamp in the log
Browse files Browse the repository at this point in the history
  • Loading branch information
flash62au committed Feb 9, 2024
1 parent 662d8c4 commit c844da4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- Correct Functions load automatically when loco selected from the list
- Functions return to default when loco dropped
- DCC address labels changed from 'CV' to 'DCC Addr' or 'Addr'
- added setting to turn off the timestamp in the log

# Version 1.3.9
- Improvements for when a separate throttle is controlling the same loco
Expand Down
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,17 @@ <h4 class="fn-heading add-loco-head">Add Locomotive</h4>
</select>
</div>
</div>
<div class="row setting-entry">
<label class="setting-label">
Timestamp on log
</label>
<div class="setting-content">
<select id="timestamp-selector" class="btn throttle-selector select-control" name="throttleselector" title="Change Throttle Controller">
<option value="on"> On </option>
<option value="off"> Off </option>
</select>
</div>
</div>
</div>
</div>
<div class="settings-section" id="storage-section">
Expand Down
2 changes: 2 additions & 0 deletions js/commandController.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ function sendCommandForFunction(fn, opr) {


function getTimeStamp() {
if (getPreference("timestamp")=="off") return "";

var now = new Date();
var startOfSec = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
var millsecs = now.getMilliseconds() - startOfSec.getMilliseconds();
Expand Down
12 changes: 11 additions & 1 deletion js/exwebthrottle.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ function setThrottleScreenUI() {
$("#debug-console").hide();
$("#console-toggle").prop("checked", false);
}

if (getPreference("timestamp") == null) {
setPreference("timestamp", "on");
}
$("#timestamp-selector").val(getPreference("timestamp")).trigger("change");

$(".dir-toggle").addClass("forward");

// Set theme
Expand Down Expand Up @@ -521,6 +525,12 @@ $(document).ready(function(){
}
});

$("#timestamp-selector").on("change", function (e) {
selectedval = $(this).val();
setPreference("timestamp", selectedval);
});


// Connect command station
$("#button-connect").on("click", function () {
toggleServer($(this));
Expand Down

0 comments on commit c844da4

Please sign in to comment.