pull/153/head
openbuilds-engineer 2020-04-19 18:23:18 +02:00
rodzic 7b15f79600
commit 432c6201c5
4 zmienionych plików z 42 dodań i 159 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
v1.0.231: Fix bug in Keyboard Jog
v1.0.233: Cleanup code
v1.0.232: Fix bug in Keyboard Jog
v1.0.231: Fix bug in Keyboard Shortcut editor
v1.0.230: Updated Macros Editor with support for JS macros, new Icon selector, etc
v1.0.229: XYZ Probe Routine: Change Z level from absolute to relative, Enable homing button in Alarms state (to allow homing if alarm = position lost), added Backup Grbl Settings button

Wyświetl plik

@ -1210,13 +1210,13 @@
<div class="dialog dark" id="downloadUpdate" data-role="dialog" data-overlay-click-close="true" data-to-top="true">
<div class="dialog-title">Update Ready</div>
<div class="dialog-content">
Version <code><span id="availVersion">1.0.100</span></code> update ready to be installed!<br> Note that proceeding will:
Updated version <code><span id="availVersion">1.0.100</span></code> has finished downloading and is ready to be installed!<br> Note that proceeding will:
<ul>
<li>Stops any running jobs</li>
<li>Shuts down this instance of OpenBuilds CONTROL</li>
<li>Launches the installer for the new version</li>
<li>Stop any running jobs</li>
<li>Shut down this instance of OpenBuilds CONTROL</li>
<li>Launch the installer for the new version</li>
</ul>
<small>You may want to wait until your machine is idle before continuing</small>
<small>You may want to wait until your machine is idle, and it it's a convenient time for you to do this, before continuing</small>
<small id="changelogupdate"></small>
</div>
<div class="dialog-actions">

Wyświetl plik

@ -86,12 +86,15 @@ function bindKeys() {
newVal += 'shift+'
}
newVal += e.key
newVal = newVal.toLowerCase();
var macro = searchMacro("macrokeyboardshortcut", newVal, buttonsarray)
console.log(macro)
if (macro.codetype == "gcode") {
if (macro && macro.codetype == "gcode") {
sendGcode(macro.gcode); // TODO change to runMacro with JS
} else if (macro.codetype == "javascript") {
} else if (macro && macro.codetype == "javascript") {
executeJS(macro.javascript)
} else {
printLog("Macro not found for " + newVal)
}
});
}
@ -99,216 +102,93 @@ function bindKeys() {
}
// Bind for Jog and Control Buttons
// JOG KEYS
if (keyboardShortcuts) {
if (keyboardShortcuts.xM.length) {
$(document).bind('keydown', keyboardShortcuts.xM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "X-";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#xM').click();
rippleEffect($('#xMprobe'), "#e21b1b")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#xMprobe'), "#e21b1b")
$('#xM').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.xM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#xM').mouseup();
});
}
if (keyboardShortcuts.xP.length) {
$(document).bind('keydown', keyboardShortcuts.xP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "X";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#xP').click();
rippleEffect($('#xPprobe'), "#e21b1b")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#xPprobe'), "#e21b1b")
$('#xP').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.xP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#xP').mouseup();
});
}
if (keyboardShortcuts.yM.length) {
$(document).bind('keydown', keyboardShortcuts.yM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "Y-";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#yM').click();
rippleEffect($('#yMprobe'), "#5de21b")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#yMprobe'), "#5de21b")
$('#yM').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.yM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#yM').mouseup();
});
}
if (keyboardShortcuts.yP.length) {
$(document).bind('keydown', keyboardShortcuts.yP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "Y";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#yP').click();
rippleEffect($('#yPprobe'), "#5de21b")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#yPprobe'), "#5de21b")
$('#yP').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.yP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#yP').mouseup();
});
}
if (keyboardShortcuts.zM.length) {
$(document).bind('keydown', keyboardShortcuts.zM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "Z-";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#zM').click();
rippleEffect($('#zMprobe'), "#1ba1e2")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#zMprobe'), "#1ba1e2")
$('#zM').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.zM, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#zM').mouseup();
});
}
if (keyboardShortcuts.zP.length) {
$(document).bind('keydown', keyboardShortcuts.zP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
if (!event.originalEvent.repeat) {
var direction = "Z";
var distance = 1000;
if (Object.keys(grblParams).length > 0) {
if (parseInt(grblParams.$20) == 1) {
// Soft Limits is enabled so lets calculate maximum move distance
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
}
}
var feed = $('#jograte').val();
socket.emit('runCommand', "$J=G91 G21 " + direction + distance + " F" + feed + "\n");
continuousJogRunning = true;
$('#zP').click();
rippleEffect($('#zPprobe'), "#1ba1e2")
}
} else {
if (!event.originalEvent.repeat) {
rippleEffect($('#zPprobe'), "#1ba1e2")
$('#zP').mousedown();
}
});
$(document).bind('keyup', keyboardShortcuts.zP, function(event) {
event.preventDefault();
if (allowContinuousJog) {
cancelJog()
}
$('#zP').mouseup();
});
}
// END JOG KEYS
if (keyboardShortcuts.stepM.length) {
$(document).bind('keydown', keyboardShortcuts.stepM, function(e) {
e.preventDefault();

Wyświetl plik

@ -42,8 +42,10 @@ function getChangelog() {
}
template2 += `</ul>`
$("#changelog").html(template2);
var template3 = `Changelog: <hr> <ul>`
for (var line = 0; line < 3; line++) {
// Update Dialog
var template3 = `<h6>Changelog:</h6> <hr> <ul>`
for (var line = 0; line < 5; line++) {
template3 += '<li>' + lines[line] + '</li>'
}
template3 += `</ul>`