kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
test dtr
rodzic
bdba80a499
commit
1459fd6de7
|
@ -404,7 +404,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
$('.xM').on('touchstart mousedown', function(ev) {
|
$('.xM').on('touchstart mousedown', function(ev) {
|
||||||
console.log(ev)
|
//console.log(ev)
|
||||||
if (ev.which > 1) {
|
if (ev.which > 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
29
index.js
29
index.js
|
@ -38,12 +38,6 @@ if (process.env.DEBUGCONTROL) {
|
||||||
console.log("Console Debugging Enabled")
|
console.log("Console Debugging Enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCECONNECTION = false
|
|
||||||
if (process.env.FORCECONNECTION) {
|
|
||||||
FORCECONNECTION = true;
|
|
||||||
console.log("Forced Firmware Connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
function debug_log() {
|
function debug_log() {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
console.log.apply(this, arguments);
|
console.log.apply(this, arguments);
|
||||||
|
@ -1142,8 +1136,16 @@ io.on("connection", function(socket) {
|
||||||
port = new SerialPort({
|
port = new SerialPort({
|
||||||
path: data.port,
|
path: data.port,
|
||||||
baudRate: parseInt(data.baud),
|
baudRate: parseInt(data.baud),
|
||||||
|
autoOpen: false
|
||||||
//hupcl: false // Don't set DTR - useful for X32 Reset
|
//hupcl: false // Don't set DTR - useful for X32 Reset
|
||||||
});
|
});
|
||||||
|
port.set({
|
||||||
|
setOptions: {
|
||||||
|
dtr: true,
|
||||||
|
rts: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
port.open()
|
||||||
} else if (data.type == "telnet") {
|
} else if (data.type == "telnet") {
|
||||||
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
|
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
|
||||||
port = net.connect(23, data.ip);
|
port = net.connect(23, data.ip);
|
||||||
|
@ -1250,26 +1252,15 @@ io.on("connection", function(socket) {
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
||||||
if (FORCECONNECTION || status.machine.firmware.type.length > 1) {
|
if (status.machine.firmware.type.length > 1) {
|
||||||
if (FORCECONNECTION || status.machine.firmware.type === "grbl") {
|
if (status.machine.firmware.type === "grbl") {
|
||||||
debug_log("GRBL detected");
|
debug_log("GRBL detected");
|
||||||
var output = {
|
var output = {
|
||||||
'command': 'connect',
|
'command': 'connect',
|
||||||
'response': "Detecting Firmware: Detected Grbl Succesfully",
|
'response': "Detecting Firmware: Detected Grbl Succesfully",
|
||||||
'type': 'info'
|
'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() {
|
setTimeout(function() {
|
||||||
io.sockets.emit('grbl', status.machine.firmware)
|
io.sockets.emit('grbl', status.machine.firmware)
|
||||||
//v1.0.318 - commented out as a test - too many normal alarms clear prematurely
|
//v1.0.318 - commented out as a test - too many normal alarms clear prematurely
|
||||||
|
|
Ładowanie…
Reference in New Issue