Browse Source

Start of progress handler

Andrew Chalkley 9 years ago
parent
commit
4c56ce5eca
2 changed files with 12 additions and 2 deletions
  1. 1 0
      back-end/rom_comm.js
  2. 11 2
      front-end/js/app.js

+ 1 - 0
back-end/rom_comm.js

@@ -72,6 +72,7 @@ class RomComm {
             throw new Error("Unkown board " + boardName);
         }
         this.board = new BoardFactory(this._port);
+        this.progressHandler = config.progressHandler;
         this.config = config;
     }
 

+ 11 - 2
front-end/js/app.js

@@ -157,12 +157,13 @@ function flashWithManifest(manifest) {
 
         const esp = new RomComm({
             portName: portsSelect.value,
-            baudRate: 115200
+            baudRate: 115200,
+            progress: progressHandler
         });
 
         esp.open().then((result) => {
             appStatus.textContent = `Flashing ${portsSelect.value}...Openned Port.`;            let promise = Promise.resolve();
-
+            flashSpec.forEach(createProgressBars);
             flashSpec.forEach((spec, index) => {
                promise = promise.then(()=> {
                    appStatus.textContent = `Flashing ${index+1}/${flashSpec.length} binaries.`;
@@ -182,6 +183,14 @@ function flashWithManifest(manifest) {
     });
 }
 
+function createProgressBars(spec) {
+
+}
+
+function progressHandler(spec) {
+
+}
+
 /**
  * Get's manifest list for possibilities for flashing,
  * scans serial ports and sets up timer for checking for changes.