kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
test mode
rodzic
d9d2edd249
commit
bdba80a499
23
index.js
23
index.js
|
@ -38,6 +38,12 @@ if (process.env.DEBUGCONTROL) {
|
|||
console.log("Console Debugging Enabled")
|
||||
}
|
||||
|
||||
FORCECONNECTION = false
|
||||
if (process.env.FORCECONNECTION) {
|
||||
FORCECONNECTION = true;
|
||||
console.log("Forced Firmware Connection")
|
||||
}
|
||||
|
||||
function debug_log() {
|
||||
if (DEBUG) {
|
||||
console.log.apply(this, arguments);
|
||||
|
@ -1243,14 +1249,27 @@ io.on("connection", function(socket) {
|
|||
}, config.grblWaitTime * 2000);
|
||||
|
||||
setTimeout(function() {
|
||||
if (status.machine.firmware.type.length > 1) {
|
||||
if (status.machine.firmware.type === "grbl") {
|
||||
|
||||
if (FORCECONNECTION || status.machine.firmware.type.length > 1) {
|
||||
if (FORCECONNECTION || status.machine.firmware.type === "grbl") {
|
||||
debug_log("GRBL detected");
|
||||
var output = {
|
||||
'command': 'connect',
|
||||
'response': "Detecting Firmware: Detected Grbl Succesfully",
|
||||
'type': 'info'
|
||||
}
|
||||
if (FORCECONNECTION) {
|
||||
status.machine.firmware.type = "grbl";
|
||||
status.machine.firmware.platform = "grblHAL"
|
||||
status.machine.firmware.version = "1.1f"; // get version
|
||||
var output = {
|
||||
'command': 'connect',
|
||||
'response': "FORCED CONNECTION",
|
||||
'type': 'info'
|
||||
}
|
||||
io.sockets.emit('data', output);
|
||||
|
||||
}
|
||||
setTimeout(function() {
|
||||
io.sockets.emit('grbl', status.machine.firmware)
|
||||
//v1.0.318 - commented out as a test - too many normal alarms clear prematurely
|
||||
|
|
Ładowanie…
Reference in New Issue