kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
v1.0.143
rodzic
35b45b529e
commit
3faae2277d
|
|
@ -1,3 +1,4 @@
|
||||||
|
v1.0.143: Improved stability when XPRO Driverminder is active
|
||||||
v1.0.142: Fix Bug related to status parser
|
v1.0.142: Fix Bug related to status parser
|
||||||
v1.0.141: Fix Bug that prevented Jog, fixed bug that disabled homing for Smoothie
|
v1.0.141: Fix Bug that prevented Jog, fixed bug that disabled homing for Smoothie
|
||||||
v1.0.140: Fix Jog/Checksize to still move in mm after G20
|
v1.0.140: Fix Jog/Checksize to still move in mm after G20
|
||||||
|
|
|
||||||
277
index.js
277
index.js
|
|
@ -78,15 +78,6 @@ if (isElectron()) {
|
||||||
'response': string
|
'response': string
|
||||||
}
|
}
|
||||||
io.sockets.emit('updatedata', output);
|
io.sockets.emit('updatedata', output);
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
autoUpdater.on('update-available', (ev, info) => {
|
autoUpdater.on('update-available', (ev, info) => {
|
||||||
updateIsDownloading = true;
|
updateIsDownloading = true;
|
||||||
|
|
@ -98,15 +89,6 @@ if (isElectron()) {
|
||||||
}
|
}
|
||||||
io.sockets.emit('updatedata', output);
|
io.sockets.emit('updatedata', output);
|
||||||
console.log(JSON.stringify(ev))
|
console.log(JSON.stringify(ev))
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
autoUpdater.on('update-not-available', (ev, info) => {
|
autoUpdater.on('update-not-available', (ev, info) => {
|
||||||
var string = 'Update not available. Installed version: ' + require('./package').version + " / Available version: " + ev.version + ".\n";
|
var string = 'Update not available. Installed version: ' + require('./package').version + " / Available version: " + ev.version + ".\n";
|
||||||
|
|
@ -119,15 +101,6 @@ if (isElectron()) {
|
||||||
}
|
}
|
||||||
io.sockets.emit('updatedata', output);
|
io.sockets.emit('updatedata', output);
|
||||||
console.log(JSON.stringify(ev))
|
console.log(JSON.stringify(ev))
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
autoUpdater.on('error', (ev, err) => {
|
autoUpdater.on('error', (ev, err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -140,15 +113,6 @@ if (isElectron()) {
|
||||||
'response': string
|
'response': string
|
||||||
}
|
}
|
||||||
io.sockets.emit('updatedata', output);
|
io.sockets.emit('updatedata', output);
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
autoUpdater.on('download-progress', (ev, progressObj) => {
|
autoUpdater.on('download-progress', (ev, progressObj) => {
|
||||||
updateIsDownloading = true;
|
updateIsDownloading = true;
|
||||||
|
|
@ -160,17 +124,6 @@ if (isElectron()) {
|
||||||
}
|
}
|
||||||
io.sockets.emit('updatedata', output);
|
io.sockets.emit('updatedata', output);
|
||||||
io.sockets.emit('updateprogress', ev.percent.toFixed(0));
|
io.sockets.emit('updateprogress', ev.percent.toFixed(0));
|
||||||
if (ev.percent % 10 === 0) {
|
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
autoUpdater.on('update-downloaded', (info) => {
|
autoUpdater.on('update-downloaded', (info) => {
|
||||||
|
|
@ -185,28 +138,12 @@ if (isElectron()) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
io.sockets.emit('updateready', availversion);
|
io.sockets.emit('updateready', availversion);
|
||||||
}, 15 * 60 * 1000) // 15 mins
|
}, 15 * 60 * 1000) // 15 mins
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL",
|
|
||||||
content: string
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Launch Gui to run Update
|
|
||||||
}
|
|
||||||
updateIsDownloading = false;
|
updateIsDownloading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Schedule AutoUpdater to run from Tray
|
|
||||||
// if (process.platform == 'win32') {
|
|
||||||
// autoUpdater.checkForUpdates();
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
console.log("Running outside Electron: Disabled AutoUpdater")
|
console.log("Running outside Electron: Disabled AutoUpdater")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isElectron()) {
|
if (isElectron()) {
|
||||||
var uploadsDir = electronApp.getPath('userData') + '/upload/';
|
var uploadsDir = electronApp.getPath('userData') + '/upload/';
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -214,13 +151,13 @@ if (isElectron()) {
|
||||||
}
|
}
|
||||||
var uploadedgcode = ""; // var to store uploaded gcode
|
var uploadedgcode = ""; // var to store uploaded gcode
|
||||||
|
|
||||||
// fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir)
|
|
||||||
mkdirp(uploadsDir, function(err) {
|
mkdirp(uploadsDir, function(err) {
|
||||||
if (err) console.error(err)
|
if (err) console.error(err)
|
||||||
else console.log('Created Uploads Temp Directory')
|
else console.log('Created Uploads Temp Directory')
|
||||||
});
|
});
|
||||||
|
|
||||||
var oldportslist;
|
var oldportslist;
|
||||||
|
var oldpinslist;
|
||||||
const iconPath = path.join(__dirname, 'app/icon.png');
|
const iconPath = path.join(__dirname, 'app/icon.png');
|
||||||
const iconNoComm = path.join(__dirname, 'app/icon-notconnected.png');
|
const iconNoComm = path.join(__dirname, 'app/icon-notconnected.png');
|
||||||
const iconPlay = path.join(__dirname, 'app/icon-play.png');
|
const iconPlay = path.join(__dirname, 'app/icon-play.png');
|
||||||
|
|
@ -228,7 +165,6 @@ const iconStop = path.join(__dirname, 'app/icon-stop.png');
|
||||||
const iconPause = path.join(__dirname, 'app/icon-pause.png');
|
const iconPause = path.join(__dirname, 'app/icon-pause.png');
|
||||||
const iconAlarm = path.join(__dirname, 'app/icon-bell.png');
|
const iconAlarm = path.join(__dirname, 'app/icon-bell.png');
|
||||||
|
|
||||||
|
|
||||||
var iosocket;
|
var iosocket;
|
||||||
var lastCommand = false
|
var lastCommand = false
|
||||||
var gcodeQueue = [];
|
var gcodeQueue = [];
|
||||||
|
|
@ -475,15 +411,6 @@ var PortCheckinterval = setInterval(function() {
|
||||||
var removedPorts = _.differenceWith(oldportslist, ports, _.isEqual)
|
var removedPorts = _.differenceWith(oldportslist, ports, _.isEqual)
|
||||||
if (removedPorts.length > 0) {
|
if (removedPorts.length > 0) {
|
||||||
console.log("Unplugged " + removedPorts[0].comName);
|
console.log("Unplugged " + removedPorts[0].comName);
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL Detected a disconnected Port",
|
|
||||||
content: "OpenBuilds CONTROL detected that port: " + removedPorts[0].comName + " was removed"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
oldportslist = ports;
|
oldportslist = ports;
|
||||||
|
|
@ -605,7 +532,21 @@ io.on("connection", function(socket) {
|
||||||
iosocket = socket;
|
iosocket = socket;
|
||||||
|
|
||||||
if (status.machine.firmware.type == 'grbl') {
|
if (status.machine.firmware.type == 'grbl') {
|
||||||
socket.emit('grbl')
|
|
||||||
|
// handle Grbl RESET external input
|
||||||
|
if (status.machine.inputs.length > 0) {
|
||||||
|
for (i = 0; i < status.machine.inputs.length; i++) {
|
||||||
|
switch (status.machine.inputs[i]) {
|
||||||
|
case 'R':
|
||||||
|
// console.log('PIN: SOFTRESET');
|
||||||
|
safetosend = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (safetosend) {
|
||||||
|
socket.emit('grbl')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var interval = setInterval(function() {
|
var interval = setInterval(function() {
|
||||||
|
|
@ -722,10 +663,6 @@ io.on("connection", function(socket) {
|
||||||
status.comms.connectionStatus = 0;
|
status.comms.connectionStatus = 0;
|
||||||
});
|
});
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -748,15 +685,7 @@ io.on("connection", function(socket) {
|
||||||
'response': "PORT ERROR: " + err.message
|
'response': "PORT ERROR: " + err.message
|
||||||
}
|
}
|
||||||
io.sockets.emit('data', output);
|
io.sockets.emit('data', output);
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL encountered a Port error",
|
|
||||||
content: "OpenBuilds CONTROL received the following error: " + err.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (status.comms.connectionStatus > 0) {
|
if (status.comms.connectionStatus > 0) {
|
||||||
console.log('WARN: Closing Port ' + port.path);
|
console.log('WARN: Closing Port ' + port.path);
|
||||||
stopPort();
|
stopPort();
|
||||||
|
|
@ -881,13 +810,6 @@ io.on("connection", function(socket) {
|
||||||
io.sockets.emit('data', output);
|
io.sockets.emit('data', output);
|
||||||
addQToEnd('G10 P1 L20 Z' + status.machine.probe.plate);
|
addQToEnd('G10 P1 L20 Z' + status.machine.probe.plate);
|
||||||
send1Q();
|
send1Q();
|
||||||
// if (status.machine.probe.request.direction == 'Z-') {
|
|
||||||
// console.log('Lifting Z Probe up, off the probe')
|
|
||||||
// setTimeout(function() {
|
|
||||||
// addQToEnd('$J=G91Z5F' + parseInt(status.machine.probe.request.feedrate));
|
|
||||||
// send1Q();
|
|
||||||
// }, 200);
|
|
||||||
// };
|
|
||||||
} else {
|
} else {
|
||||||
var output = {
|
var output = {
|
||||||
'command': '[ PROBE ]',
|
'command': '[ PROBE ]',
|
||||||
|
|
@ -900,35 +822,32 @@ io.on("connection", function(socket) {
|
||||||
|
|
||||||
// Machine Identification
|
// Machine Identification
|
||||||
if (data.indexOf("Grbl") === 0) { // Check if it's Grbl
|
if (data.indexOf("Grbl") === 0) { // Check if it's Grbl
|
||||||
|
console.log(data)
|
||||||
status.comms.blocked = false;
|
status.comms.blocked = false;
|
||||||
status.machine.firmware.type = "grbl";
|
status.machine.firmware.type = "grbl";
|
||||||
status.machine.firmware.version = data.substr(5, 4); // get version
|
status.machine.firmware.version = data.substr(5, 4); // get version
|
||||||
if (parseFloat(status.machine.firmware.version) < 1.1) { // If version is too old
|
if (parseFloat(status.machine.firmware.version) < 1.1) { // If version is too old
|
||||||
if (status.comms.connectionStatus > 0) {
|
if (status.machine.firmware.version.length < 3) {
|
||||||
console.log('WARN: Closing Port ' + port.path);
|
console.log('invalid version string, stay connected')
|
||||||
stopPort();
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
if (status.comms.connectionStatus > 0) {
|
||||||
|
console.log('WARN: Closing Port ' + port.path + " / v" + parseFloat(status.machine.firmware.version));
|
||||||
|
// stopPort();
|
||||||
|
} else {
|
||||||
|
console.log('ERROR: Machine connection not open!');
|
||||||
|
}
|
||||||
|
var output = {
|
||||||
|
'command': command,
|
||||||
|
'response': "Detected an unsupported version: Grbl " + status.machine.firmware.version + ". This is sadly outdated. Please upgrade to Grbl 1.1 or newer to use this software. Go to http://github.com/gnea/grbl"
|
||||||
|
}
|
||||||
|
io.sockets.emit('data', output);
|
||||||
}
|
}
|
||||||
var output = {
|
|
||||||
'command': command,
|
|
||||||
'response': "Detected an unsupported version: Grbl " + status.machine.firmware.version + ". This is sadly outdated. Please upgrade to Grbl 1.1 or newer to use this software. Go to http://github.com/gnea/grbl"
|
|
||||||
}
|
|
||||||
io.sockets.emit('data', output);
|
|
||||||
}
|
}
|
||||||
status.machine.firmware.date = "";
|
status.machine.firmware.date = "";
|
||||||
console.log("GRBL detected");
|
console.log("GRBL detected");
|
||||||
socket.emit('grbl')
|
setTimeout(function() {
|
||||||
// addQRealtime("$10=2\n"); // force Status Report to WPOS
|
socket.emit('grbl')
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
}, 600)
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL has established a Connection",
|
|
||||||
content: "OpenBuilds CONTROL is now connected to " + status.comms.interfaces.activePort + " running " + status.machine.firmware.type + " " + status.machine.firmware.version
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 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) {
|
||||||
|
|
@ -938,15 +857,6 @@ io.on("connection", function(socket) {
|
||||||
} 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");
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL has established a Connection",
|
|
||||||
content: "OpenBuilds CONTROL is now connected to " + status.comms.interfaces.activePort + " running " + status.machine.firmware.type + " " + status.machine.firmware.version
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
status.machine.firmware.type = "smoothie";
|
status.machine.firmware.type = "smoothie";
|
||||||
status.machine.firmware.version = data.substr(data.search(/version:/i) + 9).split(/,/);
|
status.machine.firmware.version = data.substr(data.search(/version:/i) + 9).split(/,/);
|
||||||
status.machine.firmware.date = new Date(data.substr(data.search(/Build date:/i) + 12).split(/,/)).toDateString();
|
status.machine.firmware.date = new Date(data.substr(data.search(/Build date:/i) + 12).split(/,/)).toDateString();
|
||||||
|
|
@ -1110,15 +1020,6 @@ io.on("connection", function(socket) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Job Started",
|
|
||||||
content: "OpenBuilds CONTROL started a job: Job Size: " + data.length + " lines of GCODE"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
@ -1225,7 +1126,6 @@ io.on("connection", function(socket) {
|
||||||
// y: yincrement,
|
// y: yincrement,
|
||||||
// feed: feed
|
// feed: feed
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var xincrement = parseFloat(data.x);
|
var xincrement = parseFloat(data.x);
|
||||||
var yincrement = parseFloat(data.y);
|
var yincrement = parseFloat(data.y);
|
||||||
var feed = parseFloat(data.feed)
|
var feed = parseFloat(data.feed)
|
||||||
|
|
@ -1314,15 +1214,6 @@ io.on("connection", function(socket) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
send1Q();
|
send1Q();
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Work Coordinate System Reset",
|
|
||||||
content: "OpenBuilds CONTROL has reset the WCS on the " + data + " axes."
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
@ -1598,15 +1489,6 @@ io.on("connection", function(socket) {
|
||||||
}
|
}
|
||||||
status.comms.runStatus = 'Stopped'
|
status.comms.runStatus = 'Stopped'
|
||||||
status.comms.connectionStatus = 2;
|
status.comms.connectionStatus = 2;
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Alarm Cleared",
|
|
||||||
content: "OpenBuilds CONTROL has cleared the Alarm Condition, you may continue"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
@ -1914,42 +1796,42 @@ function parseFeedback(data) {
|
||||||
if (startPin > 3) {
|
if (startPin > 3) {
|
||||||
var pinsdata = data.replace(">", "").replace("\r", "").substr(startPin).split(/,|\|/, 1);
|
var pinsdata = data.replace(">", "").replace("\r", "").substr(startPin).split(/,|\|/, 1);
|
||||||
var pins = pinsdata[0].split('')
|
var pins = pinsdata[0].split('')
|
||||||
console.log("PINS: " + JSON.stringify(pins, null, 2));
|
|
||||||
status.machine.inputs = pins;
|
status.machine.inputs = pins;
|
||||||
if (pins.includes('H')) {
|
if (!_.isEqual(pins, oldpinslist)) {
|
||||||
// pause
|
if (pins.includes('H')) {
|
||||||
pause();
|
// pause
|
||||||
var output = {
|
pause();
|
||||||
'command': '[external from hardware]',
|
var output = {
|
||||||
'response': "OpenBuilds CONTROL received a FEEDHOLD notification from Grbl: This could be due to someone pressing the HOLD button (if connected), or DriverMinder on the xPROv4 detected a driver fault"
|
'command': '[external from hardware]',
|
||||||
}
|
'response': "OpenBuilds CONTROL received a FEEDHOLD notification from Grbl: This could be due to someone pressing the HOLD button (if connected), or DriverMinder on the xPROv4 detected a driver fault"
|
||||||
io.sockets.emit('data', output);
|
}
|
||||||
} // end if HOLD
|
io.sockets.emit('data', output);
|
||||||
|
} // end if HOLD
|
||||||
|
|
||||||
if (pins.includes('R')) {
|
if (pins.includes('R')) {
|
||||||
// abort
|
// abort
|
||||||
stop();
|
stop();
|
||||||
var output = {
|
var output = {
|
||||||
'command': '[external from hardware]',
|
'command': '[external from hardware]',
|
||||||
'response': "OpenBuilds CONTROL received a RESET/ABORT notification from Grbl: This could be due to someone pressing the RESET/ABORT button (if connected), or DriverMinder on the xPROv4 detected a driver fault"
|
'response': "OpenBuilds CONTROL received a RESET/ABORT notification from Grbl: This could be due to someone pressing the RESET/ABORT button (if connected), or DriverMinder on the xPROv4 detected a driver fault"
|
||||||
}
|
}
|
||||||
io.sockets.emit('data', output);
|
io.sockets.emit('data', output);
|
||||||
} // end if ABORT
|
} // end if ABORT
|
||||||
|
|
||||||
if (pins.includes('S')) {
|
|
||||||
// abort
|
|
||||||
unpause();
|
|
||||||
var output = {
|
|
||||||
'command': '[external from hardware]',
|
|
||||||
'response': "OpenBuilds CONTROL received a CYCLESTART/RESUME notification from Grbl: This could be due to someone pressing the CYCLESTART/RESUME button (if connected)"
|
|
||||||
}
|
|
||||||
io.sockets.emit('data', output);
|
|
||||||
} // end if RESUME/START
|
|
||||||
|
|
||||||
|
if (pins.includes('S')) {
|
||||||
|
// abort
|
||||||
|
unpause();
|
||||||
|
var output = {
|
||||||
|
'command': '[external from hardware]',
|
||||||
|
'response': "OpenBuilds CONTROL received a CYCLESTART/RESUME notification from Grbl: This could be due to someone pressing the CYCLESTART/RESUME button (if connected)"
|
||||||
|
}
|
||||||
|
io.sockets.emit('data', output);
|
||||||
|
} // end if RESUME/START
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
status.machine.inputs = [];
|
status.machine.inputs = [];
|
||||||
}
|
}
|
||||||
|
oldpinslist = pins;
|
||||||
// Extract Buffer Data
|
// Extract Buffer Data
|
||||||
var startBuf = data.search(/Bf:/i) + 3;
|
var startBuf = data.search(/Bf:/i) + 3;
|
||||||
if (startBuf > 3) {
|
if (startBuf > 3) {
|
||||||
|
|
@ -2312,9 +2194,6 @@ if (isElectron()) {
|
||||||
jogWindow.focus();
|
jogWindow.focus();
|
||||||
jogWindow.setAlwaysOnTop(false);
|
jogWindow.setAlwaysOnTop(false);
|
||||||
})
|
})
|
||||||
// jogWindow.maximize()
|
|
||||||
// jogWindow.webContents.openDevTools()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.platform == 'darwin') {
|
if (!process.platform == 'darwin') {
|
||||||
|
|
@ -2412,16 +2291,6 @@ function stop() {
|
||||||
status.comms.blocked = false;
|
status.comms.blocked = false;
|
||||||
status.comms.paused = false;
|
status.comms.paused = false;
|
||||||
status.comms.runStatus = 'Stopped';
|
status.comms.runStatus = 'Stopped';
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Job Aborted",
|
|
||||||
content: "OpenBuilds CONTROL was asked to abort the running job."
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// status.comms.connectionStatus = 2;
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
@ -2448,15 +2317,6 @@ function pause() {
|
||||||
}
|
}
|
||||||
status.comms.runStatus = 'Paused';
|
status.comms.runStatus = 'Paused';
|
||||||
status.comms.connectionStatus = 4;
|
status.comms.connectionStatus = 4;
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Job Paused",
|
|
||||||
content: "OpenBuilds CONTROL paused the job"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
@ -2483,15 +2343,6 @@ function unpause() {
|
||||||
}, 200);
|
}, 200);
|
||||||
status.comms.runStatus = 'Resuming';
|
status.comms.runStatus = 'Resuming';
|
||||||
status.comms.connectionStatus = 3;
|
status.comms.connectionStatus = 3;
|
||||||
if (jogWindow && !jogWindow.isFocused()) {
|
|
||||||
if (appIcon) {
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "OpenBuilds CONTROL: Job Resumed",
|
|
||||||
content: "OpenBuilds CONTROL resumed the job"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('ERROR: Machine connection not open!');
|
console.log('ERROR: Machine connection not open!');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "OpenBuildsCONTROL",
|
"name": "OpenBuildsCONTROL",
|
||||||
"version": "1.0.142",
|
"version": "1.0.143",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"description": "Machine Interface Driver for OpenBuilds",
|
"description": "Machine Interface Driver for OpenBuilds",
|
||||||
"author": "github.com/openbuilds <webmaster@openbuilds.com>",
|
"author": "github.com/openbuilds <webmaster@openbuilds.com>",
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue