Make seq-ui module strict

This commit is contained in:
Matt 2016-06-21 15:25:29 -04:00
parent 7bbbf7ee7b
commit 84a8df4a78
2 changed files with 6 additions and 6 deletions

View File

@ -11,6 +11,7 @@ capture.store = {
capture.start = function (first) { capture.start = function (first) {
'use strict'; 'use strict';
//reset storage
capture.store.events = []; capture.store.events = [];
capture.store.start = +new Date(); capture.store.start = +new Date();
}; };
@ -104,21 +105,15 @@ capture.test = function () {
capture.init = function () { capture.init = function () {
'use strict'; 'use strict';
eventEmitter.on('arduino_send', function (cmd) { eventEmitter.on('arduino_send', function (cmd) {
console.log(cmd);
if (capture.active if (capture.active
&& cmd.trim() === 'p') { && cmd.trim() === 'p') {
if (capture.store.start === 0) {
capture.start();
}
capture.proj_start(); capture.proj_start();
} }
}); });
eventEmitter.on('arduino_end', function (cmd) { eventEmitter.on('arduino_end', function (cmd) {
console.log(cmd);
if (capture.active if (capture.active
&& cmd.trim() === 'p') { && cmd.trim() === 'p') {
capture.proj_end(); capture.proj_end();
} }
}); });
}; };

View File

@ -9,6 +9,7 @@ mcopy.loopCount = 0;
seq.time = 0; seq.time = 0;
seq.stopState = false; seq.stopState = false;
seq.run = function () { seq.run = function () {
'use strict';
var c = mcopy.state.sequence.arr[seq.i], var c = mcopy.state.sequence.arr[seq.i],
timeEnd = 0, timeEnd = 0,
rgb, rgb,
@ -72,6 +73,7 @@ seq.run = function () {
} }
}; };
seq.stop = function (state) { seq.stop = function (state) {
'use strict';
if (typeof state === 'undefined') { if (typeof state === 'undefined') {
return seq.stopState; return seq.stopState;
} else { } else {
@ -79,6 +81,7 @@ seq.stop = function (state) {
} }
}; };
seq.init = function (start) { seq.init = function (start) {
'use strict';
if (typeof start === 'undefined') { if (typeof start === 'undefined') {
start = 0; start = 0;
mcopy.loopCount = 0; mcopy.loopCount = 0;
@ -89,6 +92,7 @@ seq.init = function (start) {
seq.run(); seq.run();
}; };
seq.stats = function () { seq.stats = function () {
'use strict';
var ms = 0, var ms = 0,
c = '', c = '',
cam_total = 0, cam_total = 0,
@ -156,6 +160,7 @@ seq.stats = function () {
return ms; return ms;
}; };
seq.clear = function () { seq.clear = function () {
'use strict';
mcopy.state.sequence.size = 24; mcopy.state.sequence.size = 24;
mcopy.state.sequence.arr = []; mcopy.state.sequence.arr = [];
}; };