From 631ac67c38f0100fd129bd36b2a8c653cb61510c Mon Sep 17 00:00:00 2001 From: openbuilds-engineer Date: Tue, 14 Apr 2020 16:18:25 +0200 Subject: [PATCH] v1.0.222 --- CHANGELOG.txt | 2 ++ app/js/keyboard.js | 70 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8e369ad..0b719e3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,5 @@ +v1.0.222: Added Keyboard shortcuts for GotoZero, and switching between Incremental/Continuous jogging +v1.0.221: Corrected product names for XYZ Probe Plus v1.0.220: New XYZ and Custom Probe wizards, new Probe Button on Main toolbar, fixed File Assocation Opening (Bug #119 ), added loaded Filename to titlebar (Issue #116), changed Keybinding for Devtools to ctrl+shift+i, added shortcut key F6 to jump to console (Issue #112) v1.0.216-219: Internal Testing versions only v1.0.215: Fixed bug with Z Plate retract where plate is thicker than 10mm diff --git a/app/js/keyboard.js b/app/js/keyboard.js index bc58a36..16b5169 100644 --- a/app/js/keyboard.js +++ b/app/js/keyboard.js @@ -35,9 +35,20 @@ $(document).ready(function() { if (localStorage.getItem('keyboardShortcuts')) { keyboardShortcuts = JSON.parse(localStorage.getItem('keyboardShortcuts')); + // fix incorrect key naming bug from an old version if (keyboardShortcuts.xP == "arrowright") { keyboardShortcuts.xP == "right" } + // add new key defaults to existing allocations + if (!keyboardShortcuts.incJogMode) { + keyboardShortcuts.incJogMode = "/" + } + if (!keyboardShortcuts.conJogMode) { + keyboardShortcuts.conJogMode = "*" + } + if (!keyboardShortcuts.gotozeroxyz) { + keyboardShortcuts.gotozeroxyz = "del" + } } else { keyboardShortcuts = { xP: "right", //X+ @@ -52,7 +63,10 @@ $(document).ready(function() { playpause: "space", // Start, Pause, Resume unlockAlarm: "end", // Clear Alarm home: "home", // Home All - setzeroxyz: "insert" // Set ZERO XYZ + setzeroxyz: "insert", // Set ZERO XYZ + gotozeroxyz: "del", // go to zero xyz + incJogMode: "/", // Incremental Jog Mode + conJogMode: "*" // Continuous Jog Mode } } bindKeys() @@ -281,11 +295,17 @@ function bindKeys() { } if (keyboardShortcuts.stepM.length) { $(document).bind('keydown', keyboardShortcuts.stepM, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); changeStepSize(-1) }); } if (keyboardShortcuts.stepP.length) { $(document).bind('keydown', keyboardShortcuts.stepP, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); changeStepSize(1) }); } @@ -326,6 +346,31 @@ function bindKeys() { }); } + if (keyboardShortcuts.gotozeroxyz.length) { + $(document).bind('keydown', keyboardShortcuts.gotozeroxyz, function(e) { + sendGcode('G21 G90'); + sendGcode('G0 Z5'); + sendGcode('G0 X0 Y0'); + sendGcode('G0 Z0'); + }); + } + + if (keyboardShortcuts.incJogMode.length) { + $(document).bind('keydown', keyboardShortcuts.incJogMode, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); + }); + } + + if (keyboardShortcuts.conJogMode.length) { + $(document).bind('keydown', keyboardShortcuts.conJogMode, function(e) { + $('#jogTypeContinuous').prop('checked', true) + allowContinuousJog = true; + $('.distbtn').hide() + }); + } + localStorage.setItem('keyboardShortcuts', JSON.stringify(keyboardShortcuts)); } @@ -357,6 +402,12 @@ function keyboardShortcutsEditor() { +
+ +
+ +
+
@@ -418,6 +469,20 @@ function keyboardShortcutsEditor() {
+
+ +
+ +
+
+
+ +
+ +
+
+ + ` @@ -445,6 +510,9 @@ function keyboardShortcutsEditor() { keyboardShortcuts.unlockAlarm = $('#unlocknewKey').val() keyboardShortcuts.home = $('#homenewKey').val() keyboardShortcuts.setzeroxyz = $('#setzeroxyznewKey').val() + keyboardShortcuts.incJogMode = $("#incJogModeKey").val() + keyboardShortcuts.conJogMode = $("#conJogModeKey").val() + keyboardShortcuts.gotozeroxyz = $("#gotozeroxyznewKey").val() bindKeys() } }, diff --git a/package.json b/package.json index f19fae4..534ea10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "OpenBuildsCONTROL", - "version": "1.0.221", + "version": "1.0.222", "license": "AGPL-3.0", "description": "OpenBuildsCONTROL CNC Machine Interface Software", "author": "github.com/openbuilds ",