comms.js:2 ============================================= comms.js:3 Type 'Puck.debug=3' for full BLE debug info comms.js:4 ============================================= espruinotools.js:4775 GET window.localStorage = null espruinotools.js:51 Initialising Notifications espruinotools.js:51 Initialising Status espruinotools.js:51 Initialising Utils espruinotools.js:51 Initialising Config espruinotools.js:51 Initialising Serial espruinotools.js:51 Initialising CodeWriter espruinotools.js:51 Initialising Modules espruinotools.js:51 Initialising Env espruinotools.js:51 Initialising Assembler espruinotools.js:51 Initialising GetGitHub espruinotools.js:51 Initialising Pretokenise espruinotools.js:51 Initialising SaveOnSend espruinotools.js:51 Initialising SetTime espruinotools.js:51 Initialising CoreModules puck.js:406 Device Name: Bangle.js b7a3 puck.js:406 Device ID: fkkPvQChuW0D8hF8Va6LDQ== puck.js:406 Connected comms.js:143 Ctrl-C gave "" comms.js:182 getDeviceInfo Object comms.js:214 removeApp const s=require("Storage"); s.erase("accellog.info"); s.erase("accellog.app.js"); s.erase("accellog.img"); s.list(/^accellog\..\.csv$/).forEach(f=>s.erase(f)); comms.js:41 reset comms.js:43 reset: got "\u001b[?7l\r\n ____ _ \r\n| __|___ ___ ___ _ _|_|___ ___ \r\n| __|_ -| . | _| | | | | . |\r\n|____|___| _|_| |___|_|_|_|___|\r\n |_| espruino.com\r\n 2v10.27 (c) 2021 G.Williams\r\n\r\n>" comms.js:49 reset: complete. comms.js:18 showMessage "Erasing\naccellog..." comms.js:18 showMessage "Hold button\nto reload" ui.js:86 [success] Acceleration Logger removed successfully espruinotools.js:123 Loading modules espruinotools.js:5689 loadModule(Layout) espruinotools.js:5733 - Layout requires [] comms.js:62 uploadApp: accellog.app.js, accellog.img, accellog.info comms.js:41 reset comms.js:43 reset: got "\u001b[?7l\r\n ____ _ \r\n| __|___ ___ ___ _ _|_|___ ___ \r\n| __|_ -| . | _| | | | | . |\r\n|____|___| _|_| |___|_|_|_|___|\r\n |_| espruino.com\r\n 2v10.27 (c) 2021 G.Williams\r\n\r\n>" comms.js:49 reset: complete. comms.js:18 showMessage "Uploading\naccellog..." comms.js:29 getProgressCmd undefined comms.js:87 Upload accellog.app.js => "Modules.addCached(\"Layout\",ª(){ªLayout(layout,buttons){¯._l=¯.l=layout;¯.b=buttons;¯.physBtns=(process.env.HWVERSIONŠ2)?1:3;¯.yOffset=Object.keys(global.WIDGETS).length?24:0;£(buttons){£(¯.physBtns‘buttons.length){¬btnHeight=Math.floor((g.getHeight()-¯.yOffset)/¯.physBtns);£(Bangle.btnWatch)Bangle.btnWatch.forEach(clearWatch);Bangle.btnWatch=[];£(¯.physBtns>2žbuttons.lengthŠ1)buttons.unshift({label:\"\"});¦(¯.physBtns>buttons.length)buttons.push({label:\"\"});£(buttons[0])Bangle.btnWatch.push(setWatch(pressHandler.bind(¯,0),BTN1,{repeat:´,edge:-1}));£(buttons[1])Bangle.btnWatch.push(setWatch(pressHandler.bind(¯,1),BTN2,{repeat:´,edge:-1}));£(buttons[2])Bangle.btnWatch.push(setWatch(pressHandler.bind(¯,2),BTN3,{repeat:´,edge:-1}));¯._l.width=g.getWidth()-8;¯._l={type:\"h\",filly:1,c:[¯._l,{type:\"v\",pad:1,filly:1,c:buttons.map(b¢(b.type=\"txt\",b.font=\"6x8\",b.height=btnHeight,b.r=1,b))}]};}¤{¬btnHeight=Math.floor((g.getHeight()-¯.yOffset)/buttons.length);¯._l.width=g.getWidth()-20;¯._l={type:\"h\",c:[¯._l,{type:\"v\",c:buttons.map(b¢(b.type=\"btn\",b.h=btnHeight,b.w=32,b.r=1,b))}]};Bangle.touchHandler=(_,e)¢touchHandler(¯._l,e);Bangle.on('touch',Bangle.touchHandler);}}¬ll=¯;ªidRecurser(l){£(l.id)ll[l.id]=l;£(l.c)l.c.forEach(idRecurser);}idRecurser(layout);¯.update();}Layout.prototype.remove=ª(l){£(Bangle.btnWatch){Bangle.btnWatch.forEach(clearWatch);¾Bangle.btnWatch;}£(Bangle.touchHandler){Bangle.removeListener(\"touch\",Bangle.touchHandler);¾Bangle.touchHandler;}};ªpressHandler(btn,e){£(e.time-e.lastTime>0.75ž¯.b[btn].cbl)¯.b[btn].cbl(e);¤£(¯.b[btn].cb)¯.b[btn].cb(e);}ªtouchHandler(l,e){£(l.typeŠ\"btn\"žl.cbže.x‘l.xže.y‘l.yže.xŽl.x+l.wže.yŽl.y+l.h)l.cb(e);£(l.c)l.c.forEach(n¢touchHandler(n,e));}ªupdateMin(l){»(l.type){¼\"txt\":{£(l.font.endsWith(\"%\"))l.font=\"Vector\"+Math.round(g.getHeight()*l.font.slice(0,-1)/100);£(l.font.includes(\":\")){¬f=l.font.split(\":\");l.font=f[0];l.fsz=f[1];}g.setFont(l.font,l.fsz);l._h=g.getFontHeight();l._w=g.stringWidth(l.label);¨;}¼\"btn\":{l._h=24;l._w=14+l.label.length*8;¨;}¼\"img\":{¬im=E.toString(l.src());l._h=im.charCodeAt(0);l._w=im.charCodeAt(1);¨;}¼·:¼\"custom\":{l._w=0;l._h=0;¨;}¼\"h\":{l.c.forEach(updateMin);l._h=l.c.reduce((a,b)¢Math.max(a,b._h+(b.pad1)),0);l._w=l.c.reduce((a,b)¢a+b._w+(b.pad1),0);l.fillxŸl.c.some(c¢c.fillx);¨;}¼\"v\":{l.c.forEach(updateMin);l._h=l.c.reduce((a,b)¢a+b._h+(b.pad1),0);l._w=l.c.reduce((a,b)¢Math.max(a,b._w+(b.pad1)),0);l.fillyŸl.c.some(c¢c.filly);¨;}½:°\"Unknown item type \"+l.type;}£(l.r&1){¬t=l._w;l._w=l._h;l._h=t;}l._w=Math.max(l._w,0|l.width);l._h=Math.max(l._h,0|l.height);}ªrender(l){£(!l)l=¯.l;g.reset();£(l.col)g.setColor(l.col);£(l.bgCol·)g.setBgColor(l.bgCol).clearRect(l.x,l.y,l.x+l.w,l.y+l.h);»(l.type){¼\"txt\":g.setFont(l.font,l.fsz).setFontAlign(0,0,l.r).drawString(l.label,l.x+(l.w’1),l.y+(l.h’1),´);¨;¼\"btn\":¬poly=[l.x,l.y+4,l.x+4,l.y,l.x+l.w-5,l.y,l.x+l.w-1,l.y+4,l.x+l.w-1,l.y+l.h-5,l.x+l.w-5,l.y+l.h-1,l.x+4,l.y+l.h-1,l.x,l.y+l.h-5,l.x,l.y+4];g.setColor(g.theme.bgH).fillPoly(poly).setColor(l.selected?g.theme.fgH:g.theme.fg).drawPoly(poly).setFont(\"4x6\",2).setFontAlign(0,0,l.r).drawString(l.label,l.x+l.w/2,l.y+l.h/2);¨;¼\"img\":g.drawImage(l.src(),l.x,l.y);¨;¼\"custom\":l.render(l);¨;}£(l.c)l.c.forEach(render);}Layout.prototype.render=ª(l){£(!l)l=¯._l;render(l);};Layout.prototype.layout=ª(l){¬fillx=l.c.reduce((a,l)¢a+(0|l.fillx),0);¬filly=l.c.reduce((a,l)¢a+(0|l.filly),0);»(l.type){¼\"h\":{­x=l.x+(l.w-l._w)/2;£(fillx){x=l.x;}l.c.forEach(c¢{c.w=c._w+(c.fillx?(l.w-l._w)/fillx:0);c.h=c.filly?l.h:c._h;c.x=x;c.y=l.y+(1+(0|c.valign))*(l.h-c.h)/2;x–c.w;£(c.pad){x–c.pad*2;c.w–c.pad*2;c.h–c.pad*2;}£(c.c){¯.layout(c);}});¨;}¼\"v\":{­y=l.y+(l.h-l._h)/2;£(filly){y=l.y;}l.c.forEach(c¢{c.w=c.fillx?l.w:c._w;c.h=c._h+(c.filly?(l.h-l._h)/filly:0);c.x=l.x+(1+(0|c.halign))*(l.w-c.w)/2;c.y=y;y–c.h;£(c.pad){y–c.pad*2;c.w–c.pad*2;c.h–c.pad*2;}£(c.c)¯.layout(c);});¨;}}};Layout.prototype.debug=ª(l,c){£(!l)l=¯._l;c=c 1;g.setColor(c&1,c&2,c&4).drawRect(l.x+c-1,l.y+c-1,l.x+l.w-c,l.y+l.h-c);c˜;£(l.c)l.c.forEach(n¢¯.debug(n,c));};Layout.prototype.update=ª(){¬l=¯._l;¬w=g.getWidth();¬y=¯.yOffset;¬h=g.getHeight()-y;updateMin(l);£(l.fillx l.filly){l.w=w;l.h=h;l.x=0;l.y=y;}¤{l.w=l._w;l.h=l._h;l.x=(w-l.w)/2;l.y=y+(h-l.h)/2;}¯.layout(l);};Layout.prototype.clear=ª(l){£(!l)l=¯._l;g.reset();£(l.bgCol·)g.setBgColor(l.bgCol);g.clearRect(l.x,l.y,l.x+l.w-1,l.y+l.h-1);};exports=Layout;});\n¬fileNumber=0;\n¬MAXLOGS=9;\nªgetFileName(n){«\"accellog.\"+n+\".csv\";}\nªshowMenu(){¬menu={\"\":{title:\"Accel Logger\"},\"File No\":{value:fileNumber,min:0,max:MAXLOGS,onchange:v¢{fileNumber=v;}},\"Start\":ª(){E.showMenu();startRecord();},\"View Logs\":ª(){viewLogs();},\"Exit\":ª(){load();},};E.showMenu(menu);}\nªviewLog(n){E.showMessage(\"Loading...\");¬f=require(\"Storage\").open(getFileName(n),\"r\");¬records=0,l=\"\",ll=\"\";¦((l=f.readLine())·){records˜;ll=l;}¬length=0;£(ll)length=(ll.split(\",\")[0]|0)/1000;¬menu={\"\":{title:\"Log \"+n}};menu[records+\" Records\"]=\"\";menu[length+\" Seconds\"]=\"\";menu[\"DELETE\"]=ª(){E.showPrompt(\"Delete Log \"+n).then(ok¢{£(ok){E.showMessage(\"Erasing...\");f.erase();viewLogs();}¤viewLog(n);});};menu[\"< Back\"]=ª(){viewLogs();};E.showMenu(menu);}\nªviewLogs(){¬menu={\"\":{title:\"Logs\"}};¬hadLogs=µ;§(¬i=0;iŽMAXLOGS;i˜){¬f=require(\"Storage\").open(getFileName(i),\"r\");£(f.readLine()·){(ª(i){menu[\"Log \"+i]=()¢viewLog(i);})(i);hadLogs=´;}}£(!hadLogs)menu[\"No Logs Found\"]=ª(){};menu[\"< Back\"]=ª(){showMenu();};E.showMenu(menu);}\nªstartRecord(force){£(!force){¬f=require(\"Storage\").open(getFileName(fileNumber),\"r\");£(f.readLine()·)«E.showPrompt(\"Overwrite Log \"+fileNumber+\"?\").then(ok¢{£(ok)startRecord(´);¤showMenu();});}g.clear(1);Bangle.drawWidgets();¬Layout=require(\"Layout\");¬layout=¸Layout({type:\"v\",c:[{type:\"txt\",font:\"6x8\",label:\"Samples\",pad:2},{type:\"txt\",id:\"samples\",font:\"6x8:2\",label:\" - \",pad:5},{type:\"txt\",font:\"6x8\",label:\"Time\",pad:2},{type:\"txt\",id:\"time\",font:\"6x8:2\",label:\" - \",pad:5},{type:\"txt\",font:\"6x8:2\",label:\"RECORDING\",bgCol:\"#f00\",pad:5,fillx:´},]},[{label:\"STOP\",cb:()¢{Bangle.removeListener('accel',accelHandler);showMenu();}}]);layout.update();layout.render();¬f=require(\"Storage\").open(getFileName(fileNumber),\"w\");f.write(\"Time (ms),X,Y,Z\\n\");¬start=getTime();¬sampleCount=0;ªaccelHandler(accel){¬t=getTime()-start;f.write([t*1000,accel.x*8192,accel.y*8192,accel.z*8192].map(n¢Math.round(n)).join(\",\")+\"\\n\");sampleCount˜;layout.samples.label=sampleCount;layout.time.label=Math.round(t)+\"s\";layout.render(layout.samples);layout.render(layout.time);}Bangle.setPollInterval(80);Bangle.on('accel',accelHandler);}\nBangle.loadWidgets();\nBangle.drawWidgets();\nshowMenu();" comms.js:29 getProgressCmd 0.26244274809160306 comms.js:29 getProgressCmd 0.5282442748091603 comms.js:29 getProgressCmd 0.8398473282442748 comms.js:29 getProgressCmd 0.9138931297709924 comms.js:87 Upload accellog.img => "require(\"heatshrink\").decompress(atob(\"mEwwgsphAXWxGACyoABDCwWVC/4XcXY8IDZsIxAXVXYQZDDwIGEC6gwMI5IvNGAJfVR5DXyPgczAAwSEC58iC4R3DC50xiMjC4QTBXY4XNGAIPCF6QTCI6gXCYYwXQcQ4XemUiC6IRBa4wXOABQX/C9OD/4AKC5WPC+Hzaw0zI/5H/C83zI/mIUo4ACnAXLABgXI\"))" comms.js:29 getProgressCmd 0.956793893129771 comms.js:87 Upload accellog.info => "{\"id\":\"accellog\",\"name\":\"Accel Log\",\"src\":\"accellog.app.js\",\"icon\":\"accellog.img\",\"version\":\"0.02\",\"tags\":\"outdoor,b2\",\"files\":\"accellog.info,accellog.app.js,accellog.img\",\"data\":\"accellog.?.csv\"}" comms.js:29 getProgressCmd 0.9995419847328244 comms.js:18 showMessage "Hold button\nto reload" ui.js:86 [success] Acceleration Logger Uploaded!