Merge remote-tracking branch 'origin/master'

This commit is contained in:
mmcwilliams 2019-03-21 15:08:54 -04:00
commit 6faf78b92e
6 changed files with 128 additions and 24 deletions

View File

@ -273,17 +273,17 @@ class Arduino {
type = 'projector_second';
}
else if (data === cfg.ardino.cmd.proj_dual_identifier) {
type = 'projectors';
type = 'projector,projector_second';
}
else if (data === cfg.ardino.cmd.cam_second_identifier) {
type = 'camera_second';
}
else if (data === cfg.ardino.cmd.cam_dual_identifier) {
type = 'cameras';
type = 'camera,camera_second';
}
//camera,projectors
//cameras,projector
//cameras,projectors
//camera,projector,projector_second
//camera,camera_second,projector
//camera,camera_second,projector,projector_second
return resolve(type);
};
await delay(cfg.arduino.serialDelay);

View File

@ -202,16 +202,39 @@ cmd.black_backward = function (callback) {
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'
*/
/**
* Move the secondary projector forward one frame
*
* @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.projs_forward = function (callback) {};
cmd.projs_backward = function (callback) {};
cmd.proj_forward_proj2_backward = function (callback) {};
cmd.proj_backward_proj2_forward = function (callback) {};
/**
* Move the camera to a specific frame. Accepts the input with the "move_cam_to"

View File

@ -2,6 +2,7 @@ var proj = {};
proj.queue = {};
proj.lock = false;
proj.lock2 = false;
proj.init = function () {
'use strict';
proj.listen();
@ -42,6 +43,64 @@ proj.move = function (callback) {
proj.queue[obj.id] = obj;
proj.lock = true;
};
proj.set2 = function (dir, callback) {
'use strict';
var obj;
if (proj.lock2) {
return false;
}
obj = {
dir : dir,
second : true,
id : uuid.v4()
};
ipcRenderer.sendSync('proj', obj);
if (typeof callback !== 'undefined') {
obj.callback = callback;
}
proj.queue[obj.id] = obj;
proj.lock2 = true;
};
proj.move2 = function (callback) {
'use strict';
var obj;
if (proj2.lock) {
return false;
}
obj = {
frame : true,
second : true,
id : uuid.v4()
};
ipcRenderer.sendSync('proj', obj);
if (typeof callback !== 'undefined') {
obj.callback = callback;
}
proj.queue[obj.id] = obj;
proj.lock2 = true;
};
proj.both = function (callback) {
'use strict';
var obj;
if (proj.lock || proj2.lock) {
return false;
}
obj = {
frame : true,
both : true,
id : uuid.v4()
};
ipcRenderer.sendSync('proj', obj);
if (typeof callback !== 'undefined') {
obj.callback = callback;
}
proj.queue[obj.id] = obj;
proj.lock = true;
proj.lock2 = true;
}
proj.end = function (c, id, ms) {
'use strict';
if (c === mcopy.cfg.arduino.cmd.proj_forward) {
@ -55,6 +114,7 @@ proj.end = function (c, id, ms) {
mcopy.state.projector.pos -= 1;
}
}
//
if (typeof proj.queue[id] !== 'undefined') {
if (typeof proj.queue[id].callback !== 'undefined') {
proj.queue[id].callback(ms);
@ -78,6 +138,16 @@ proj.setValue = function (val) {
id : uuid.v4()
};
ipcRenderer.sendSync('proj', obj);
}
};
proj.setValue2 = function (val) {
'use strict';
var obj = {
val: val,
second : true,
id : uuid.v4()
};
ipcRenderer.sendSync('proj', obj);
};
module.exports = proj;

View File

@ -472,20 +472,23 @@ var init = async function () {
mcopy.settings = await settings.all()
log.init()
dev.init()
seq.init()
display = require('display')(SYSTEM)
ffmpeg = require('ffmpeg')(SYSTEM)
ffprobe = require('ffprobe')(SYSTEM)
arduino = require('arduino')(mcopy.cfg, ee)
mscript = require('mscript')
dig = require('digital')(display, ffmpeg, ffprobe)
cam = require('cam')(arduino, mcopy.cfg, mainWindow.webContents, dig)
proj = require('proj')(arduino, mcopy.cfg, mainWindow.webContents, dig)
light = require('light')(arduino, mcopy.cfg, mainWindow.webContents)
//dev
//cmd
//seq
await delay(2000)
try {

View File

@ -36,16 +36,18 @@ mcopy.state = {
pos : 0,
direction: true
},
camera_second : {
pos : 0,
direction : true
},
projector_second : {
pos : 0,
direction : true
}
sequence : {
size : 24,
arr : ['CF', 'PF'],
light : ['255,255,255', ''],
cmd : {
camera: mcopy.cfg.arduino.cmd.camera,
projector: mcopy.cfg.arduino.cmd.projector,
cam_direction: mcopy.cfg.arduino.cmd.cam_direction,
cam_direction: mcopy.cfg.arduino.cmd.proj_direction
},
pads: {
cam_forward: 'CF',
proj_forward : 'PF',

View File

@ -14,4 +14,10 @@ module measurement_bar (X = 20 * IN, Y = 16.4, Z = 3, BOLT = 4, BOLT_OFFSET = (3
}
}
projection() measurement_bar();
projection() {
difference () {
measurement_bar();
translate([-11 * IN, 0, 0]) cube([20 * IN, 16.5, 4], center = true);
translate([11 * IN, 0, 0]) cube([20 * IN, 16.5, 4], center = true);
}
}