kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
Save machine profile to
rodzic
a8eec0a1b1
commit
85d4ecc76d
|
@ -652,6 +652,7 @@ function selectMachine(type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
lastSelectedMachine = type;
|
lastSelectedMachine = type;
|
||||||
|
sendGcode('$I=' + lastSelectedMachine)
|
||||||
checkifchanged()
|
checkifchanged()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,10 @@ function grblPopulate() {
|
||||||
} else {
|
} else {
|
||||||
$('#limitsinstalled:checkbox').prop('checked', false);
|
$('#limitsinstalled:checkbox').prop('checked', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
setMachineButton(laststatus.machine.name)
|
||||||
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkifchanged() {
|
function checkifchanged() {
|
||||||
|
@ -332,6 +336,7 @@ function refreshGrblSettings() {
|
||||||
$('#grblconfig').append("<center>Please Wait... </center><br><center>Requesting updated parameters from the controller firmware...</center>");
|
$('#grblconfig').append("<center>Please Wait... </center><br><center>Requesting updated parameters from the controller firmware...</center>");
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
sendGcode('$$');
|
sendGcode('$$');
|
||||||
|
sendGcode('$I');
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
grblPopulate();
|
grblPopulate();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -125,7 +125,7 @@ function initSocket() {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', function(data) {
|
socket.on('data', function(data) {
|
||||||
console.log(data)
|
// console.log(data)
|
||||||
var toPrint = escapeHTML(data.response);
|
var toPrint = escapeHTML(data.response);
|
||||||
|
|
||||||
// Parse Grbl Settings Feedback
|
// Parse Grbl Settings Feedback
|
||||||
|
@ -150,6 +150,7 @@ function initSocket() {
|
||||||
function showGrbl(bool) {
|
function showGrbl(bool) {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
sendGcode('$$')
|
sendGcode('$$')
|
||||||
|
sendGcode('$I')
|
||||||
$("#grblButtons").show()
|
$("#grblButtons").show()
|
||||||
$("#firmwarename").html('Grbl')
|
$("#firmwarename").html('Grbl')
|
||||||
} else {
|
} else {
|
||||||
|
@ -362,11 +363,11 @@ function initSocket() {
|
||||||
$('#commstatus').html(string);
|
$('#commstatus').html(string);
|
||||||
$('#runstatus').html(status.comms.runStatus);
|
$('#runstatus').html(status.comms.runStatus);
|
||||||
$('#drvqueue').html(status.comms.queue);
|
$('#drvqueue').html(status.comms.queue);
|
||||||
if (status.machine.firmware.buffer.length > 0) {
|
// if (status.machine.firmware.buffer.length > 0) {
|
||||||
$('#buffstatus').html(status.machine.firmware.buffer[0] + " blocks / " + status.machine.firmware.buffer[1] + " bytes");
|
// $('#buffstatus').html(status.machine.firmware.buffer[0] + " blocks / " + status.machine.firmware.buffer[1] + " bytes");
|
||||||
} else {
|
// } else {
|
||||||
$('#buffstatus').html("NOCOMM");
|
// $('#buffstatus').html("NOCOMM");
|
||||||
}
|
// }
|
||||||
|
|
||||||
// if (status.machine.firmware.state) {
|
// if (status.machine.firmware.state) {
|
||||||
// if (status.machine.firmware.state.workoffset.length) {
|
// if (status.machine.firmware.state.workoffset.length) {
|
||||||
|
@ -406,11 +407,11 @@ function initSocket() {
|
||||||
// $('#units').html("NOCOMM");
|
// $('#units').html("NOCOMM");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if (status.comms.interfaces.activePort) {
|
if (status.comms.interfaces.activePort) {
|
||||||
// $('#activeportstatus').html(status.comms.interfaces.activePort)
|
$('#activeportstatus').html(status.comms.interfaces.activePort)
|
||||||
// } else {
|
} else {
|
||||||
// $('#activeportstatus').html("none")
|
$('#activeportstatus').html("none")
|
||||||
// }
|
}
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -493,7 +494,10 @@ function populatePortsMenu() {
|
||||||
response += `</optgroup></select>`
|
response += `</optgroup></select>`
|
||||||
var select = $("#portUSB").data("select");
|
var select = $("#portUSB").data("select");
|
||||||
select.data(response);
|
select.data(response);
|
||||||
|
var select2 = $("#portUSB2").data("select");
|
||||||
|
select2.data(response);
|
||||||
$('#portUSB').parent(".select").removeClass('disabled')
|
$('#portUSB').parent(".select").removeClass('disabled')
|
||||||
|
$('#portUSB2').parent(".select").removeClass('disabled')
|
||||||
$("#connectBtn").attr('disabled', false);
|
$("#connectBtn").attr('disabled', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
11
index.js
11
index.js
|
@ -1,3 +1,5 @@
|
||||||
|
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = '1';
|
||||||
|
|
||||||
console.log("Starting OpenBuilds CONTROL v" + require('./package').version)
|
console.log("Starting OpenBuilds CONTROL v" + require('./package').version)
|
||||||
|
|
||||||
var config = {};
|
var config = {};
|
||||||
|
@ -247,6 +249,7 @@ var status = {
|
||||||
ipaddress: ip.address(),
|
ipaddress: ip.address(),
|
||||||
},
|
},
|
||||||
machine: {
|
machine: {
|
||||||
|
name: '',
|
||||||
inputs: [],
|
inputs: [],
|
||||||
tools: {
|
tools: {
|
||||||
hotend1: false,
|
hotend1: false,
|
||||||
|
@ -810,6 +813,14 @@ io.on("connection", function(socket) {
|
||||||
port.on("data", function(data) {
|
port.on("data", function(data) {
|
||||||
var command = sentBuffer[0];
|
var command = sentBuffer[0];
|
||||||
|
|
||||||
|
// Grbl $I parser
|
||||||
|
|
||||||
|
if (data.indexOf("[VER:") === 0) {
|
||||||
|
status.machine.name = data.split(':')[2].split(']')[0].toLowerCase()
|
||||||
|
io.sockets.emit("status", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Machine Identification
|
// Machine Identification
|
||||||
if (data.indexOf("Grbl") === 0) { // Check if it's Grbl
|
if (data.indexOf("Grbl") === 0) { // Check if it's Grbl
|
||||||
status.comms.blocked = false;
|
status.comms.blocked = false;
|
||||||
|
|
Ładowanie…
Reference in New Issue