var score = this.smaSlope*0.01;
this.scoreArr[this.scoreArr.length - 1] + score);
graph.us = this.us[this.us.length - 1];
g.ratio = this.slowSMA;
g.score = this.scoreArr[this.scoreArr.length - 1];
this.scoreArr[this.scoreArr.length - 1 - g.xoffset]);
this.slowSMAarr[this.slowSMAarr.length - 1 - g.xoffset]);
} The HEGwebAPI class has a simple moving average-based scoring method that helps emphasize changes in the ratio smoothly. Here, the "this" variable is grabbing stored data in the session class, scoring it, then applying it to the Circle and the Graph array. That's pretty much it! The HEG responds to POST actions. You can POST most of the single character text commands or you can post "session.host/startHEG" and "session.host/stopHEG" to turn it on and off. If you look at webDemo.html you will see I used this in more interesting ways. There are more UI functions which need to be defined manually, like the x-axis sliders for the graph and the visual layout of your page with containers for everything. You will see that the threeApp.js file is included conditionally if the device detects its online as well, and this demonstrates how easy it is to start adding all kinds of interesting functions onto the app once it's connected online. IoT, baby! Eventually I will be able to integrate these libs onto the chip itself (or you can if you build the firmware without OTA), using the 8MB or 16MB ESP32 options (or future iterations). One note is if you add parent.postMessage(this.ratio[this.ratio.length - 1],"*"); to the handleScore() function, you can now post the data through IFrames. This means the whole API can be called to a website and interacted with through another layer of web software if you wish. We are going to demonstrate how this benefits remote session and data collection abilities on our website. I'm also going to demonstrate the web app as a Chrome app, as this allows USB Serial communication. More coming! We're still refining a few things and adding more generalized tools in but the format is pretty much set, hope anyone interested in the software side finds this useful.