pull/239/head v1.0.308
openbuilds-engineer 2021-12-01 21:34:45 +02:00
rodzic a719ddebab
commit 13954c8bf1
5 zmienionych plików z 258 dodań i 7 usunięć

Wyświetl plik

@ -1,3 +1,4 @@
v1.0.308: WCS Display
v1.0.307: Updated included firmware.bin for Interface update wizard
v1.0.306: Allow probing in other Coordinate systems as well
v1.0.305: Update SSL Certificates for OpenBuildsCAM integration

Wyświetl plik

@ -483,13 +483,37 @@
<div id="jogcontrols" class="mt-1">
<div class="row flex-justify-center flex-align-start" style="width: 100%; height: 100%;">
<div class="cell border-right bd-lightGray ">
<nav data-role="ribbonmenu" class="mt-1">
<ul class="tabs-holder ml-17">
<li onclick="mmMode();"><a id="mmMode" href="#tab-mm">mm-mode</a></li>
<li onclick="inMode();"><a id="inMode" href="#tab-inch">inch-mode</a></li>
</ul>
</nav>
<table class="drotable mt-1">
<tr>
<td>
<div class="pos-relative">
<button class="button mini light jogbtn" style="width: 60px; height: 24px;" id="wcsBtn">
<span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G54
</button>
<ul class="ribbon-dropdown drop-shadow" data-role="dropdown">
<li class="checked wcsItem wcsItemG54"><a href="#" onclick="sendGcode('G54')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G54</a></li>
<li class="wcsItem wcsItemG55"><a href="#" onclick="sendGcode('G55')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G55</a></li>
<li class="wcsItem wcsItemG56"><a href="#" onclick="sendGcode('G56')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G56</a></li>
<li class="wcsItem wcsItemG57"><a href="#" onclick="sendGcode('G57')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G57</a></li>
<li class="wcsItem wcsItemG58"><a href="#" onclick="sendGcode('G58')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G58</a></li>
<li class="wcsItem wcsItemG59"><a href="#" onclick="sendGcode('G59')"><span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>G59</a></li>
</ul>
</div>
</td>
<td colspan="3">
<nav data-role="ribbonmenu" class="mt-1">
<ul class="tabs-holder">
<li onclick="mmMode();"><a id="mmMode" href="#tab-mm">mm-mode</a></li>
<li onclick="inMode();"><a id="inMode" href="#tab-inch">inch-mode</a></li>
</ul>
</nav>
</td>
</tr>
<tr>
<td>
<button class="button light jogbtn" onclick="sendGcode( 'G10 P0 L20 X0')" style="width: 60px;" data-role="ripple" data-ripple-color="#e21b1b">

Wyświetl plik

@ -31,6 +31,7 @@ function showGrbl(bool) {
if (bool) {
sendGcode('$$')
sendGcode('$I')
sendGcode('$G')
$("#grblButtons").show()
$("#firmwarename").html('Grbl')
} else {
@ -745,6 +746,35 @@ function initSocket() {
showGrbl(false)
}
if (laststatus !== undefined) {
if (status.machine.modals.coordinatesys != laststatus.machine.modals.coordinatesys) {
$('#wcsBtn').html(`<span class="fas fa-fw fa-layer-group icon fg-darkGray"></span>` + status.machine.modals.coordinatesys)
$('.wcsItem').removeClass('checked')
switch (status.machine.modals.coordinatesys) {
case "G54":
$('.wcsItemG54').addClass('checked')
break;
case "G55":
$('.wcsItemG55').addClass('checked')
break;
case "G56":
$('.wcsItemG56').addClass('checked')
break;
case "G57":
$('.wcsItemG57').addClass('checked')
break;
case "G58":
$('.wcsItemG58').addClass('checked')
break;
case "G59":
$('.wcsItemG59').addClass('checked')
break;
}
}
}
laststatus = status;
waitingForStatus = false;
});

196
index.js
Wyświetl plik

@ -352,6 +352,23 @@ var status = {
line: ""
}
},
modals: {
motionmode: "G0", // G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
coordinatesys: "G54", // G54, G55, G56, G57, G58, G59
plane: "G17", // G17, G18, G19
distancemode: "G90", // G90, G91
arcdistmode: "G91.1", // G91.1
feedratemode: "G94", // G93, G94
unitsmode: "G21", // G20, G21
radiuscomp: "G40", // G40
tlomode: "G49", // G43.1, G49
programmode: "M0", // M0, M1, M2, M30
spindlestate: "M5", // M3, M4, M5
coolantstate: "M9", // M7, M8, M9
tool: "0",
spindle: "0",
feedrate: "0"
},
probe: {
x: 0.00,
y: 0.00,
@ -1043,6 +1060,7 @@ io.on("connection", function(socket) {
//console.log(data)
var command = sentBuffer[0];
if (data.indexOf("<") != 0) {
debug_log('data:', data)
}
@ -1143,6 +1161,7 @@ io.on("connection", function(socket) {
}
// [PRB:0.000,0.000,0.000:0]
//if (data.indexOf("[PRB:") === 0 && command != "$#" && command != undefined) {
if (data.indexOf("[PRB:") === 0) {
debug_log(data)
var prbLen = data.substr(5).search(/\]/);
@ -1170,6 +1189,10 @@ io.on("connection", function(socket) {
io.sockets.emit('prbResult', status.machine.probe);
};
if (data.indexOf("[GC:") === 0) {
gotModals(data)
}
if (data.indexOf("[INTF:") === 0) {
var output = {
'command': 'connect',
@ -1890,6 +1913,13 @@ function readFile(filePath) {
function machineSend(gcode, realtime) {
debug_log("SENDING: " + gcode)
if (gcode.indexOf("$") != 0) {
if (gcode.indexOf("G54") != -1 || gcode.indexOf("G55") != -1 || gcode.indexOf("G56") != -1 || gcode.indexOf("G57") != -1 || gcode.indexOf("G58") != -1 || gcode.indexOf("G59") != -1 || gcode.indexOf("G20") != -1 || gcode.indexOf("G21") != -1 || gcode.indexOf("G90") != -1 || gcode.indexOf("G91") != -1 || gcode.indexOf("G93") != -1 || gcode.indexOf("G94") != -1 || gcode.indexOf("M3") != -1 || gcode.indexOf("M4") != -1 || gcode.indexOf("M5") != -1 || gcode.indexOf("M7") != -1 || gcode.indexOf("M8") != -1 || gcode.indexOf("M9") != -1) {
setTimeout(function() {
addQRealtime("$G\n");
}, 200)
}
}
if (port.isOpen) {
if (realtime) {
// realtime commands doesnt count toward the queue, does not generate OK
@ -2196,6 +2226,172 @@ function parseFeedback(data) {
// end statusreport
}
function gotModals(data) {
// as per https://github.com/gnea/grbl/wiki/Grbl-v1.1-Commands#g---view-gcode-parser-state
// The shown g-code are the current modal states of Grbl's g-code parser.
// This may not correlate to what is executing since there are usually
// several motions queued in the planner buffer.
// [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0.0 S0]
// defaults
data = data.split(/:|\[|\]/)[2].split(" ")
for (i = 0; i < data.length; i++) {
if (data[i] == "G0") {
status.machine.modals.motionmode = "G0";
}
if (data[i] == "G1") {
status.machine.modals.motionmode = "G1";
}
if (data[i] == "G2") {
status.machine.modals.motionmode = "G2";
}
if (data[i] == "G3") {
status.machine.modals.motionmode = "G3";
}
if (data[i] == "G38.2") {
status.machine.modals.motionmode = "G38.2";
}
if (data[i] == "G38.3") {
status.machine.modals.motionmode = "G38.3";
}
if (data[i] == "G38.4") {
status.machine.modals.motionmode = "G38.4";
}
if (data[i] == "G38.5") {
status.machine.modals.motionmode = "G38.5";
}
if (data[i] == "G80") {
status.machine.modals.motionmode = "G80";
}
// status.machine.modals.coordinatesys = "G54"; // G54, G55, G56, G57, G58, G59
if (data[i] == "G54") {
status.machine.modals.coordinatesys = "G54";
}
if (data[i] == "G55") {
status.machine.modals.coordinatesys = "G55";
}
if (data[i] == "G56") {
status.machine.modals.coordinatesys = "G56";
}
if (data[i] == "G57") {
status.machine.modals.coordinatesys = "G57";
}
if (data[i] == "G58") {
status.machine.modals.coordinatesys = "G58";
}
if (data[i] == "G59") {
status.machine.modals.coordinatesys = "G59";
}
// status.machine.modals.plane = "G17"; // G17, G18, G19
if (data[i] == "G17") {
status.machine.modals.plane = "G17";
}
if (data[i] == "G18") {
status.machine.modals.plane = "G18";
}
if (data[i] == "G19") {
status.machine.modals.plane = "G19";
}
// status.machine.modals.distancemode = "G90"; // G90, G91
if (data[i] == "G90") {
status.machine.modals.distancemode = "G90";
}
if (data[i] == "G91") {
status.machine.modals.distancemode = "G91";
}
// status.machine.modals.arcdistmode = "G91.1"; // G91.1
if (data[i] == "G91.1") {
status.machine.modals.arcdistmode = "G91.1";
}
// status.machine.modals.feedratemode = "G94"; // G93, G94
if (data[i] == "G93") {
status.machine.modals.feedratemode = "G93";
}
if (data[i] == "G94") {
status.machine.modals.feedratemode = "G94";
}
// status.machine.modals.unitsmode = "G21"; // G20, G21
if (data[i] == "G20") {
status.machine.modals.unitsmode = "G20";
}
if (data[i] == "G21") {
status.machine.modals.unitsmode = "G21";
}
// status.machine.modals.radiuscomp = "G40"; // G40
if (data[i] == "G40") {
status.machine.modals.radiuscomp = "G40";
}
// status.machine.modals.tlomode = "G49"; // G43.1, G49
if (data[i] == "G49") {
status.machine.modals.tlomode = "G49";
}
if (data[i] == "G43.1") {
status.machine.modals.tlomode = "G43.1";
}
// status.machine.modals.programmode = "M0"; // M0, M1, M2, M30
if (data[i] == "M0") {
status.machine.modals.programmode = "M0";
}
if (data[i] == "M1") {
status.machine.modals.programmode = "M1";
}
if (data[i] == "M2") {
status.machine.modals.programmode = "M2";
}
if (data[i] == "M30") {
status.machine.modals.programmode = "M30";
}
// status.machine.modals.spindlestate = "M5"; // M3, M4, M5
if (data[i] == "M3") {
status.machine.modals.spindlestate = "M3";
}
if (data[i] == "M4") {
status.machine.modals.spindlestate = "M4";
}
if (data[i] == "M5") {
status.machine.modals.spindlestate = "M5";
}
// status.machine.modals.coolantstate = "M9"; // M7, M8, M9
if (data[i] == "M7") {
status.machine.modals.coolantstate = "M7";
}
if (data[i] == "M8") {
status.machine.modals.coolantstate = "M8";
}
if (data[i] == "M9") {
status.machine.modals.coolantstate = "M9";
}
// status.machine.modals.tool = "0",
if (data[i].indexOf("T") === 0) {
status.machine.modals.tool = parseFloat(data[i].substr(1))
}
// status.machine.modals.spindle = "0"
if (data[i].indexOf("S") === 0) {
status.machine.modals.spindle = parseFloat(data[i].substr(1))
}
// status.machine.modals.feedrate = "0"
if (data[i].indexOf("F") === 0) {
status.machine.modals.feedrate = parseFloat(data[i].substr(1))
}
}
} // end gotModals
function laserTest(data) {
if (status.comms.connectionStatus > 0) {
data = data.split(',');

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "OpenBuildsCONTROL",
"version": "1.0.307",
"version": "1.0.308",
"license": "AGPL-3.0",
"description": "OpenBuildsCONTROL CNC Machine Interface Software",
"author": "github.com/openbuilds <support@openbuilds.com>",