Commit 621eabca authored by Jake Read's avatar Jake Read

example program moves some axis

parent 8f18e341
......@@ -27,7 +27,7 @@ function ATKSerialLink() {
state.portStatus = 'closed' // or we hope it will be
atkSerialLink.init = function(){
findSerialPort()
//findSerialPort()
}
/*
......@@ -74,7 +74,7 @@ function ATKSerialLink() {
serialport = new SerialPort(state.portName, {
baudRate: 250000
})
state.portStatus = 'opening'
//state.portStatus = 'opening'
serialport.on('open', function() {
state.portStatus = 'open'
})
......@@ -150,6 +150,7 @@ function ATKSerialLink() {
// we'll make sure it's what we think it will be
// console.log("PORT DATA")
var dtArray = new Array()
console.log('sp data', data)
if (Buffer.isBuffer(data)) {
for (var i = 0; i < data.length; i++) {
dtArray[i] = data[i]
......
This diff is collapsed.
......@@ -20,12 +20,12 @@
"inputs": {},
"outputs": {},
"state": {
"portName": "COM3",
"portName": "---",
"connect": {
"type": "button",
"label": "click to find and connect"
},
"portStatus": "open"
"portStatus": "closed"
}
},
"ATKStepper-0": {
......@@ -76,7 +76,7 @@
"label": "test network"
},
"message": "click above to test network",
"route": "0,3",
"route": "0,0",
"rate": 2000,
"axis": "X",
"spu": 200,
......@@ -137,10 +137,10 @@
"label": "test network"
},
"message": "click above to test network",
"route": "0,0",
"route": "0,3",
"rate": 2000,
"axis": "Y",
"spu": -200,
"spu": 200,
"rawMove": -10,
"makeMove": {
"type": "button",
......@@ -196,7 +196,7 @@
"route": "0,5",
"rate": 2000,
"axis": "Y",
"spu": 200,
"spu": -200,
"rawMove": -10,
"makeMove": {
"type": "button",
......@@ -257,13 +257,13 @@
"route": "0,1",
"rate": 2000,
"axis": "Z",
"spu": 200,
"spu": -200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": -6000,
"lead": 0,
"position": 0
}
},
......@@ -433,8 +433,8 @@
"alt": "movements -> acceleration planned moves",
"path": "./modules/motion/planner.js",
"position": {
"left": 822,
"top": 1020
"left": 693,
"top": 1015
}
},
"inputs": {
......@@ -472,7 +472,12 @@
},
"moveComplete": {
"emits": "number",
"calls": []
"calls": [
{
"parentId": "Multi-line Text Input-12",
"key": "req"
}
]
}
},
"state": {
......@@ -493,12 +498,12 @@
0,
0
],
"isRunning": 1,
"isRunning": 0,
"netWindow": 3,
"netState": [
3,
3,
3
0,
0,
0
]
}
},
......@@ -585,19 +590,19 @@
"type": "multiline",
"label": "lines complete",
"rows": 11,
"value": "\n\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10"
"value": ""
},
"now": {
"type": "multiline",
"label": "line just out",
"rows": 1,
"value": "G0 X20Y20Z0"
"value": ""
},
"incoming": {
"type": "multiline",
"label": "future lines",
"rows": 36,
"value": "G0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n"
"value": "G0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n"
}
}
}
......
This diff is collapsed.
......@@ -119,13 +119,15 @@ function socketRecv(evt) {
}
function socketSend(type, data) {
if (sckt) {
if (sckt.readyState === 1) {
var msg = {
type: type,
data: data
}
//console.log('SEND', msg)
sckt.send(JSON.stringify(msg))
} else {
throw 'on socketSend, ws not ready'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment