kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
Update
rodzic
9f714a6608
commit
7b8615d2d9
|
@ -199,7 +199,29 @@ function grblSaveSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
grblParams = {};
|
grblParams = {};
|
||||||
refreshGrblSettings();
|
|
||||||
|
Metro.dialog.create({
|
||||||
|
title: "Configuration Updated. Reset Grbl?",
|
||||||
|
content: "<div>Some changes in the Grbl Configuration only take effect after a restart/reset of the controller. Would you like to Reset the controller now?</div>",
|
||||||
|
actions: [{
|
||||||
|
caption: "Yes",
|
||||||
|
cls: "js-dialog-close secondary",
|
||||||
|
onclick: function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
sendGcode(String.fromCharCode(0x18));
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: "Later",
|
||||||
|
cls: "js-dialog-close",
|
||||||
|
onclick: function() {
|
||||||
|
console.log("Do nothing")
|
||||||
|
refreshGrblSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
$('#grblSettingsBadge').hide();
|
$('#grblSettingsBadge').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,6 +234,6 @@ function refreshGrblSettings() {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
grblPopulate();
|
grblPopulate();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}, 200);
|
}, 50);
|
||||||
|
|
||||||
}
|
}
|
15
app/js/ui.js
15
app/js/ui.js
|
@ -128,30 +128,45 @@ function setJogPanel(val, status) {
|
||||||
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
|
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
|
||||||
editor.resize()
|
editor.resize()
|
||||||
$('.jogbtn').attr('disabled', true);
|
$('.jogbtn').attr('disabled', true);
|
||||||
|
if ($('#jograte').attr('disabled')) {
|
||||||
|
$('#jograte').attr('disabled', false);
|
||||||
|
}
|
||||||
} else if (val == 0 || val == 2) { // Connected, but not Playing yet
|
} else if (val == 0 || val == 2) { // Connected, but not Playing yet
|
||||||
// Show panel and resize editor
|
// Show panel and resize editor
|
||||||
$("#jogcontrols").slideDown("fast");
|
$("#jogcontrols").slideDown("fast");
|
||||||
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
||||||
editor.resize()
|
editor.resize()
|
||||||
$('.jogbtn').attr('disabled', false);
|
$('.jogbtn').attr('disabled', false);
|
||||||
|
if ($('#jograte').attr('disabled')) {
|
||||||
|
$('#jograte').attr('disabled', false);
|
||||||
|
}
|
||||||
} else if (val == 3) { // Busy Streaming GCODE
|
} else if (val == 3) { // Busy Streaming GCODE
|
||||||
// Show panel and resize editor
|
// Show panel and resize editor
|
||||||
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
||||||
editor.resize()
|
editor.resize()
|
||||||
$("#jogcontrols").slideDown("fast");
|
$("#jogcontrols").slideDown("fast");
|
||||||
$('.jogbtn').attr('disabled', true);
|
$('.jogbtn').attr('disabled', true);
|
||||||
|
if (!$('#jograte').attr('disabled')) {
|
||||||
|
$('#jograte').attr('disabled', true);
|
||||||
|
}
|
||||||
} else if (val == 4) { // Paused
|
} else if (val == 4) { // Paused
|
||||||
// Show panel and resize editor
|
// Show panel and resize editor
|
||||||
$("#jogcontrols").slideDown("fast");
|
$("#jogcontrols").slideDown("fast");
|
||||||
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 405 + 'px)');
|
||||||
editor.resize()
|
editor.resize()
|
||||||
$('.jogbtn').attr('disabled', true);
|
$('.jogbtn').attr('disabled', true);
|
||||||
|
if (!$('#jograte').attr('disabled')) {
|
||||||
|
$('#jograte').attr('disabled', true);
|
||||||
|
}
|
||||||
} else if (val == 5) { // Alarm State
|
} else if (val == 5) { // Alarm State
|
||||||
// Show panel and resize editor
|
// Show panel and resize editor
|
||||||
$("#jogcontrols").slideUp("fast");
|
$("#jogcontrols").slideUp("fast");
|
||||||
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
|
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
|
||||||
editor.resize()
|
editor.resize()
|
||||||
$('.jogbtn').attr('disabled', true);
|
$('.jogbtn').attr('disabled', true);
|
||||||
|
if (!$('#jograte').attr('disabled')) {
|
||||||
|
$('#jograte').attr('disabled', true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@ function initSocket() {
|
||||||
|
|
||||||
socket.on('data', function(data) {
|
socket.on('data', function(data) {
|
||||||
// console.log(data.length, data)
|
// console.log(data.length, data)
|
||||||
var toPrint = data;
|
var toPrint = data.response;
|
||||||
if (data.indexOf("Done saving file.") != -1) {
|
if (data.response.indexOf("Done saving file.") != -1) {
|
||||||
$('#sdupload_modal').modal('hide');
|
$('#sdupload_modal').modal('hide');
|
||||||
$("#sduploadform").show()
|
$("#sduploadform").show()
|
||||||
$("#sduploadprogress").hide()
|
$("#sduploadprogress").hide()
|
||||||
|
@ -72,7 +72,7 @@ function initSocket() {
|
||||||
$("#sdmodalclosebtn").prop('disabled', false);
|
$("#sdmodalclosebtn").prop('disabled', false);
|
||||||
$('#sdprogressup').css('width', '0%').attr('aria-valuenow', 0);
|
$('#sdprogressup').css('width', '0%').attr('aria-valuenow', 0);
|
||||||
}
|
}
|
||||||
if (data.indexOf("End file list") != -1) {
|
if (data.response.indexOf("End file list") != -1) {
|
||||||
// We just got an M20 sd listing back... lets update UI
|
// We just got an M20 sd listing back... lets update UI
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
sdListPopulate();
|
sdListPopulate();
|
||||||
|
@ -80,13 +80,13 @@ function initSocket() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse Grbl Settings Feedback
|
// Parse Grbl Settings Feedback
|
||||||
if (data.indexOf('$') === 0) {
|
if (data.response.indexOf('$') === 0) {
|
||||||
grblSettings(data)
|
grblSettings(data.response)
|
||||||
var key = data.split('=')[0].substr(1);
|
var key = data.response.split('=')[0].substr(1);
|
||||||
var descr = grblSettingCodes[key];
|
var descr = grblSettingCodes[key];
|
||||||
toPrint = data + " ;" + descr
|
toPrint = data.response + " ;" + descr
|
||||||
};
|
};
|
||||||
printLog(toPrint)
|
printLog("<span class='fg-red'>[ " + data.command + " ]</span> <span class='fg-green'>" + toPrint + "</span>")
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
17
index.js
17
index.js
|
@ -511,7 +511,8 @@ io.on("connection", function(socket) {
|
||||||
}); // end port.onclose
|
}); // end port.onclose
|
||||||
|
|
||||||
port.on("data", function(data) {
|
port.on("data", function(data) {
|
||||||
// console.log("DATA RECV: " + data.replace(/(\r\n|\n|\r)/gm,""));
|
// console.log("DATA RECV: " + data.replace(/(\r\n|\n|\r)/gm, ""));
|
||||||
|
// console.log()
|
||||||
|
|
||||||
// Command Tracking
|
// Command Tracking
|
||||||
if (lastGcode.length == 0) {
|
if (lastGcode.length == 0) {
|
||||||
|
@ -529,13 +530,17 @@ io.on("connection", function(socket) {
|
||||||
command = command.replace(/(\r\n|\n|\r)/gm, "");
|
command = command.replace(/(\r\n|\n|\r)/gm, "");
|
||||||
|
|
||||||
if (command != "?" && command != "M105" && data.length > 0) {
|
if (command != "?" && command != "M105" && data.length > 0) {
|
||||||
// if (command != "?" && command != "M105" && command.indexOf("M911") == -1 ) {
|
|
||||||
var string = "";
|
var string = "";
|
||||||
if (status.comms.sduploading) {
|
if (status.comms.sduploading) {
|
||||||
string += "SD: "
|
string += "SD: "
|
||||||
}
|
}
|
||||||
string += data //+ " [ " + command + " ]"
|
string += data //+ " [ " + command + " ]"
|
||||||
io.sockets.emit('data', string);
|
var output = {
|
||||||
|
'command': command,
|
||||||
|
'response': string
|
||||||
|
}
|
||||||
|
|
||||||
|
io.sockets.emit('data', output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Machine Identification
|
// Machine Identification
|
||||||
|
@ -554,11 +559,11 @@ io.on("connection", function(socket) {
|
||||||
// Start interval for status queries
|
// Start interval for status queries
|
||||||
statusLoop = setInterval(function() {
|
statusLoop = setInterval(function() {
|
||||||
if (status.comms.connectionStatus > 0) {
|
if (status.comms.connectionStatus > 0) {
|
||||||
if (!status.comms.sduploading) {
|
if (!status.comms.sduploading && !status.comms.blocked) {
|
||||||
machineSend("?");
|
machineSend("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 200);
|
}, 1000);
|
||||||
} else if (data.indexOf("LPC176") >= 0) { // LPC1768 or LPC1769 should be Smoothieware
|
} else if (data.indexOf("LPC176") >= 0) { // LPC1768 or LPC1769 should be Smoothieware
|
||||||
status.comms.blocked = false;
|
status.comms.blocked = false;
|
||||||
console.log("Smoothieware detected");
|
console.log("Smoothieware detected");
|
||||||
|
@ -1342,6 +1347,7 @@ io.on("connection", function(socket) {
|
||||||
queuePointer = 0;
|
queuePointer = 0;
|
||||||
gcodeQueue.length = 0; // Dump the queue
|
gcodeQueue.length = 0; // Dump the queue
|
||||||
grblBufferSize.length = 0; // Dump bufferSizes
|
grblBufferSize.length = 0; // Dump bufferSizes
|
||||||
|
lastGcode.length = 0 // Dump Last Command Queue
|
||||||
queueLen = 0;
|
queueLen = 0;
|
||||||
queuePos = 0;
|
queuePos = 0;
|
||||||
laserTestOn = false;
|
laserTestOn = false;
|
||||||
|
@ -1386,6 +1392,7 @@ io.on("connection", function(socket) {
|
||||||
console.log('Emptying Queue');
|
console.log('Emptying Queue');
|
||||||
gcodeQueue.length = 0; // Dump the queue
|
gcodeQueue.length = 0; // Dump the queue
|
||||||
grblBufferSize.length = 0; // Dump bufferSizes
|
grblBufferSize.length = 0; // Dump bufferSizes
|
||||||
|
lastGcode.length = 0 // Dump Last Command Queue
|
||||||
queueLen = 0;
|
queueLen = 0;
|
||||||
queuePointer = 0;
|
queuePointer = 0;
|
||||||
queuePos = 0;
|
queuePos = 0;
|
||||||
|
|
Ładowanie…
Reference in New Issue