diff --git a/app/data/cfg.json b/app/data/cfg.json index 2d445b8..3cf40d2 100644 --- a/app/data/cfg.json +++ b/app/data/cfg.json @@ -104,32 +104,32 @@ "camera" : "c", "projector" : "p", "black" : "b", - "cam_forward" : "e", - "cam_backward" : "f", - "proj_forward" : "g", - "proj_backward" : "h", - "proj_identifier" : "j", - "cam_identifier" : "k", + "camera_forward" : "e", + "camera_backward" : "f", + "projector_forward" : "g", + "projector_backward" : "h", + "projector_identifier" : "j", + "camera_identifier" : "k", "mcopy_identifier" : "m", - "cam_timed" : "n", - "proj_identifier" : "j", - "cam_identifier" : "k", + "camera_timed" : "n", + "projector_identifier" : "j", + "camera_identifier" : "k", "light_identifier" : "o", - "proj_light_identifier" : "q", - "proj_cam_light_identifier" : "r", - "proj_cam_identifier" : "s", + "projector_light_identifier" : "q", + "projector_camera_light_identifier" : "r", + "projector_camera_identifier" : "s", - "proj_second_identifier" : "t", - "proj_dual_identifier" : "d", - "proj_second_forward" : "u", - "proj_second_backward" : "v", + "projector_second_identifier" : "t", + "projectors_identifier" : "d", + "projector_second_forward" : "u", + "projector_second_backward" : "v", "projector_second" : "w", "projectors" : "x", - "cam_second_identifier" : "y", - "cam_dual_identifier" : "a", - "cam_second_forward" : "1", - "cam_second_backward" : "2", + "camera_second_identifier" : "y", + "cameras_identifier" : "a", + "camera_second_forward" : "1", + "camera_second_backward" : "2", "camera_second" : "3", "cameras" : "4" } diff --git a/app/index.html b/app/index.html index e6f2815..c90b9b3 100644 --- a/app/index.html +++ b/app/index.html @@ -47,8 +47,8 @@
Promise
+Delay in an async/await function
+
+**Kind**: global function
+**Returns**: Promise
- Promise to resolve after timeout
+
+| Param | Type | Description |
+| --- | --- | --- |
+| ms | integer
| Milliseconds to delay for |
+
diff --git a/app/lib/devices/index.js b/app/lib/devices/index.js
index 24475df..05ce12e 100644
--- a/app/lib/devices/index.js
+++ b/app/lib/devices/index.js
@@ -296,6 +296,9 @@ class Devices {
return false
}*/
}
+ //camera,projector,projector_second
+ //camera,camera_second,projector
+ //camera,camera_second,projector,projector_second
return connectSuccess;
}
/**
@@ -384,7 +387,7 @@ class Devices {
camera,
projector,
light,
- profile: this.settings.profile
+ profile: this.settings.state.profile
};
if (projector_second && projector_second.arduino) {
args.projector_second = projector_second;
diff --git a/app/lib/devices/index.js.map b/app/lib/devices/index.js.map
index 534979a..3857c15 100644
--- a/app/lib/devices/index.js.map
+++ b/app/lib/devices/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/devices/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B;;;;IAII;AAEJ,MAAM,OAAO;IAYZ;;QAEI;IACJ,YAAa,OAAiB,EAAE,QAAc,EAAE,UAAgB,EAAE,GAAS;QAZpE,cAAS,GAAS,EAAE,CAAA;QAa1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAA;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAE,CAAC,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAA;IACd,CAAC;IACD;;QAEI;IACI,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACD;;QAEI;IACI,QAA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O,EAAE,IAAI,CAAC,CAAA;QAC3B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;QAC5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACpC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,EAAE;YACjD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;YAC1D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;SACjC;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;QACpB,OAAO,IAAI,CAAA;IACZ,CAAC;IAAA,CAAC;CAMF;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,OAAiB,EAAE,QAAc,EAAE,UAAgB,EAAE,GAAS;IACxF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;AACvD,CAAC,CAAA"}
\ No newline at end of file
diff --git a/app/lib/proj/index.js b/app/lib/proj/index.js
index dce7b06..548bffe 100644
--- a/app/lib/proj/index.js
+++ b/app/lib/proj/index.js
@@ -6,7 +6,7 @@ class Projector {
/**
*
**/
- constructor(arduino, cfg, ui, dig) {
+ constructor(arduino, cfg, ui, dig, second = false) {
this.state = {
pos: 0,
dir: true,
@@ -18,6 +18,8 @@ class Projector {
this.cfg = cfg;
this.ui = ui;
this.dig = dig;
+ if (second)
+ this.id += '_second';
this.init();
}
/**
@@ -41,10 +43,10 @@ class Projector {
let cmd;
let ms;
if (dir) {
- cmd = this.cfg.arduino.cmd.proj_forward;
+ cmd = this.cfg.arduino.cmd[`${this.id}_forward`];
}
else {
- cmd = this.cfg.arduino.cmd.proj_backward;
+ cmd = this.cfg.arduino.cmd[`${this.id}_backward`];
}
this.state.dir = dir;
if (this.dig.state.enabled) {
@@ -55,7 +57,7 @@ class Projector {
ms = await this.arduino.send(this.id, cmd);
}
catch (err) {
- this.log.error('Error setting projector direction', err);
+ this.log.error(`Error setting ${this.id} direction`, err);
}
}
return await this.end(cmd, id, ms);
@@ -79,7 +81,7 @@ class Projector {
ms = await this.arduino.send(this.id, cmd);
}
catch (err) {
- this.log.error('Error moving projector', err);
+ this.log.error(`Error moving ${this.id}`, err);
}
}
this.log.info('Projector move time', { ms });
@@ -116,12 +118,18 @@ class Projector {
**/
async end(cmd, id, ms) {
let message = '';
- if (cmd === this.cfg.arduino.cmd.proj_forward) {
+ if (cmd === this.cfg.arduino.cmd.projector_forward) {
message = 'Projector set to FORWARD';
}
- else if (cmd === this.cfg.arduino.cmd.proj_backward) {
+ else if (cmd === this.cfg.arduino.cmd.projector_backward) {
message = 'Projector set to BACKWARD';
}
+ else if (cmd === this.cfg.arduino.cmd.projector_second_forward) {
+ message = 'Projector second set to FORWARD';
+ }
+ else if (cmd === this.cfg.arduino.cmd.projector_second_backward) {
+ message = 'Projector second set to BACKWARD';
+ }
else if (cmd === this.cfg.arduino.cmd.projector) {
message = 'Projector ';
if (this.state.dir) {
@@ -132,6 +140,16 @@ class Projector {
}
message += ' 1 frame';
}
+ else if (cmd === this.cfg.arduino.cmd.projector_second) {
+ message = 'Projector second';
+ if (this.state.dir) {
+ message += 'ADVANCED';
+ }
+ else {
+ message += 'REWOUND';
+ }
+ message += ' 1 frame';
+ }
this.log.info(message, 'PROJECTOR');
return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms });
}
diff --git a/app/lib/proj/index.js.map b/app/lib/proj/index.js.map
index 336bd73..bbee36b 100644
--- a/app/lib/proj/index.js.map
+++ b/app/lib/proj/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proj/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;;AAEjD,2BAA4B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app/lib/sequence/Readme.md
@@ -33,14 +33,14 @@ seq.run = function () {
$('#numbers div[x=' + seq.i + ']').addClass('h');
if (c === 'CF'){
rgb = mcopy.state.sequence.light[seq.i].split(',');
- cmd.cam_forward(rgb, action);
+ cmd.camera_forward(rgb, action);
} else if (c === 'CB') {
rgb = mcopy.state.sequence.light[seq.i].split(',');
- cmd.cam_backward(rgb, action);
+ cmd.camera_backward(rgb, action);
} else if (c === 'PF') {
- cmd.proj_forward(action);
+ cmd.projector_forward(action);
} else if (c === 'PB') {
- cmd.proj_backward(action);
+ cmd.projector_backward(action);
} else if (c === 'BF') {
cmd.black_forward(action);
} else if (c === 'BB') {
@@ -229,13 +229,13 @@ seq.step = function () {
gui.spinner(true, `Sequence: step ${c} ${current}/${max}`, (current / max) * 100);
log.info(`Sequence: step ${c} ${current}/${max}`, 'SEQUENCE', true);
if (c === 'CF'){
- cmd.cam_forward(rgb, seq.step);
+ cmd.camera_forward(rgb, seq.step);
} else if (c === 'CB') {
- cmd.cam_backward(rgb, seq.step);
+ cmd.camera_backward(rgb, seq.step);
} else if (c === 'PF') {
- cmd.proj_forward(seq.step);
+ cmd.projector_forward(seq.step);
} else if (c === 'PB') {
- cmd.proj_backward(seq.step);
+ cmd.projector_backward(seq.step);
} else if (c === 'BF') {
cmd.black_forward(seq.step);
} else if (c === 'BB') {
@@ -257,9 +257,9 @@ proj.set = async function (dir, id) {
let cmd
let ms
if (dir) {
- cmd = mcopy.cfg.arduino.cmd.proj_forward
+ cmd = mcopy.cfg.arduino.cmd.projector_forward
} else {
- cmd = mcopy.cfg.arduino.cmd.proj_backward
+ cmd = mcopy.cfg.arduino.cmd.projector_backward
}
proj.state.dir = dir
if (proj.state.digital) {
@@ -314,9 +314,9 @@ proj.listen = function () {
}
proj.end = async function (cmd, id, ms) {
let message = ''
- if (cmd === mcopy.cfg.arduino.cmd.proj_forward) {
+ if (cmd === mcopy.cfg.arduino.cmd.projector_forward) {
message = 'Projector set to FORWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.proj_backward) {
+ } else if (cmd === mcopy.cfg.arduino.cmd.projector_backward) {
message = 'Projector set to BACKWARD'
} else if (cmd === mcopy.cfg.arduino.cmd.projector) {
message = 'Projector '
@@ -426,9 +426,9 @@ cam.set = async function (dir, id) {
let cmd
let ms
if (dir) {
- cmd = mcopy.cfg.arduino.cmd.cam_forward
+ cmd = mcopy.cfg.arduino.cmd.camera_forward
} else {
- cmd = mcopy.cfg.arduino.cmd.cam_backward
+ cmd = mcopy.cfg.arduino.cmd.camera_backward
}
cam.state.dir = dir
@@ -528,9 +528,9 @@ cam.listen = function () {
}
cam.end = async function (cmd, id, ms) {
var message = ''
- if (cmd === mcopy.cfg.arduino.cmd.cam_forward) {
+ if (cmd === mcopy.cfg.arduino.cmd.camera_forward) {
message = 'Camera set to FORWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.cam_backward) {
+ } else if (cmd === mcopy.cfg.arduino.cmd.camera_backward) {
message = 'Camera set to BACKWARD'
} else if (cmd === mcopy.cfg.arduino.cmd.camera) {
message = 'Camera '
diff --git a/app/lib/sequence/index.js b/app/lib/sequence/index.js
index c6924e9..c1a66f3 100644
--- a/app/lib/sequence/index.js
+++ b/app/lib/sequence/index.js
@@ -1,581 +1,6 @@
'use strict';
let log;
let seq;
-//var seq = {};
-/******
- Sequence Object
-
-seq.i = 0;
-seq.time = 0;
-seq.stopState = false;
-
-mcopy.loop = 1; //
-mcopy.loopCount = 0;
-
-seq.queue = [];
-seq.running = false;
-seq.state = {};
-
-*******/
-/**
- * Run the sequence
-
-seq.run = function () {
- 'use strict';
- var c = mcopy.state.sequence.arr[seq.i],
- timeEnd = 0,
- rgb,
- action = function () {
- setTimeout(function () {
- seq.i++;
- seq.run();
- }, mcopy.cfg.arduino.sequenceDelay);
- }
- if (seq.i == 0) {
- $('#loop_current').text(gui.fmtZero(mcopy.loopCount + 1, 6));
- ipcRenderer.send('seq', { action : 'loop' });
- }
- if (seq.stop()) {
- $('.row input').removeClass('h');
- $('#numbers div').removeClass('h');
- log.info('Sequence stopped', 'SERIAL', true);
- return false;
- }
- if (seq.i <= mcopy.state.sequence.arr.length && c !== undefined) {
- log.info('Step ' + seq.i + ' command ' + c, 'SEQUENCE', true);
- //gui action
- $('.row input').removeClass('h');
- $('#numbers div').removeClass('h');
- $('.row input[x=' + seq.i + ']').addClass('h');
- $('#numbers div[x=' + seq.i + ']').addClass('h');
- if (c === 'CF'){
- rgb = mcopy.state.sequence.light[seq.i].split(',');
- cmd.cam_forward(rgb, action);
- } else if (c === 'CB') {
- rgb = mcopy.state.sequence.light[seq.i].split(',');
- cmd.cam_backward(rgb, action);
- } else if (c === 'PF') {
- cmd.proj_forward(action);
- } else if (c === 'PB') {
- cmd.proj_backward(action);
- } else if (c === 'BF') {
- cmd.black_forward(action);
- } else if (c === 'BB') {
- cmd.black_backward(action);
- }
- } else {
- mcopy.loopCount++;
- $('#loop_current').text(gui.fmtZero(mcopy.loopCount + 1, 6));
- if (mcopy.loopCount < mcopy.loop) {
- log.info('Loop ' + mcopy.loopCount + ' completed', 'SEQUENCE', true);
- $('.row input').removeClass('h');
- $('#numbers div').removeClass('h');
- seq.i = 0;
- seq.run();
- } else {
- timeEnd = +new Date();
- timeEnd = timeEnd - seq.time;
- if (timeEnd < 2000) {
- log.info('Sequence completed in ' + timeEnd + 'ms', 'SEQUENCE', true);
- } else {
- log.info('Sequence completed in ' + humanizeDuration(timeEnd), 'SEQUENCE', true);
- }
- ipcRenderer.send('seq', { action : 'stop' });
- gui.notify('Sequence done!', (mcopy.state.sequence.arr.length * mcopy.loop) + ' actions completed in ' + humanizeDuration(timeEnd));
- //clear gui
- $('.row input').removeClass('h');
- $('#numbers div').removeClass('h');
- $('#loop_current').text('');
- seq.stats();
- }
- }
-};
-seq.stop = function (state) {
- 'use strict';
- if (typeof state === 'undefined') {
- if (seq.stopState === true) {
- ipcRenderer.send('seq', { action : 'stop' });
- }
- return seq.stopState;
- } else {
- seq.stopState = state;
- }
- if (state === false) {
- mcopy.loopCount = 0
- $('#loop_current').text('');
- } else {
- ipcRenderer.send('seq', { action : 'stop' });
- }
- return state
-};
-seq.init = function (start) {
- 'use strict';
- if (typeof start === 'undefined') {
- start = 0;
- mcopy.loopCount = 0;
- seq.time = +new Date();
- }
- seq.stop(false);
- seq.i = start;
-
- ipcRenderer.send('seq', { action : 'start' });
- seq.run();
-};
-//!!! redo
-seq.stats = function () {
- 'use strict';
- var ms = 0,
- c = '',
- cam_total = 0,
- proj_total = 0,
- real_total = mcopy.state.sequence.arr.filter(function (elem) {
- if (elem === undefined) {
- return false;
- }
- return true;
- });
-
- //timing
- for (var i = 0; i < mcopy.state.sequence.arr.length; i++) {
- c = mcopy.state.sequence.arr[i];
- if (c === 'CF' || c === 'CB'){
- ms += mcopy.cfg.arduino.cam.time;
- ms += mcopy.cfg.arduino.cam.delay;
- ms += mcopy.cfg.arduino.serialDelay;
- }
- if (c === 'PF' || c === 'PB'){
- ms += mcopy.cfg.arduino.proj.time;
- ms += mcopy.cfg.arduino.proj.delay;
- ms += mcopy.cfg.arduino.serialDelay;
- }
- if (c === 'BF' || c === 'BB'){
- ms += mcopy.cfg.arduino.black.before;
- ms += mcopy.cfg.arduino.black.after;
- ms += mcopy.cfg.arduino.cam.time;
- ms += mcopy.cfg.arduino.cam.delay;
- ms += mcopy.cfg.arduino.serialDelay;
- }
- ms += mcopy.cfg.arduino.sequenceDelay;
-
- if (c === 'CF' || c === 'BF') {
- cam_total++;
- }
- if (c === 'CB' || c === 'BB') {
- cam_total--;
- }
- if (c === 'PF') {
- proj_total++;
- }
- if (c === 'PB') {
- proj_total--;
- }
- }
-
- //timing
- ms = ms * mcopy.loop;
- if (ms < 2000) {
- $('#seq_stats .timing span').text(ms + 'ms');
- } else {
- $('#seq_stats .timing span').text(humanizeDuration(ms));
- }
-
- //ending frames
- cam_total = cam_total * mcopy.loop;
- proj_total = proj_total * mcopy.loop;
-
- $('#seq_stats .cam_end span').text(gui.fmtZero(mcopy.state.camera.pos + cam_total, 6));
- $('#seq_stats .proj_end span').text(gui.fmtZero(mcopy.state.projector.pos + proj_total, 6));
-
- //count
- $('#seq_stats .seq_count span').text(real_total.length * mcopy.loop);
- return ms;
-};
-seq.clear = function () {
- 'use strict';
- mcopy.state.sequence.size = 24;
- mcopy.state.sequence.arr = [];
-};
-seq.exec = function (arr) {
- 'use strict';
- seq.running = true;
- seq.state.len = arr.length;
- //setup queue
- seq.queue = arr;
- //console.dir(arr);
- gui.overlay(true);
- gui.spinner(true, `Running sequence of ${arr.length} frame${(arr.length === 1 ? '' : 's')}`, 0);
- log.info(`Sequence started`, 'SEQUENCE', true);
- seq.step();
-};
-
-seq.execStop = function (msg) {
- 'use strict';
- gui.overlay(false);
- gui.spinner(false);
- log.info(`Sequence ${msg}`, 'SEQUENCE', true);
- return false;
-};
-
-seq.step = function () {
- 'use strict';
- let elem;
- let c;
- let rgb;
- let current;
- let max;
-
- if (!seq.running) {
- return seq.execStop('stopped');
- }
-
- return setTimeout(() => {
- elem = seq.queue.shift();
- if (typeof elem !== 'undefined') {
- c = elem.cmd;
- if (typeof elem.light !== 'undefined') {
- rgb = elem.light.split(',');
- } else {
- rgb = light.color;
- }
- } else {
- return seq.execStop('completed');
- }
- if (typeof elem !== 'undefined') {
- current = seq.state.len - seq.queue.length;
- max = seq.state.len;
- gui.spinner(true, `Sequence: step ${c} ${current}/${max}`, (current / max) * 100);
- log.info(`Sequence: step ${c} ${current}/${max}`, 'SEQUENCE', true);
- if (c === 'CF'){
- cmd.cam_forward(rgb, seq.step);
- } else if (c === 'CB') {
- cmd.cam_backward(rgb, seq.step);
- } else if (c === 'PF') {
- cmd.proj_forward(seq.step);
- } else if (c === 'PB') {
- cmd.proj_backward(seq.step);
- } else if (c === 'BF') {
- cmd.black_forward(seq.step);
- } else if (c === 'BB') {
- cmd.black_backward(seq.step);
- }
- }
- }, mcopy.cfg.arduino.sequenceDelay);
-};
-
-// FROM SERVER SIDE
-proj.state = {
- dir : true, //default dir
- digital : false
-}
-proj.init = function () {
- proj.listen()
-}
-proj.set = async function (dir, id) {
- let cmd
- let ms
- if (dir) {
- cmd = mcopy.cfg.arduino.cmd.proj_forward
- } else {
- cmd = mcopy.cfg.arduino.cmd.proj_backward
- }
- proj.state.dir = dir
- if (proj.state.digital) {
- dig.set(dir)
- } else {
- try {
- ms = await arduino.send('projector', cmd)
- } catch (err) {
- console.error(err)
- }
- }
- return await proj.end(cmd, id, ms)
-}
-proj.move = async function (frame, id) {
- const cmd = mcopy.cfg.arduino.cmd.projector
- let ms
- if (proj.digital) {
- try {
- ms = await dig.move()
- } catch (err) {
- console.error(err)
- }
- } else {
- try {
- ms = await arduino.send('projector', cmd)
- } catch (err) {
- console.error(err)
- }
- }
- return await proj.end(mcopy.cfg.arduino.cmd.projector, id, ms)
-}
-proj.listen = function () {
- ipcMain.on('proj', async (event, arg) => {
- if (typeof arg.dir !== 'undefined') {
- try {
- await proj.set(arg.dir, arg.id)
- } catch (err) {
- console.error(err)
- }
- } else if (typeof arg.frame !== 'undefined') {
- try {
- await proj.move(arg.frame, arg.id)
- } catch (err) {
- console.error(err)
- }
- } else if (typeof arg.val !== 'undefined') {
- dig.state.frame = arg.val
- }
- event.returnValue = true
- })
- ipcMain.on('digital', proj.connectDigital)
-}
-proj.end = async function (cmd, id, ms) {
- let message = ''
- if (cmd === mcopy.cfg.arduino.cmd.proj_forward) {
- message = 'Projector set to FORWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.proj_backward) {
- message = 'Projector set to BACKWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.projector) {
- message = 'Projector '
- if (proj.state.dir) {
- message += 'ADVANCED'
- } else {
- message += 'REWOUND'
- }
- message += ' 1 frame'
- }
- log.info(message, 'PROJECTOR', true, true)
- return await mainWindow.webContents.send('proj', {cmd: cmd, id : id, ms: ms})
-}
-proj.connectDigital = async function (evt, arg) {
- let info;
- let frames = 0;
-
- try {
- info = await ffprobe.info(arg.path);
- } catch (err) {
- log.error(err, 'DIGITAL', true, true);
- proj.digital = false;
- await mainWindow.webContents.send('digital', { valid : false });
- return false;
- }
- try {
- frames = await ffprobe.frames(arg.path);
- } catch (err) {
- log.error(err, 'DIGITAL', true, true);
- proj.digital = false;
- await mainWindow.webContents.send('digital', { valid : false });
- return false;
- }
-
- dig.state.frame = 0;
- dig.state.path = arg.path;
- dig.state.fileName = arg.fileName;
- dig.state.frames = frames;
- dig.state.info = info;
-
- //console.dir(dig.state);
-
- log.info(`Opened ${dig.state.fileName}`, 'DIGITAL', true, true);
- log.info(`Frames : ${frames}`, 'DIGITAL', true, true);
- proj.digital = true;
- return await mainWindow.webContents.send('digital', { valid : true, state : JSON.stringify(dig.state) });
-}
-
-const dig = {};
-dig.state = {
- frame : 0,
- frames : 0,
- path : null,
- fileName : null,
- info : {},
- dir : true
-};
-
-dig.set = function (dir) {
- dig.state.dir = dir;
-}
-
-dig.move = async function () {
- let start = +new Date()
- let last = dig.state.dir + 0;
- if (dig.state.dir) {
- dig.state.frame++
- } else {
- dig.state.frame--
- }
- if (dig.state.frame < 1) {
- dig.state.frame = 1
- }
- return (+new Date()) - start
-}
-
-dig.start = async function () {
- try {
- await ffmpeg.clearAll()
- } catch (err) {
- console.error(err)
- }
-
- try {
- await ffmpeg.frame(dig.state, light.state)
- } catch (err) {
- console.error(err)
- }
-
- display.start(dig.state.frame)
- await delay(20)
-}
-
-dig.end = async function () {
- await delay(20)
- display.end()
-}
-
-cam.intval = null
-cam.state = {
- dir : true //default dir
-}
-cam.init = function () {
- cam.listen()
-}
-cam.set = async function (dir, id) {
- let cmd
- let ms
- if (dir) {
- cmd = mcopy.cfg.arduino.cmd.cam_forward
- } else {
- cmd = mcopy.cfg.arduino.cmd.cam_backward
- }
- cam.state.dir = dir
-
- if (cam.intval) {
- try {
- ms = await cam.intval.setDir(dir)
- } catch (err) {
- console.error(err)
- }
- } else {
- try {
- ms = await arduino.send('camera', cmd)
- } catch (err) {
- console.error(err)
- }
- }
- return await cam.end(cmd, id, ms)
-}
-
-cam.move = async function (frame, id) {
- const cmd = mcopy.cfg.arduino.cmd.camera
- let ms
- if (proj.digital) {
- await dig.start()
- }
- if (cam.intval) {
- try {
- ms = await cam.intval.move()
- } catch (err) {
- console.error(err)
- }
- } else {
- try {
- ms = await arduino.send('camera', cmd)
- } catch (err) {
- console.error(err)
- }
- }
- if (proj.digital) {
- await dig.end()
- }
- log.info('Camera move time', { ms })
- return cam.end(cmd, id, ms)
-}
-
-cam.exposure = function (exposure, id) {
- let cmd = 'E'
- cam.intval.setExposure('camera', exposure, ms => {
- cam.end(cmd, id, ms)
- })
-}
-
-cam.connectIntval = async function (event, arg) {
- return new Promise((resolve, reject) => {
- if (arg.connect) {
- cam.intval = new Intval(arg.url)
- cam.intval.connect((err, ms, state) => {
- if (err) {
- mainWindow.webContents.send('intval', { connected : false })
- log.info(`Cannot connect to ${arg.url}`, 'INTVAL', true, true)
- cam.intval = null
- delete cam.intval
- } else {
- mainWindow.webContents.send('intval', { connected : true, url : arg.url, state : state })
- log.info(`Connected to INTVAL3 @ ${arg.url}`, 'INTVAL', true, true)
- settings.update('camera', { intval : arg.url })
- settings.save()
- dev.remember('intval', arg.url, 'camera')
- }
- return resolve(true)
- })
- } else if (arg.disconnect) {
- cam.intval = null
- return resolve(false)
- }
- })
-}
-
-cam.listen = function () {
- ipcMain.on('cam', async (event, arg) => {
- if (typeof arg.dir !== 'undefined') {
- try {
- await cam.set(arg.dir, arg.id)
- } catch (err) {
- console.error(err)
- }
- } else if (typeof arg.frame !== 'undefined') {
- try {
- await cam.move(arg.frame, arg.id)
- } catch (err) {
- console.error(err)
- }
- }
- event.returnValue = true
- })
- ipcMain.on('intval', cam.connectIntval)
-}
-cam.end = async function (cmd, id, ms) {
- var message = ''
- if (cmd === mcopy.cfg.arduino.cmd.cam_forward) {
- message = 'Camera set to FORWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.cam_backward) {
- message = 'Camera set to BACKWARD'
- } else if (cmd === mcopy.cfg.arduino.cmd.camera) {
- message = 'Camera '
- if (cam.state.dir) {
- message += 'ADVANCED'
- } else {
- message += 'REWOUND'
- }
- message += ' 1 frame'
- }
- log.info(message, 'CAMERA', true, true)
- mainWindow.webContents.send('cam', {cmd: cmd, id : id, ms: ms})
-};
-
-const seq = {};
-seq.init = function () {
- seq.listen();
-}
-
-seq.listen = function () {
- ipcMain.on('seq', async (evt, arg) => {
- if (arg.action === 'stop' && proj.digital) {
- display.end()
- }
- })
-}
-
- */
class Sequence {
constructor(cfg, cmd) {
this.cfg = cfg;
@@ -594,6 +19,7 @@ class Sequence {
* Stop the sequence
**/
stop() {
+ this.running = false;
}
exec() {
}
diff --git a/app/lib/sequence/index.js.map b/app/lib/sequence/index.js.map
index 267b8b1..903b925 100644
--- a/app/lib/sequence/index.js.map
+++ b/app/lib/sequence/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequence/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,GAAS,CAAC;AACd,IAAI,GAAc,CAAC;AAEnB,eAAe;AAEf;;;;;;;;;;;;;;QAcQ;AAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Q;IAEf,CAAC;IAED,SAAS;IACD,GAAG;IAEX,CAAC;IACO,IAAI;IAEZ,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS,EAAE,GAAS,EAAE,CAAO;IACvD,GAAG,GAAG,CAAC,CAAC;IACR,GAAG,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAA"}
\ No newline at end of file
diff --git a/app/lib/server/index.js b/app/lib/server/index.js
index 81a31e0..fd38963 100644
--- a/app/lib/server/index.js
+++ b/app/lib/server/index.js
@@ -46,13 +46,13 @@ class Server {
mcopy.log('Receiving command from mobile: ' + req.params.cmd);
cmd = req.params.cmd;
if (cmd === 'CF'){
- mcopy.cmd.cam_forward(success);
+ mcopy.cmd.camera_forward(success);
} else if (cmd === 'CB') {
- mcopy.cmd.cam_backward(success);
+ mcopy.cmd.camera_backward(success);
} else if (cmd === 'PF') {
- mcopy.cmd.proj_forward(success);
+ mcopy.cmd.projector_forward(success);
} else if (cmd === 'PB') {
- mcopy.cmd.proj_backward(success);
+ mcopy.cmd.projector_backward(success);
} else {
mcopy.mobile.fail(res, 'Command ' + cmd + ' not found');
}
diff --git a/app/lib/settings/Readme.md b/app/lib/settings/Readme.md
index e69de29..7ed0553 100644
--- a/app/lib/settings/Readme.md
+++ b/app/lib/settings/Readme.md
@@ -0,0 +1,42 @@
+
+
+## Settings
+**Kind**: global class
+
+* [Settings](#Settings)
+ * [.checkDir()](#Settings+checkDir)
+ * [.save()](#Settings+save)
+ * [.update()](#Settings+update)
+ * [.get()](#Settings+get)
+ * [.all()](#Settings+all)
+ * [.restore()](#Settings+restore)
+ * [.reset()](#Settings+reset)
+
+
+
+### settings.checkDir()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.save()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.update()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.get()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.all()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.restore()
+**Kind**: instance method of [Settings
](#Settings)
+
+
+### settings.reset()
+**Kind**: instance method of [Settings
](#Settings)
diff --git a/app/lib/ui/cam.js b/app/lib/ui/cam.js
index ae18984..5184229 100644
--- a/app/lib/ui/cam.js
+++ b/app/lib/ui/cam.js
@@ -3,6 +3,7 @@ const cam = {};
cam.queue = {};
cam.lock = false;
cam.id = 'camera';
+
cam.init = function () {
'use strict';
cam.listen();
@@ -54,9 +55,9 @@ cam.move = function (callback) {
};
cam.end = function (c, id, ms) {
'use strict';
- if (c === mcopy.cfg.arduino.cmd.cam_forward) {
+ if (c === mcopy.cfg.arduino.cmd.camera_forward) {
mcopy.state.camera.direction = true;
- } else if (c === mcopy.cfg.arduino.cmd.cam_backward) {
+ } else if (c === mcopy.cfg.arduino.cmd.camera_backward) {
mcopy.state.camera.direction = false;
} else if (c === mcopy.cfg.arduino.cmd.camera) {
if (mcopy.state.camera.direction) {
diff --git a/app/lib/ui/cmd.js b/app/lib/ui/cmd.js
index 0f06b77..3d1469d 100644
--- a/app/lib/ui/cmd.js
+++ b/app/lib/ui/cmd.js
@@ -5,7 +5,7 @@ const cmd = {};
*
* @param {function} callback Function to call after projector moves one frame
**/
-cmd.proj_forward = function (callback) {
+cmd.projector_forward = function (callback) {
'use strict';
var res = function (ms) {
$('#cmd_proj_forward').removeClass('active');
@@ -30,7 +30,7 @@ cmd.proj_forward = function (callback) {
*
* @param {function} callback Function to call after projector moves one frame
**/
-cmd.proj_backward = function (callback) {
+cmd.projector_backward = function (callback) {
'use strict';
var res = function (ms) {
$('#cmd_proj_backward').removeClass('active');
@@ -56,7 +56,7 @@ cmd.proj_backward = function (callback) {
* @param {array} rgb Color to set light for frame
* @param {function} callback Function to call after camera moves one frame
**/
-cmd.cam_forward = function (rgb, callback) {
+cmd.camera_forward = function (rgb, callback) {
'use strict';
var off = [0, 0, 0];
var res = function (ms) {
@@ -130,7 +130,7 @@ cmd.black_forward = function (callback) {
* @param {array} rgb Color to set light for frame
* @param {function} callback Function to call after camera moves one frame
**/
-cmd.cam_backward = function (rgb, callback) {
+cmd.camera_backward = function (rgb, callback) {
'use strict';
var off = [0, 0, 0];
var res = function (ms) {
@@ -208,33 +208,14 @@ cmd.black_backward = function (callback) {
*
* @param {function} callback Function to call after action
**/
-cmd.proj2_forward = function (callback) {
- 'use strict';
- var res = function (ms) {
- $('#cmd_proj2_forward').removeClass('active');
- gui.updateState();
- if (callback) { callback(ms); }
- };
- $('#cmd_proj2_forward').addClass('active');
- if (!mcopy.state.projector2.direction) {
- proj.set2(true, function (ms) {
- setTimeout(function () {
- proj.move2(res);
- }, mcopy.cfg.arduino.serialDelay);
- });
- } else {
- setTimeout(function () {
- proj.move2(res);
- }, mcopy.cfg.arduino.serialDelay);
- }
-};
-cmd.proj2_backward = function (callback) {};
+cmd.projector_second_forward = function (callback) {};
+cmd.projector_second_backward = function (callback) {};
-cmd.projs_forward = function (callback) {};
-cmd.projs_backward = function (callback) {};
+cmd.projectors_forward = function (callback) {};
+cmd.projectors_backward = function (callback) {};
-cmd.proj_forward_proj2_backward = function (callback) {};
-cmd.proj_backward_proj2_forward = function (callback) {};
+cmd.projector_forward_projector_second_backward = function (callback) {};
+cmd.projector_backward_projector_second_forward = function (callback) {};
/**
* Move the camera to a specific frame. Accepts the input with the "move_cam_to"
@@ -242,7 +223,7 @@ cmd.proj_backward_proj2_forward = function (callback) {};
*
* @param {object} t HTML input element with the move to val
**/
-cmd.cam_to = function (t) {
+cmd.camera_to = function (t) {
const raw = $('#move_cam_to').val();
const val = parseInt(raw);
let proceed = false;
@@ -276,7 +257,7 @@ cmd.cam_to = function (t) {
*
* @param {object} t HTML input element with the move to val
**/
-cmd.proj_to = function (t) {
+cmd.projector_to = function (t) {
const raw = $('#move_proj_to').val();
const val = parseInt(raw);
let proceed = false;
diff --git a/app/lib/ui/devices.js b/app/lib/ui/devices.js
index a5c1446..b5da7cc 100644
--- a/app/lib/ui/devices.js
+++ b/app/lib/ui/devices.js
@@ -219,9 +219,9 @@ devices.digitalCb = function (evt, args) {
gui.notify('DEVICES', `Using video ${state.fileName}`);
mcopy.state.sequence.arr = ['PF', 'CF'];
- gui.grid.setLight(1, color);
- gui.grid.state(0);
- gui.grid.state(1);
+ grid.setLight(1, color);
+ grid.state(0);
+ grid.state(1);
if (light.disabled) {
light.enable();
diff --git a/app/lib/ui/index.js b/app/lib/ui/index.js
index e9d9cbd..f379096 100644
--- a/app/lib/ui/index.js
+++ b/app/lib/ui/index.js
@@ -188,282 +188,4 @@ gui.warn = function (title, message) {
};
gui.error = function () {};
-/******
- Sequencer grid
-*******/
-gui.grid = {};
-gui.grid.swatchesElem = {};
-gui.grid.init = function () {
- 'use strict';
- gui.grid.refresh();
- seq.stats();
- gui.grid.events();
-};
-
-/**
- * Set a specific grid pad to the state stored in the sequence
- * array at that step
- *
- * @param {integer} i Step in sequence
- **/
-gui.grid.state = function (i) {
- 'use strict';
- const elem = $(`input[x=${i}]`);
- const lightElem = $(`.L[x=${i}]`);
- if (typeof mcopy.state.sequence.arr[i] !== 'undefined') {
- elem.prop('checked', false);
- $(`.${mcopy.state.sequence.arr[i]}[x=${i}]`).prop('checked', true);
- if (mcopy.state.sequence.arr[i] === 'CF' || mcopy.state.sequence.arr[i] === 'CB') {
- lightElem.css('background', `rgb(${mcopy.state.sequence.light[i]})`)
- .addClass('a')
- .prop('title', `rgb(${mcopy.state.sequence.light[i]})`);
-
- } else {
- lightElem.css('background', 'transparent')
- .removeClass('a')
- .prop('title', '');
- }
- } else {
- lightElem.css('background', 'transparent')
- .removeClass('a')
- .prop('title', '');
- }
-};
-/**
- * Clears the UI of the grid and restores it to the
- * state of the sequence.
- *
- **/
-gui.grid.refresh = function () {
- 'use strict';
- const cmds = ['cam_forward', 'proj_forward', 'cam_backward', 'proj_backward', 'light_set', 'numbers'];
- const check = '';
- const div = '';
- const width = 970 - 34 + ((940 / 24) * Math.abs(24 - mcopy.state.sequence.size));
- let elem;
-
- $('#sequence').width(`${width}px`);
- for (let i = 0; i < cmds.length; i++) {
- $('#' + cmds[i]).empty();
- for (let x = 0; x < mcopy.state.sequence.size; x++) {
- if (i === cmds.length - 1) {
- elem = div.replace('xxxx', x);
- $('#' + 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]]));
- } else {
- elem = check.replace('xxxx', x);
- $('#' + cmds[i]).append($(elem).addClass(mcopy.state.sequence.pads[cmds[i]]));
- }
- gui.grid.state(x);
- }
- }
-};
-/**
- * Function bound to click on grid pad elements
- *
- * @param {object} t This, passed from clicked element
- **/
-gui.grid.click = function (t) {
- 'use strict';
- const i = parseInt($(t).attr('x'));
- let c;
- if ($(t).prop('checked')) {
- c = $(t).attr('class').replace('.', '');
- mcopy.state.sequence.arr[i] = c;
- if (c === 'CF' || c === 'CB') {
- mcopy.state.sequence.light[i] = light.color.join(',');
- } else {
- mcopy.state.sequence.light[i] = '';
- }
- } else {
- mcopy.state.sequence.arr[i] = undefined;
- delete mcopy.state.sequence.arr[i];
- }
- gui.grid.state(i);
- seq.stats();
-};
-/**
- * Clears the state of the sequence and then refreshes
- * the grid and then recalculates the stats on the sequence
- **/
-gui.grid.clear = function () {
- 'use strict';
- const doit = confirm('Are you sure you want to clear this sequence?');
- if (doit) {
- seq.clear();
- gui.grid.refresh();
- seq.stats();
- console.log('Sequencer cleared');
- }
-};
-/**
- * Function bound to the change event on the loop counter
- * input element
- *
- * @param {object} t This, passed from changed element
- */
-gui.grid.loopChange = function (t) {
- 'use strict';
- const count = parseInt(t.value);
- mcopy.loop = count;
- seq.stats();
-};
-/**
- * Add 24 frames to the sequence in the GUI
- **/
-gui.grid.plus_24 = function () {
- 'use strict';
- mcopy.state.sequence.size += 24;
- gui.grid.refresh();
- console.log(`Sequencer expanded to ${mcopy.state.sequence.size} steps`);
-};
-/**
- * Set the light value at a specific step and then update
- * GUI grid via .state()
- *
- * @param {integer} x Step in sequence
- * @param {array} rgb Light value in RGB
- **/
-gui.grid.setLight = function (x, rgb) {
- 'use strict';
- mcopy.state.sequence.light[x] = rgb.join(',');
- gui.grid.state(x);
-};
-/**
- * Set light value to black (0,0,0) when double clicked
- *
- * @param {object} t This, passed from clicked element
- **/
-gui.grid.blackout = function (t) {
- const elem = $(t);
- const i = elem.attr('x');
- if (typeof mcopy.state.sequence.light[i] === 'undefined') {
- return false;
- }
- if (mcopy.state.sequence.light[i] === '0,0,0') {
- gui.grid.setLight(i, light.color);
- } else {
- gui.grid.setLight(i, [0, 0, 0]);
- }
-};
-
-/**
- * Change all lights at all camera commands to a specific
- * RGB value
- *
- * @param {array} rgb RGB value [255. 255, 255]
- */
-gui.grid.changeAll = function (rgb) {
- 'use strict';
- for (let [i, c] of mcopy.state.sequence.arr.entries()) {
- if (c === 'CF' || c === 'CB') {
- gui.grid.setLight(i, rgb);
- }
- }
-};
-/**
- * Display color swatch modal for selection of light
- * color value at specific step
- *
- * @param {integer} x Position in sequence to change value
- **/
-gui.grid.swatches = function (x) {
- 'use strict';
- const current = mcopy.state.sequence.light[x];
- gui.grid.swatchesElem = w2popup.open({
- title : 'Select Color',
- body : $('#light-swatches').html(),
- buttons : '