From b2a0094d49675e156292ea70894ee17fb51e5d68 Mon Sep 17 00:00:00 2001 From: Eyal Perry <eyal.perry88@gmail.com> Date: Fri, 30 Jul 2021 13:30:50 -0400 Subject: [PATCH] wip --- modules/path/machines/CBA/PPA.js | 13 ++++++++----- py/serialserver.py | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/path/machines/CBA/PPA.js b/modules/path/machines/CBA/PPA.js index a711b41..5469677 100644 --- a/modules/path/machines/CBA/PPA.js +++ b/modules/path/machines/CBA/PPA.js @@ -25,8 +25,8 @@ var name = 'PPA' // initialization // var init = function() { - mod.baseLength.value = 39.5*25.4; - mod.maxHypo.value = 1208.2; + mod.baseLength.value = 41.5*25.4; + mod.maxHypo.value = 1206.5; mod.yMargin.value = 5; mod.chunkLength.value = 0.1; draw_boundary(); @@ -260,7 +260,8 @@ function make_path() { var x = bl / 2; var y = Math.sqrt(Math.pow(mh, 2) - Math.pow(x, 2)); - str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + //str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + str += l1.toFixed(4).toString()+","+l2.toFixed(4).toString()+"\n"; console.log("Start x,y", x, y); @@ -288,7 +289,8 @@ function make_path() { l1 = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); l2 = Math.sqrt(Math.pow(bl - x, 2) + Math.pow(y, 2)); //str += "L1,"+l1.toFixed(4).toString()+",L2,"+l2.toFixed(4).toString()+",Z,"+z.toString()+"\n"; - str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + //str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + str += l1.toFixed(4).toString()+","+l2.toFixed(4).toString()+"\n"; count+=1; ctx.lineTo(x * mod.scale + mod.drawOffsetX, y * mod.scale); @@ -301,7 +303,8 @@ function make_path() { l1 = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); l2 = Math.sqrt(Math.pow(bl - x, 2) + Math.pow(y, 2)); //str += "L1,"+l1.toFixed(4).toString()+",L2,"+l2.toFixed(4).toString()+",Z,"+z.toString()+"\n"; - str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + //str += x.toFixed(4).toString()+","+y.toFixed(4).toString()+"\n"; + str += l1.toFixed(4).toString()+","+l2.toFixed(4).toString()+"\n"; count+=1; ctx.lineTo(x * mod.scale + mod.drawOffsetX, y * mod.scale); } diff --git a/py/serialserver.py b/py/serialserver.py index e0f486c..2c6e784 100644 --- a/py/serialserver.py +++ b/py/serialserver.py @@ -107,10 +107,12 @@ async def receive(websocket,path): while (s.getCTS() != True): time.sleep(0.001) s.write(c.encode('ascii')) + s.write("\n".encode('ascii')) s.flush() + print(c) if (flow == "ppa"): receive_string = s.readline() - #print("Got response", receive_string) + print("Got response", receive_string) n += 1 percent = (100.0*n)/len(data) await websocket.send(str(round(percent))+'%') -- GitLab