diff --git a/app/js/app.js b/app/js/app.js index 2e76f30..2f1faa1 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -2501,40 +2501,7 @@ let log; State shared by ALL interfaces *******/ mcopy.state = { - version : PACKAGE.version, //use for file compatibility check - sequence : { - pads: { - //gaaaaaaaaah - cam_forward: 'CF', - proj_forward : 'PF', - black_forward : 'BF', - - cam_backward: 'CB', - proj_backward : 'PB', - black_backward : 'BB', - - light_set : 'L', - - cam2_forward : 'C2F', - cam2_backward : 'C2B', - - cams_forward : 'CCF', - cams_forward : 'CCB', - - cam_forward_cam2_backward : 'CFCB', - cam_backward_cam2_forward : 'CBCF', - - proj2_forward : 'P2F', - proj2_backward : 'P2B', - - projs_forward : 'PPF', - projs_backward : 'PPB', - - proj_forward_proj2_backward : 'PFPB', - proj_backward_proj2_forward : 'PBPF' - - } - } + version : PACKAGE.version //use for file compatibility check }; // diff --git a/app/lib/ui/grid.js b/app/lib/ui/grid.js index 3424281..6ff2f47 100644 --- a/app/lib/ui/grid.js +++ b/app/lib/ui/grid.js @@ -69,10 +69,10 @@ grid.refresh = function () { $('#' + cmds[i]).append($(elem).text(x)); } else if (i === cmds.length - 2) { elem = div.replace('xxxx', x); - $('#' + cmds[i]).append($(elem).addClass(mcopy.state.sequence.pads[cmds[i]])); + $('#' + cmds[i]).append($(elem).addClass(cfg.cmd[cmds[i]])); } else { elem = check.replace('xxxx', x); - $('#' + cmds[i]).append($(elem).addClass(mcopy.state.sequence.pads[cmds[i]])); + $('#' + cmds[i]).append($(elem).addClass(cfg.cmd[cmds[i]])); } grid.state(x); } diff --git a/app/lib/ui/seq.js b/app/lib/ui/seq.js index 3893173..1153ca1 100644 --- a/app/lib/ui/seq.js +++ b/app/lib/ui/seq.js @@ -25,7 +25,8 @@ seq.listener = function (event, arg) { if (arg.start) { if (typeof arg.loop !== 'undefined' && typeof arg.step !== 'undefined') { seq.activeStep(arg.step); - log.info(`Step ${arg.step} running of ${arg.loop}`, 'SERIAL', true); + log.info(`Step ${arg.step + 1} running of ${seq.arr.length}`, 'SERIAL', true); + log.info(`Loop ${arg.loop + 1} of ${seq.loops}`, 'SERIAL', true); } else if (typeof arg.loop !== 'undefined') { $('#loop_current').text(gui.fmtZero(arg.loop + 1, 6)); } else { @@ -41,7 +42,7 @@ seq.listener = function (event, arg) { } else { gui.overlay(false); gui.spinner(false); - seq.progress(0, 0); + //seq.progress(0, 0); log.info('Sequence stopped', 'SERIAL', true); } } @@ -49,15 +50,12 @@ seq.listener = function (event, arg) { } seq.progress = function (step, loop) { + const elem = $('.progress-bar'); const len = seq.arr.length; const total = len * seq.loops; - const pos = (loop * len) + step; - const elem = $('.progress-bar'); + let pos = (loop * len) + step; let progress; - console.dir(`${len} * ${seq.loops} = ${total}`) - console.dir(`(${len} * ${loop}) + ${step} = ${pos}`) - console.dir(`${pos} / ${total} = ${(pos / total) * 100}`) if (pos === 0) { progress = 0; } else { diff --git a/app/src/index.js b/app/src/index.js index 4775198..9032699 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -27,39 +27,7 @@ let log; State shared by ALL interfaces *******/ mcopy.state = { - version : PACKAGE.version, //use for file compatibility check - sequence : { - pads: { - cam_forward: 'CF', - proj_forward : 'PF', - black_forward : 'BF', - - cam_backward: 'CB', - proj_backward : 'PB', - black_backward : 'BB', - - light_set : 'L', - - cam2_forward : 'C2F', - cam2_backward : 'C2B', - - cams_forward : 'CCF', - cams_forward : 'CCB', - - cam_forward_cam2_backward : 'CFCB', - cam_backward_cam2_forward : 'CBCF', - - proj2_forward : 'P2F', - proj2_backward : 'P2B', - - projs_forward : 'PPF', - projs_backward : 'PPB', - - proj_forward_proj2_backward : 'PFPB', - proj_backward_proj2_forward : 'PBPF' - - } - } + version : PACKAGE.version //use for file compatibility check }; //