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;
|
||||
sendGcode('$I=' + lastSelectedMachine)
|
||||
checkifchanged()
|
||||
};
|
||||
|
||||
|
|
|
@ -249,6 +249,10 @@ function grblPopulate() {
|
|||
} else {
|
||||
$('#limitsinstalled:checkbox').prop('checked', false);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
setMachineButton(laststatus.machine.name)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function checkifchanged() {
|
||||
|
@ -332,6 +336,7 @@ function refreshGrblSettings() {
|
|||
$('#grblconfig').append("<center>Please Wait... </center><br><center>Requesting updated parameters from the controller firmware...</center>");
|
||||
setTimeout(function() {
|
||||
sendGcode('$$');
|
||||
sendGcode('$I');
|
||||
setTimeout(function() {
|
||||
grblPopulate();
|
||||
}, 500);
|
||||
|
|
|
@ -125,7 +125,7 @@ function initSocket() {
|
|||
});
|
||||
|
||||
socket.on('data', function(data) {
|
||||
console.log(data)
|
||||
// console.log(data)
|
||||
var toPrint = escapeHTML(data.response);
|
||||
|
||||
// Parse Grbl Settings Feedback
|
||||
|
@ -150,6 +150,7 @@ function initSocket() {
|
|||
function showGrbl(bool) {
|
||||
if (bool) {
|
||||
sendGcode('$$')
|
||||
sendGcode('$I')
|
||||
$("#grblButtons").show()
|
||||
$("#firmwarename").html('Grbl')
|
||||
} else {
|
||||
|
@ -362,11 +363,11 @@ function initSocket() {
|
|||
$('#commstatus').html(string);
|
||||
$('#runstatus').html(status.comms.runStatus);
|
||||
$('#drvqueue').html(status.comms.queue);
|
||||
if (status.machine.firmware.buffer.length > 0) {
|
||||
$('#buffstatus').html(status.machine.firmware.buffer[0] + " blocks / " + status.machine.firmware.buffer[1] + " bytes");
|
||||
} else {
|
||||
$('#buffstatus').html("NOCOMM");
|
||||
}
|
||||
// if (status.machine.firmware.buffer.length > 0) {
|
||||
// $('#buffstatus').html(status.machine.firmware.buffer[0] + " blocks / " + status.machine.firmware.buffer[1] + " bytes");
|
||||
// } else {
|
||||
// $('#buffstatus').html("NOCOMM");
|
||||
// }
|
||||
|
||||
// if (status.machine.firmware.state) {
|
||||
// if (status.machine.firmware.state.workoffset.length) {
|
||||
|
@ -406,11 +407,11 @@ function initSocket() {
|
|||
// $('#units').html("NOCOMM");
|
||||
// }
|
||||
//
|
||||
// if (status.comms.interfaces.activePort) {
|
||||
// $('#activeportstatus').html(status.comms.interfaces.activePort)
|
||||
// } else {
|
||||
// $('#activeportstatus').html("none")
|
||||
// }
|
||||
if (status.comms.interfaces.activePort) {
|
||||
$('#activeportstatus').html(status.comms.interfaces.activePort)
|
||||
} else {
|
||||
$('#activeportstatus').html("none")
|
||||
}
|
||||
//
|
||||
// }
|
||||
|
||||
|
@ -493,7 +494,10 @@ function populatePortsMenu() {
|
|||
response += `</optgroup></select>`
|
||||
var select = $("#portUSB").data("select");
|
||||
select.data(response);
|
||||
var select2 = $("#portUSB2").data("select");
|
||||
select2.data(response);
|
||||
$('#portUSB').parent(".select").removeClass('disabled')
|
||||
$('#portUSB2').parent(".select").removeClass('disabled')
|
||||
$("#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)
|
||||
|
||||
var config = {};
|
||||
|
@ -247,6 +249,7 @@ var status = {
|
|||
ipaddress: ip.address(),
|
||||
},
|
||||
machine: {
|
||||
name: '',
|
||||
inputs: [],
|
||||
tools: {
|
||||
hotend1: false,
|
||||
|
@ -810,6 +813,14 @@ io.on("connection", function(socket) {
|
|||
port.on("data", function(data) {
|
||||
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
|
||||
if (data.indexOf("Grbl") === 0) { // Check if it's Grbl
|
||||
status.comms.blocked = false;
|
||||
|
|
Ładowanie…
Reference in New Issue