Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up number pad functions and behavior #7

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified index.html.gz
Binary file not shown.
13 changes: 9 additions & 4 deletions www/js/numpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ var numpad = {
for (var i=7; i<=9; i++) { buttonator(i, "num", numpad.digit); }
buttonator("&#10502;", "del", numpad.delete);
spacer();
buttonator("Goto", "goto", numpad.gotoCoordinate);
//buttonator("Goto", "goto", numpad.gotoCoordinate); //This is a nice feature, but it uses gcode instead of jog which is triggering errors
buttonator("", "num", numpad.doNothing);

// 4 5 6 C _ _
for (var i=4; i<=6; i++) { buttonator(i, "num", numpad.digit); }
Expand All @@ -62,13 +63,14 @@ var numpad = {

// 1 2 3 +- Set
for (var i=1; i<=3; i++) { buttonator(i, "num", numpad.digit); }
buttonator("+-", "num", numpad.toggleSign);
buttonator("", "num", (numpad.doNothing));
//buttonator("+-", "num", numpad.toggleSign);
buttonator("Set", "set", numpad.setCoordinate);

// 0 . Get Cancel
buttonator(0, "zero", numpad.digit);
buttonator(".", "dot", numpad.dot);
buttonator("Get", "get", numpad.recall);
buttonator("", "get", numpad.doNothing);
buttonator("Cancel", "cxwide", numpad.hide);


Expand Down Expand Up @@ -149,6 +151,9 @@ var numpad = {
numpad.hdisplay.value = -numpad.hdisplay.value;
},

// Do nothing function
doNothing: function(){},


// ADD DECIMAL POINT
dot: function(){
Expand Down Expand Up @@ -178,7 +183,7 @@ var numpad = {

setCoordinate: function(){
numpad.nowTarget.textContent = numpad.hdisplay.value;
setAxisByValue(numpad.nowTarget.dataset.axis, numpad.hdisplay.value);
//setAxisByValue(numpad.nowTarget.dataset.axis, numpad.hdisplay.value);
numpad.hide();
},

Expand Down
2 changes: 1 addition & 1 deletion www/js/tablet.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function tabletClick() {
if (window.navigator && window.navigator.vibrate) {
window.navigator.vibrate(200)
}
beep(3, 400, 10)
// beep(3, 400, 10)
}

sendCommand = function (cmd) {
Expand Down