Fix for Troubleshooting

pull/110/head
openbuilds-engineer 2018-09-27 17:00:49 +02:00
rodzic a238b2edef
commit a90665671b
4 zmienionych plików z 40 dodań i 11 usunięć

Wyświetl plik

@ -257,7 +257,7 @@
</div>
<div class="section" id="section-troubleshooting">
<div class="group estop" style="width: 100px;">
<div class="group" style="width: 100px;">
<button class="ribbon-button" onclick="socket.emit('clearAlarm', 2)">
<span class="icon">
<span class="fa-layers" data-toggle="tooltip" data-placement="bottom" title="Flashes red when machine has entered ALARM state, click Clear Alarm button">

Wyświetl plik

@ -125,8 +125,8 @@ function initSocket() {
});
socket.on('data', function(data) {
// console.log(data.length, data)
var toPrint = data.response;
console.log(data)
var toPrint = escapeHTML(data.response);
// Parse Grbl Settings Feedback
if (data.response.indexOf('$') === 0) {
@ -137,6 +137,8 @@ function initSocket() {
toPrint = data.response + " ;" + descr
printLog("<span class='fg-red'>[ " + data.command + " ]</span> <span class='fg-green'>" + toPrint + "</span>")
}
} else {
printLog("<span class='fg-red'>[ " + data.command + " ]</span> <span class='fg-green'>" + toPrint + "</span>")
};
});
@ -562,4 +564,8 @@ function friendlyPort(i) {
img: img,
note: note
};
}
function escapeHTML(html) {
return document.createElement('div').appendChild(document.createTextNode(html)).parentNode.innerHTML;
}

Wyświetl plik

@ -787,7 +787,7 @@ io.on("connection", function(socket) {
status.comms.blocked = false;
send1Q();
} else if (data.indexOf('ALARM') === 0) { //} || data.indexOf('HALTED') === 0) {
console.log("ALARM: " + data)
// console.log("ALARM: " + data)
status.comms.connectionStatus = 5;
switch (status.machine.firmware.type) {
case 'grbl':
@ -838,11 +838,23 @@ io.on("connection", function(socket) {
// do nothing with +data
}
if (data.indexOf("[MSG:Reset to continue]") === 0) {
switch (status.machine.firmware.type) {
case 'grbl':
console.log("[MSG:Reset to continue] -> Sending Reset")
addQRealtime(String.fromCharCode(0x18)); // ctrl-x
break;
// case 'smoothie':
//
// break;
}
}
if (command) {
command = command.replace(/(\r\n|\n|\r)/gm, "");
// console.log("CMD: " + command + " / DATA RECV: " + data.replace(/(\r\n|\n|\r)/gm, ""));
if (command != "?" && command != "M105" && data.length > 0) {
if (command != "?" && command != "M105" && command != "$H" && data.length > 0) {
var string = "";
if (status.comms.sduploading) {
string += "SD: "
@ -855,8 +867,15 @@ io.on("connection", function(socket) {
// console.log(output.response)
io.sockets.emit('data', output);
}
} else {
if (data.indexOf("<") != 0) {
var output = {
'command': "none",
'response': data
}
io.sockets.emit('data', output);
}
}
}); // end of parser.on(data)
}
});
@ -944,7 +963,7 @@ io.on("connection", function(socket) {
}
}
if (dir && dist && feed) {
console.log('Adding jog commands to queue. blocked=' + status.comms.blocked + ', paused=' + status.comms.paused + ', Q=' + gcodeQueue.length);
console.log('Adding jog commands to queue. Firmw=' + status.machine.firmware.type + ', blocked=' + status.comms.blocked + ', paused=' + status.comms.paused + ', Q=' + gcodeQueue.length);
switch (status.machine.firmware.type) {
case 'grbl':
addQToEnd('$J=G91' + dir + dist + feed);
@ -1426,12 +1445,15 @@ io.on("connection", function(socket) {
break;
case 2:
console.log('Emptying Queue');
status.comms.queue = 0
queuePointer = 0;
gcodeQueue.length = 0; // Dump the queue
sentBuffer.length = 0; // Dump bufferSizes
queuePointer = 0;
console.log('Clearing Lockout');
switch (status.machine.firmware.type) {
case 'grbl':
addQRealtime(String.fromCharCode(0x18)); // ctrl-x
addQRealtime('$X\n');
console.log('Sent: $X');
status.comms.blocked = false;
@ -1551,7 +1573,7 @@ function parseFeedback(data) {
var state = data.substring(1, data.search(/(,|\|)/));
status.comms.runStatus = state
if (state == "Alarm") {
console.log("ALARM: " + data)
// console.log("ALARM: " + data)
status.comms.connectionStatus = 5;
switch (status.machine.firmware.type) {
case 'grbl':
@ -1878,7 +1900,7 @@ function send1Q() {
queuePointer++;
sentBuffer.push(gcode);
machineSend(gcode + '\n');
// console.log('Sent: ' + gcode + ' Q: ' + (gcodeQueue.length - queuePointer) + ' Bspace: ' + (spaceLeft - gcode.length - 1));
console.log('Sent: ' + gcode + ' Q: ' + (gcodeQueue.length - queuePointer) + ' Bspace: ' + (spaceLeft - gcode.length - 1));
} else {
status.comms.blocked = true;
}
@ -1913,7 +1935,8 @@ function send1Q() {
status.comms.connectionStatus = 2; // finished
// status.comms.runStatus = "Finished"
}
} else {
console.log('Not Connected')
}
}

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "OpenBuildsMachineDriver",
"version": "1.0.99",
"version": "1.0.100",
"license": "AGPL-3.0",
"description": "Machine Interface Driver for OpenBuilds",
"author": "github.com/openbuilds <webmaster@openbuilds.com>",