Skip to content
Snippets Groups Projects
Commit 549ebbcf authored by Jake Read's avatar Jake Read
Browse files

passback

parent 701ea75c
No related branches found
No related tags found
No related merge requests found
*node_modules/
*package.json
*package-lock.json
\ No newline at end of file
......@@ -28,7 +28,7 @@ jQuery.get('/startLocal/ltv-bridge.js', (res) => {
if(msg.type == "plot update"){
if(msg.array.length > 0){
lastRecvdIndice = msg.array[msg.array.length - 1][0]
console.log('captured', msg.array.length)
//console.log('captured', msg.array.length)
console.log('now last r: ', lastRecvdIndice)
// msg.array = [[indice, inspState, proxPres, xdcrFlow, volume],[indice...]]
} else {
......@@ -37,11 +37,15 @@ jQuery.get('/startLocal/ltv-bridge.js', (res) => {
}
}
let reqData = () => {
if(ws.readyState == ws.OPEN){
ws.send(JSON.stringify({
type: "plot update request",
lastRecvdIndice: lastRecvdIndice
}))
setTimeout(reqData, 500)
} else {
console.error("WS Closed")
}
}
reqData() // start polling loop
}
......
......@@ -12,7 +12,6 @@ WSSPipe.start().then((ws) => {
//ws.send(data) available
ws.onmessage = (msg) => {
msg = JSON.parse(msg.data)
console.log(msg)
if(msg.type == "plot update request"){
let resp = { type: "plot update" }
// msg.lastRecvdIndice
......@@ -116,7 +115,7 @@ let onPacket = (pck) => {
if(store.length > 5000){
store = store.slice(1000)
}
console.log(data)
//console.log(data)
break;
default:
//not plotting others currently
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment