From c58169fc8aef575f9aa7f12d342bb4474633d99f Mon Sep 17 00:00:00 2001
From: openbuilds-engineer
Date: Sat, 7 Nov 2020 00:09:08 +0200
Subject: [PATCH] 1.0.254
---
CHANGELOG.txt | 1 +
app/js/jog.js | 91 ++++++++++-----------------------------------
app/js/websocket.js | 2 +
index.js | 4 +-
package.json | 2 +-
5 files changed, 25 insertions(+), 75 deletions(-)
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index c497047..ae73ede 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,4 @@
+v1.0.254: Fixed Continous Jog calculation bug
v1.0.253: Fix 3D Viewer Bug with Fusion outputs #157
v1.0.252: Fix for hold:0 status on jog with soft-limits
v1.0.251: Updated LEAD1515 Profile, Improved Stop button, Fixed Custom Z Plate thickness Bug
diff --git a/app/js/jog.js b/app/js/jog.js
index aea09b7..f060ff5 100644
--- a/app/js/jog.js
+++ b/app/js/jog.js
@@ -3,7 +3,6 @@ var continuousJogRunning = false;
var jogdist = 10;
var safeToUpdateSliders = true;
-
function mmtoinchrate() {
var value = $('#jograte').val();
var convert = "";
@@ -358,69 +357,11 @@ $(document).ready(function() {
});
- // $('.xM').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('X', '-' + jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
- //
- // $('.xP').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('X', jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
- //
- // $('.yM').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('Y', '-' + jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
- //
- // $('.yP').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('Y', jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
- //
- // $('.zM').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('Z', '-' + jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
- //
- // $('.zP').on('click', function(ev) {
- // if (!allowContinuousJog) {
- // var dir = 'X-';
- // var feedrate = $('#jograte').val();
- // jog('Z', jogdist, feedrate);
- // }
- // $('#runNewProbeBtn').addClass("disabled")
- // $('#confirmNewProbeBtn').removeClass("disabled")
- // })
+
$('.xM').on('touchstart mousedown', function(ev) {
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "X-";
var distance = 1000;
@@ -430,12 +371,13 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$130)
var maxdistance = 0; // Grbl all negative coordinates
// Negative move:
- distance = (mindistance + (parseInt(laststatus.machine.position.offset.x) + parseInt(laststatus.machine.position.work.x))) - 1
+ distance = (mindistance + (parseFloat(laststatus.machine.position.offset.x) + parseFloat(laststatus.machine.position.work.x))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('.xM').click();
} else {
var feedrate = $('#jograte').val();
@@ -454,7 +396,7 @@ $(document).ready(function() {
$('.xP').on('touchstart mousedown', function(ev) {
// console.log("xp down")
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "X";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
@@ -463,12 +405,13 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$130)
var maxdistance = 0; // Grbl all negative coordinates
// Positive move:
- distance = (maxdistance - (parseInt(laststatus.machine.position.offset.x) + parseInt(laststatus.machine.position.work.x))) - 1
+ distance = (maxdistance - (parseFloat(laststatus.machine.position.offset.x) + parseFloat(laststatus.machine.position.work.x))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('.xP').click();
} else {
var feedrate = $('#jograte').val();
@@ -487,7 +430,7 @@ $(document).ready(function() {
$('.yM').on('touchstart mousedown', function(ev) {
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "Y-";
var distance = 1000;
@@ -497,13 +440,14 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$131)
var maxdistance = 0; // Grbl all negative coordinates
// Negative move:
- distance = (mindistance + (parseInt(laststatus.machine.position.offset.y) + parseInt(laststatus.machine.position.work.y))) - 1
+ distance = (mindistance + (parseFloat(laststatus.machine.position.offset.y) + parseFloat(laststatus.machine.position.work.y))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('.yM').click();
} else {
var feedrate = $('#jograte').val();
@@ -521,7 +465,7 @@ $(document).ready(function() {
$('.yP').on('touchstart mousedown', function(ev) {
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "Y";
var distance = 1000;
@@ -531,13 +475,14 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$131)
var maxdistance = 0; // Grbl all negative coordinates
// Positive move:
- distance = (maxdistance - (parseInt(laststatus.machine.position.offset.y) + parseInt(laststatus.machine.position.work.y))) - 1
+ distance = (maxdistance - (parseFloat(laststatus.machine.position.offset.y) + parseFloat(laststatus.machine.position.work.y))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('#yP').click();
} else {
var feedrate = $('#jograte').val();
@@ -555,7 +500,7 @@ $(document).ready(function() {
$('.zM').on('touchstart mousedown', function(ev) {
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "Z-";
var distance = 1000;
@@ -565,13 +510,14 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$132)
var maxdistance = 0; // Grbl all negative coordinates
// Negative move:
- distance = (mindistance + (parseInt(laststatus.machine.position.offset.z) + parseInt(laststatus.machine.position.work.z))) - 1
+ distance = (mindistance + (parseFloat(laststatus.machine.position.offset.z) + parseFloat(laststatus.machine.position.work.z))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('.zM').click();
} else {
var feedrate = $('#jograte').val();
@@ -589,7 +535,7 @@ $(document).ready(function() {
$('.zP').on('touchstart mousedown', function(ev) {
ev.preventDefault();
- if (allowContinuousJog) { // startJog();
+ if (allowContinuousJog && !waitingForStatus && laststatus.comms.runStatus == "Idle") { // startJog();
var direction = "Z";
var distance = 1000;
@@ -599,13 +545,14 @@ $(document).ready(function() {
var mindistance = parseInt(grblParams.$132)
var maxdistance = 0; // Grbl all negative coordinates
// Positive move:
- distance = (maxdistance - (parseInt(laststatus.machine.position.offset.z) + parseInt(laststatus.machine.position.work.z))) - 1
+ distance = (maxdistance - (parseFloat(laststatus.machine.position.offset.z) + parseFloat(laststatus.machine.position.work.z))) - 5
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
+ waitingForStatus = true;
$('.zP').click();
} else {
var feedrate = $('#jograte').val();
diff --git a/app/js/websocket.js b/app/js/websocket.js
index 820a45a..82d0e98 100644
--- a/app/js/websocket.js
+++ b/app/js/websocket.js
@@ -10,6 +10,7 @@ var simstopped = false;
var bellstate = false;
var toast = Metro.toast.create;
var unit = "mm"
+var waitingForStatus = false;
$(document).ready(function() {
initSocket();
@@ -493,6 +494,7 @@ function initSocket() {
}
laststatus = status;
+ waitingForStatus = false;
});
socket.on('features', function(data) {
diff --git a/index.js b/index.js
index 275d11c..d0bef8b 100644
--- a/index.js
+++ b/index.js
@@ -578,7 +578,7 @@ io.on("connection", function(socket) {
// jogWindow.setOverlayIcon(nativeImage.createFromPath(iconAlarm), 'Alarm');
// }
// }
- }, 400);
+ }, 100);
@@ -979,7 +979,7 @@ io.on("connection", function(socket) {
if (status.comms.connectionStatus > 0) {
addQRealtime("?");
}
- }, 250);
+ }, 100);
} else if (data.indexOf("LPC176") >= 0) { // LPC1768 or LPC1769 should be Smoothieware
status.comms.blocked = false;
debug_log("Smoothieware detected");
diff --git a/package.json b/package.json
index df73d4e..70f525d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "OpenBuildsCONTROL",
- "version": "1.0.253",
+ "version": "1.0.254",
"license": "AGPL-3.0",
"description": "OpenBuildsCONTROL CNC Machine Interface Software",
"author": "github.com/openbuilds ",