Merge remote-tracking branch 'origin/master'

This commit is contained in:
mmcwilliams 2019-03-19 22:33:23 -04:00
commit d308b8a59e
31 changed files with 516 additions and 113 deletions

View File

@ -829,6 +829,21 @@ button:focus {
color: #fff; color: #fff;
text-shadow: 1px 1px 2px #000; text-shadow: 1px 1px 2px #000;
} }
#spinnerCancel {
display: none;
position: absolute;
z-index: 2000000000;
left: 50%;
top: 50%;
text-align: center;
margin-left: -40%;
margin-top: 120px;
width: 80%;
}
#spinnerCancel .btn {
margin: 0 auto;
background: rgba(80, 80, 80, 0.4);
}
.cp-app { .cp-app {
position: relative !important; position: relative !important;
border-radius: 0px !important; border-radius: 0px !important;

View File

@ -118,12 +118,20 @@
"proj_light_identifier" : "q", "proj_light_identifier" : "q",
"proj_cam_light_identifier" : "r", "proj_cam_light_identifier" : "r",
"proj_cam_identifier" : "s", "proj_cam_identifier" : "s",
"proj_second_identifier" : "t", "proj_second_identifier" : "t",
"proj_dual_identifier" : "d", "proj_dual_identifier" : "d",
"proj_second_forward" : "u", "proj_second_forward" : "u",
"proj_second_backward" : "v", "proj_second_backward" : "v",
"projector_second" : "w", "projector_second" : "w",
"projectors" : "x" "projectors" : "x",
"cam_second_identifier" : "y",
"cam_dual_identifier" : "a",
"cam_second_forward" : "1",
"cam_second_backward" : "2",
"camera_second" : "3",
"cameras" : "4"
} }
} }
} }

View File

@ -302,10 +302,14 @@
<div id="overlay" onclick="gui.overlay(false);gui.spinner(false);"></div> <div id="overlay" onclick="gui.overlay(false);gui.spinner(false);"></div>
<div id="spinner"> <div id="spinner">
<div id="spinnerMsg"></div> <div id="spinnerMsg"></div>
<div id="spinnerCancel">
<div class="btn" style="margin:auto;" onclick="seq.cancel();">Cancel</div>
</div>
<div id="spinnerProgress" class="progress"> <div id="spinnerProgress" class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"> <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only">0% Complete</span> <span class="sr-only">0% Complete</span>
</div> </div>
</div> </div>
</div> </div>
<script src="./js/app.js"></script> <script src="./js/app.js"></script>

View File

@ -158,6 +158,22 @@
text-shadow: 1px 1px 2px #000; text-shadow: 1px 1px 2px #000;
} }
#spinnerCancel{
display:none;
position: absolute;
z-index: 2000000000;
left: 50%;
top: 50%;
text-align: center;
margin-left: -40%;
margin-top: 120px;
width: 80%;
.btn{
margin: 0 auto;
background: rgba(80,80,80, 0.4);
}
}
.cp-app{ .cp-app{
position: relative !important; position: relative !important;
border-radius: 0px !important; border-radius: 0px !important;

View File

@ -1,23 +1,82 @@
## Classes
<dl>
<dt><a href="#Arduino">Arduino</a></dt>
<dd><p>Class representing the arduino communication features</p>
</dd>
</dl>
## Functions ## Functions
<dl> <dl>
<dt><a href="#delay">delay(ms)</a><code>Promise</code></dt> <dt><a href="#delay">delay(ms)</a><code>Promise</code></dt>
<dd><p>Pause the process for X milliseconds in async/await functions</p> <dd><p>Pause the process for X milliseconds in async/await functions</p>
</dd> </dd>
<dt><a href="#send">send(device, cmd)</a><code>Promise</code></dt>
<dd><p>Send a command to an Arduino using async/await</p>
</dd>
<dt><a href="#write">write(device, str)</a><code>Promise</code></dt>
<dd><p>Send a string to an Arduino using async/await</p>
</dd>
<dt><a href="#open">open(device)</a><code>Promise</code></dt>
<dd><p>Connect to an Arduino using async/await</p>
</dd>
<dt><a href="#close">close(device)</a><code>Promise</code></dt>
<dd><p>Close a connection to an Arduino using async/await</p>
</dd>
</dl> </dl>
<a name="Arduino"></a>
## Arduino
Class representing the arduino communication features
**Kind**: global class
* [Arduino](#Arduino)
* [.sendAsync(device, cmd)](#Arduino+sendAsync) ⇒ <code>Promise</code>
* [.writeAsync(device, str)](#Arduino+writeAsync) ⇒ <code>Promise</code>
* [.openArduino(device)](#Arduino+openArduino) ⇒ <code>Promise</code>
* [.closeArduino(device)](#Arduino+closeArduino) ⇒ <code>Promise</code>
<a name="Arduino+sendAsync"></a>
### arduino.sendAsync(device, cmd) ⇒ <code>Promise</code>
Send a command to an Arduino using async/await
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
**Returns**: <code>Promise</code> - Resolves after sending
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
| cmd | <code>string</code> | Single character command to send |
<a name="Arduino+writeAsync"></a>
### arduino.writeAsync(device, str) ⇒ <code>Promise</code>
Send a string to an Arduino using async/await
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
**Returns**: <code>Promise</code> - Resolves after sending
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
| str | <code>string</code> | String to send |
<a name="Arduino+openArduino"></a>
### arduino.openArduino(device) ⇒ <code>Promise</code>
Connect to an Arduino using async/await
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
**Returns**: <code>Promise</code> - Resolves after opening
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
<a name="Arduino+closeArduino"></a>
### arduino.closeArduino(device) ⇒ <code>Promise</code>
Close a connection to an Arduino using async/await
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
**Returns**: <code>Promise</code> - Resolves after closing
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
<a name="delay"></a> <a name="delay"></a>
## delay(ms) ⇒ <code>Promise</code> ## delay(ms) ⇒ <code>Promise</code>
@ -30,53 +89,3 @@ Pause the process for X milliseconds in async/await functions
| --- | --- | --- | | --- | --- | --- |
| ms | <code>integer</code> | milliseconds | | ms | <code>integer</code> | milliseconds |
<a name="send"></a>
## send(device, cmd) ⇒ <code>Promise</code>
Send a command to an Arduino using async/await
**Kind**: global function
**Returns**: <code>Promise</code> - Resolves after sending
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
| cmd | <code>string</code> | Single character command to send |
<a name="write"></a>
## write(device, str) ⇒ <code>Promise</code>
Send a string to an Arduino using async/await
**Kind**: global function
**Returns**: <code>Promise</code> - Resolves after sending
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
| str | <code>string</code> | String to send |
<a name="open"></a>
## open(device) ⇒ <code>Promise</code>
Connect to an Arduino using async/await
**Kind**: global function
**Returns**: <code>Promise</code> - Resolves after opening
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |
<a name="close"></a>
## close(device) ⇒ <code>Promise</code>
Close a connection to an Arduino using async/await
**Kind**: global function
**Returns**: <code>Promise</code> - Resolves after closing
| Param | Type | Description |
| --- | --- | --- |
| device | <code>string</code> | Arduino identifier |

View File

@ -216,7 +216,19 @@ class Arduino {
|| data === cfg.arduino.cmd.light_identifier || data === cfg.arduino.cmd.light_identifier
|| data === cfg.arduino.cmd.proj_light_identifier || data === cfg.arduino.cmd.proj_light_identifier
|| data === cfg.arduino.cmd.proj_cam_light_identifier || data === cfg.arduino.cmd.proj_cam_light_identifier
|| data === cfg.arduino.cmd.proj_cam_identifier) { || data === cfg.arduino.cmd.proj_cam_identifier
|| data === cfg.arduino.cmd.proj_second_identifier
|| data === cfg.arduino.cmd.proj_dual_identifier
|| data === cfg.arduino.cmd.proj_second_forward
|| data === cfg.arduino.cmd.proj_second_backward
|| data === cfg.arduino.cmd.projector_second
|| data === cfg.arduino.cmd.projectors
|| data === cfg.arduino.cmd.cam_second_identifier
|| data === cfg.arduino.cmd.cam_dual_identifier
|| data === cfg.arduino.cmd.cam_second_forward
|| data === cfg.arduino.cmd.cam_second_backward
|| data === cfg.arduino.cmd.camera_second
|| data === cfg.arduino.cmd.cameras) {
this.confirmExec(null, data); this.confirmExec(null, data);
this.confirmExec = {}; this.confirmExec = {};
} }
@ -270,6 +282,18 @@ class Arduino {
else if (data === cfg.ardino.cmd.proj_second_identifier) { else if (data === cfg.ardino.cmd.proj_second_identifier) {
type = 'projector_second'; type = 'projector_second';
} }
else if (data === cfg.ardino.cmd.proj_dual_identifier) {
type = 'projectors';
}
else if (data === cfg.ardino.cmd.cam_second_identifier) {
type = 'camera_second';
}
else if (data === cfg.ardino.cmd.cam_dual_identifier) {
type = 'cameras';
}
//camera,projectors
//cameras,projector
//cameras,projectors
return resolve(type); return resolve(type);
}; };
await delay(cfg.arduino.serialDelay); await delay(cfg.arduino.serialDelay);

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@ async function frame (state, light) {
tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`); tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`);
cmd = `ffmpeg -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`;
cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`;
//ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg" //ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg"

8
app/lib/log/Readme.md Normal file
View File

@ -0,0 +1,8 @@
<a name="logFile"></a>
## logFile() ⇒ <code>string</code>
Determine the location of the log file based on the operating system
and return as an absolute string from os.homedir()
**Kind**: global function
**Returns**: <code>string</code> - Path to log file

View File

@ -6,14 +6,24 @@ const fs = require('fs-extra');
const os = require('os'); const os = require('os');
const logTime = 'MM/DD/YY-HH:mm:ss'; const logTime = 'MM/DD/YY-HH:mm:ss';
let transport; let transport;
/**
* Determine the location of the log file based on the operating system
* and return as an absolute string from os.homedir()
*
* @returns {string} Path to log file
**/
async function logFile() { async function logFile() {
const homeDir = os.homedir();
const linuxDir = `/.config/mcopy-cli/`;
const macDir = `/Library/Logs/mcopy-cli/`;
const winDir = `/AppData/Roaming/mcopy-cli/`;
let logPath = path.join(homeDir, linuxDir);
let exists; let exists;
let logPath = path.join(os.homedir(), `/.config/mcopy-cli/`);
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
logPath = path.join(os.homedir(), `/Library/Logs/mcopy-cli/`); logPath = path.join(homeDir, macDir);
} }
else if (process.platform === 'win32') { else if (process.platform === 'win32') {
logPath = path.join(os.homedir(), `/AppData/Roaming/mcopy-cli/`); logPath = path.join(homeDir, winDir);
} }
exists = await fs.exists(logPath); exists = await fs.exists(logPath);
if (!exists) { if (!exists) {
@ -21,6 +31,14 @@ async function logFile() {
} }
return path.join(logPath, 'mcopy-cli.log'); return path.join(logPath, 'mcopy-cli.log');
} }
/**
* Create and return the logger transport based on settings determined in
* arguments object
*
* @param {object} arg Arguments from process
*
* @returns {object} Logger transport
**/
module.exports = async function (arg) { module.exports = async function (arg) {
if (arg.quiet) { if (arg.quiet) {
transport = { transport = {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAC/D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;AACpD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,OAAO,GAAG,mBAAmB,CAAA;AACnC,IAAI,SAAe,CAAA;AAEnB,KAAK,UAAU,OAAO;IACrB,IAAI,MAAgB,CAAA;IACpB,IAAI,OAAO,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C;AAC5C,CAAC;AACD;;;;;;;IAOI;AACJ,MAAM,CAAC,OAAO,GAAG,KAAK,WAAW,GAAS;IACzC,IAAI,GAAG,CAAC,KAAK,EAAE;QACd,SAAS,GAAG;YACX,IAAI,EAAG,cAAa,CAAC;YACrB,IAAI,EAAG,cAAa,CAAC;YACrB,KAAK,EAAG,cAAa,CAAC;SACtB,CAAA;KACD;SAAM;QACN,SAAS,GAAG,YAAY,CAAC;YACxB,UAAU,EAAE;gBACX,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACxB,MAAM,EAAE,OAAO,CACd,MAAM,CAAC,QAAQ,EAAE,EACjB,MAAM,CAAC,MAAM,EAAE,CACf;iBACD,CAAC;gBACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;oBACrB,QAAQ,EAAE,MAAM,OAAO,EAAE;iBACzB,CAAC;aACF;SACD,CAAC,CAAA;KACF;IACD,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA"}

View File

@ -53,6 +53,7 @@ cmd.proj_backward = function (callback) {
/** /**
* Move the camera one frame forward * Move the camera one frame forward
* *
* @param {array} rgb Color to set light for frame
* @param {function} callback Function to call after camera moves one frame * @param {function} callback Function to call after camera moves one frame
**/ **/
cmd.cam_forward = function (rgb, callback) { cmd.cam_forward = function (rgb, callback) {
@ -89,6 +90,11 @@ cmd.cam_forward = function (rgb, callback) {
}); });
} }
}; };
/**
* Move the camera one frame forward, light set to black or off
*
* @param {function} callback Function to call after camera moves one frame
**/
cmd.black_forward = function (callback) { cmd.black_forward = function (callback) {
'use strict'; 'use strict';
var off = [0, 0, 0]; var off = [0, 0, 0];
@ -118,6 +124,12 @@ cmd.black_forward = function (callback) {
}); });
} }
}; };
/**
* Move the camera one frame backward
*
* @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.cam_backward = function (rgb, callback) {
'use strict'; 'use strict';
var off = [0, 0, 0]; var off = [0, 0, 0];
@ -148,6 +160,11 @@ cmd.cam_backward = function (rgb, callback) {
}, mcopy.cfg.arduino.serialDelay); }, mcopy.cfg.arduino.serialDelay);
} }
}; };
/**
* Move the camera one frame forward, light set to black or off
*
* @param {function} callback Function to call after camera moves one frame
**/
cmd.black_backward = function (callback) { cmd.black_backward = function (callback) {
'use strict'; 'use strict';
var off = [0, 0, 0]; var off = [0, 0, 0];
@ -175,7 +192,12 @@ cmd.black_backward = function (callback) {
}, mcopy.cfg.arduino.serialDelay); }, mcopy.cfg.arduino.serialDelay);
} }
}; };
/**
* Move the camera to a specific frame. Accepts the input with the "move_cam_to"
* value. Moves as black frames to prevent multiple exposure.
*
* @param {object} t HTML input element with the move to val
**/
cmd.cam_to = function (t) { cmd.cam_to = function (t) {
const raw = $('#move_cam_to').val(); const raw = $('#move_cam_to').val();
const val = parseInt(raw); const val = parseInt(raw);

View File

@ -223,6 +223,10 @@ devices.digitalCb = function (evt, args) {
gui.grid.state(0); gui.grid.state(0);
gui.grid.state(1); gui.grid.state(1);
if (light.disabled) {
light.enable();
}
$('#seq_loop').val(`${state.frames}`).trigger('change'); $('#seq_loop').val(`${state.frames}`).trigger('change');
gui.updateState(); gui.updateState();

View File

@ -106,7 +106,7 @@ gui.spinnerCfg = {
top: '50%', // Top position relative to parent top: '50%', // Top position relative to parent
left: '50%' // Left position relative to parent left: '50%' // Left position relative to parent
}; };
gui.spinner = function (state, msg, progress) { gui.spinner = function (state, msg, progress, cancel) {
'use strict'; 'use strict';
let target; let target;
let spinner; let spinner;
@ -128,6 +128,11 @@ gui.spinner = function (state, msg, progress) {
if (progress) { if (progress) {
gui.spinnerProgress(progress); gui.spinnerProgress(progress);
} }
if (cancel) {
$('#spinnerCancel').show();
} else {
$('#spinnerCancel').hide();
}
}; };
gui.spinnerMsg = function (msg) { gui.spinnerMsg = function (msg) {
'use strict'; 'use strict';

View File

@ -13,6 +13,36 @@ mcopy.loopCount = 0;
capture.active = false; capture.active = false;
capture.report = ''; capture.report = '';
seq.cmds = {
cam_forward : 'CF',
cam_backward : 'CB',
proj_forward : 'PF',
proj_backward : 'PB',
black_forward : 'BF',
black_backward : 'BB',
//dual commands
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'
}
seq.run = function () { seq.run = function () {
'use strict'; 'use strict';
var c = mcopy.state.sequence.arr[seq.i], var c = mcopy.state.sequence.arr[seq.i],
@ -211,11 +241,16 @@ seq.exec = function (arr) {
seq.queue = arr; seq.queue = arr;
//console.dir(arr); //console.dir(arr);
gui.overlay(true); gui.overlay(true);
gui.spinner(true, `Running sequence of ${arr.length} frame${(arr.length === 1 ? '' : 's')}`, 0); gui.spinner(true, `Running sequence of ${arr.length} frame${(arr.length === 1 ? '' : 's')}`, 0, true);
log.info(`Sequence started`, 'SEQUENCE', true); log.info(`Sequence started`, 'SEQUENCE', true);
seq.step(); seq.step();
}; };
seq.cancel = function () {
gui.spinner(true, `Cancelling sequence...`);
seq.running = false;
}
seq.execStop = function (msg) { seq.execStop = function (msg) {
'use strict'; 'use strict';
gui.overlay(false); gui.overlay(false);
@ -251,7 +286,7 @@ seq.step = function () {
if (typeof elem !== 'undefined') { if (typeof elem !== 'undefined') {
current = seq.state.len - seq.queue.length; current = seq.state.len - seq.queue.length;
max = seq.state.len; max = seq.state.len;
gui.spinner(true, `Sequence: step ${c} ${current}/${max}`, (current / max) * 100); gui.spinner(true, `Sequence: step ${c} ${current}/${max}`, (current / max) * 100, true);
log.info(`Sequence: step ${c} ${current}/${max}`, 'SEQUENCE', true); log.info(`Sequence: step ${c} ${current}/${max}`, 'SEQUENCE', true);
if (c === 'CF'){ if (c === 'CF'){
cmd.cam_forward(rgb, seq.step); cmd.cam_forward(rgb, seq.step);

View File

@ -667,9 +667,11 @@ cam.move = async function (frame, id) {
return cam.end(cmd, id, ms) return cam.end(cmd, id, ms)
} }
cam.exposure = function (exposure, id) { cam.exposure = function (exposure, id) {
let cmd = 'E' let cmd = 'E'
cam.intval.setDir('camera', exposure, ms => { cam.intval.setExposure('camera', exposure, ms => {
cam.end(cmd, id, ms) cam.end(cmd, id, ms)
}) })
} }

16
app/package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.2.3", "version": "1.2.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -1417,9 +1417,9 @@
} }
}, },
"decompress-zip": { "decompress-zip": {
"version": "0.3.0", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.3.0.tgz", "resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.3.2.tgz",
"integrity": "sha1-rjvLfjTGWHmt/nfhnDD4ZgK0vbA=", "integrity": "sha512-Ab1QY4LrWMrUuo53lLnmGOby7v8ryqxJ+bKibKSiPisx+25mhut1dScVBXAYx14i/PqSrFZvR2FRRazhLbvL+g==",
"requires": { "requires": {
"binary": "^0.3.0", "binary": "^0.3.0",
"graceful-fs": "^4.1.3", "graceful-fs": "^4.1.3",
@ -4796,11 +4796,11 @@
"integrity": "sha1-dVSm+Nhxg0zJe1RisSLEwSTW3pE=" "integrity": "sha1-dVSm+Nhxg0zJe1RisSLEwSTW3pE="
}, },
"mksnapshot": { "mksnapshot": {
"version": "0.3.4", "version": "0.3.5",
"resolved": "https://registry.npmjs.org/mksnapshot/-/mksnapshot-0.3.4.tgz", "resolved": "https://registry.npmjs.org/mksnapshot/-/mksnapshot-0.3.5.tgz",
"integrity": "sha512-FgUTiWiY+35LgL95P/MDYrBuQO5o0s3MmaWKX6ZJWoX4vMOY9vPsAv763l1OSSelL9jPsBQ/wf4bzfqTLNPSFg==", "integrity": "sha512-PSBoZaj9h9myC3uRRW62RxmX8mrN3XbOkMEyURUD7v5CeJgtYTar50XU738t7Q0LtG1pBPtp5n5QwDGggRnEvw==",
"requires": { "requires": {
"decompress-zip": "0.3.0", "decompress-zip": "0.3.x",
"fs-extra": "0.26.7", "fs-extra": "0.26.7",
"request": "2.x" "request": "2.x"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.2.3", "version": "1.2.4",
"description": "GUI for the mcopy small gauge film optical printer platform", "description": "GUI for the mcopy small gauge film optical printer platform",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@ -216,7 +216,19 @@ class Arduino {
|| data === cfg.arduino.cmd.light_identifier || data === cfg.arduino.cmd.light_identifier
|| data === cfg.arduino.cmd.proj_light_identifier || data === cfg.arduino.cmd.proj_light_identifier
|| data === cfg.arduino.cmd.proj_cam_light_identifier || data === cfg.arduino.cmd.proj_cam_light_identifier
|| data === cfg.arduino.cmd.proj_cam_identifier) { || data === cfg.arduino.cmd.proj_cam_identifier
|| data === cfg.arduino.cmd.proj_second_identifier
|| data === cfg.arduino.cmd.proj_dual_identifier
|| data === cfg.arduino.cmd.proj_second_forward
|| data === cfg.arduino.cmd.proj_second_backward
|| data === cfg.arduino.cmd.projector_second
|| data === cfg.arduino.cmd.projectors
|| data === cfg.arduino.cmd.cam_second_identifier
|| data === cfg.arduino.cmd.cam_dual_identifier
|| data === cfg.arduino.cmd.cam_second_forward
|| data === cfg.arduino.cmd.cam_second_backward
|| data === cfg.arduino.cmd.camera_second
|| data === cfg.arduino.cmd.cameras) {
this.confirmExec(null, data); this.confirmExec(null, data);
this.confirmExec = {}; this.confirmExec = {};
} }
@ -270,6 +282,18 @@ class Arduino {
else if (data === cfg.ardino.cmd.proj_second_identifier) { else if (data === cfg.ardino.cmd.proj_second_identifier) {
type = 'projector_second'; type = 'projector_second';
} }
else if (data === cfg.ardino.cmd.proj_dual_identifier) {
type = 'projectors';
}
else if (data === cfg.ardino.cmd.cam_second_identifier) {
type = 'camera_second';
}
else if (data === cfg.ardino.cmd.cam_dual_identifier) {
type = 'cameras';
}
//camera,projectors
//cameras,projector
//cameras,projectors
return resolve(type); return resolve(type);
}; };
await delay(cfg.arduino.serialDelay); await delay(cfg.arduino.serialDelay);

File diff suppressed because one or more lines are too long

View File

@ -6,14 +6,24 @@ const fs = require('fs-extra');
const os = require('os'); const os = require('os');
const logTime = 'MM/DD/YY-HH:mm:ss'; const logTime = 'MM/DD/YY-HH:mm:ss';
let transport; let transport;
/**
* Determine the location of the log file based on the operating system
* and return as an absolute string from os.homedir()
*
* @returns {string} Path to log file
**/
async function logFile() { async function logFile() {
const homeDir = os.homedir();
const linuxDir = `/.config/mcopy-cli/`;
const macDir = `/Library/Logs/mcopy-cli/`;
const winDir = `/AppData/Roaming/mcopy-cli/`;
let logPath = path.join(homeDir, linuxDir);
let exists; let exists;
let logPath = path.join(os.homedir(), `/.config/mcopy-cli/`);
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
logPath = path.join(os.homedir(), `/Library/Logs/mcopy-cli/`); logPath = path.join(homeDir, macDir);
} }
else if (process.platform === 'win32') { else if (process.platform === 'win32') {
logPath = path.join(os.homedir(), `/AppData/Roaming/mcopy-cli/`); logPath = path.join(homeDir, winDir);
} }
exists = await fs.exists(logPath); exists = await fs.exists(logPath);
if (!exists) { if (!exists) {
@ -21,6 +31,14 @@ async function logFile() {
} }
return path.join(logPath, 'mcopy-cli.log'); return path.join(logPath, 'mcopy-cli.log');
} }
/**
* Create and return the logger transport based on settings determined in
* arguments object
*
* @param {object} arg Arguments from process
*
* @returns {object} Logger transport
**/
module.exports = async function (arg) { module.exports = async function (arg) {
if (arg.quiet) { if (arg.quiet) {
transport = { transport = {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAA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E;QAClC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACrC;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACxC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACrC;IACD,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,EAAE;QACZ,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KACxB;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAC5C,CAAC;AACD;;;;;;;IAOI;AACJ,MAAM,CAAC,OAAO,GAAG,KAAK,WAAW,GAAS;IACzC,IAAI,GAAG,CAAC,KAAK,EAAE;QACd,SAAS,GAAG;YACX,IAAI,EAAG,cAAa,CAAC;YACrB,IAAI,EAAG,cAAa,CAAC;YACrB,KAAK,EAAG,cAAa,CAAC;SACtB,CAAA;KACD;SAAM;QACN,SAAS,GAAG,YAAY,CAAC;YACxB,UAAU,EAAE;gBACX,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACxB,MAAM,EAAE,OAAO,CACd,MAAM,CAAC,QAAQ,EAAE,EACjB,MAAM,CAAC,MAAM,EAAE,CACf;iBACD,CAAC;gBACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;oBACrB,QAAQ,EAAE,MAAM,OAAO,EAAE;iBACzB,CAAC;aACF;SACD,CAAC,CAAA;KACF;IACD,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA"}

View File

@ -216,7 +216,19 @@ class Arduino {
|| data === cfg.arduino.cmd.light_identifier || data === cfg.arduino.cmd.light_identifier
|| data === cfg.arduino.cmd.proj_light_identifier || data === cfg.arduino.cmd.proj_light_identifier
|| data === cfg.arduino.cmd.proj_cam_light_identifier || data === cfg.arduino.cmd.proj_cam_light_identifier
|| data === cfg.arduino.cmd.proj_cam_identifier) { || data === cfg.arduino.cmd.proj_cam_identifier
|| data === cfg.arduino.cmd.proj_second_identifier
|| data === cfg.arduino.cmd.proj_dual_identifier
|| data === cfg.arduino.cmd.proj_second_forward
|| data === cfg.arduino.cmd.proj_second_backward
|| data === cfg.arduino.cmd.projector_second
|| data === cfg.arduino.cmd.projectors
|| data === cfg.arduino.cmd.cam_second_identifier
|| data === cfg.arduino.cmd.cam_dual_identifier
|| data === cfg.arduino.cmd.cam_second_forward
|| data === cfg.arduino.cmd.cam_second_backward
|| data === cfg.arduino.cmd.camera_second
|| data === cfg.arduino.cmd.cameras) {
this.confirmExec(null, data); this.confirmExec(null, data);
this.confirmExec = {}; this.confirmExec = {};
} }
@ -270,6 +282,18 @@ class Arduino {
else if (data === cfg.ardino.cmd.proj_second_identifier) { else if (data === cfg.ardino.cmd.proj_second_identifier) {
type = 'projector_second'; type = 'projector_second';
} }
else if (data === cfg.ardino.cmd.proj_dual_identifier) {
type = 'projectors';
}
else if (data === cfg.ardino.cmd.cam_second_identifier) {
type = 'camera_second';
}
else if (data === cfg.ardino.cmd.cam_dual_identifier) {
type = 'cameras';
}
//camera,projectors
//cameras,projector
//cameras,projectors
return resolve(type); return resolve(type);
}; };
await delay(cfg.arduino.serialDelay); await delay(cfg.arduino.serialDelay);

File diff suppressed because one or more lines are too long

View File

@ -6,14 +6,24 @@ const fs = require('fs-extra');
const os = require('os'); const os = require('os');
const logTime = 'MM/DD/YY-HH:mm:ss'; const logTime = 'MM/DD/YY-HH:mm:ss';
let transport; let transport;
/**
* Determine the location of the log file based on the operating system
* and return as an absolute string from os.homedir()
*
* @returns {string} Path to log file
**/
async function logFile() { async function logFile() {
const homeDir = os.homedir();
const linuxDir = `/.config/mcopy-cli/`;
const macDir = `/Library/Logs/mcopy-cli/`;
const winDir = `/AppData/Roaming/mcopy-cli/`;
let logPath = path.join(homeDir, linuxDir);
let exists; let exists;
let logPath = path.join(os.homedir(), `/.config/mcopy-cli/`);
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
logPath = path.join(os.homedir(), `/Library/Logs/mcopy-cli/`); logPath = path.join(homeDir, macDir);
} }
else if (process.platform === 'win32') { else if (process.platform === 'win32') {
logPath = path.join(os.homedir(), `/AppData/Roaming/mcopy-cli/`); logPath = path.join(homeDir, winDir);
} }
exists = await fs.exists(logPath); exists = await fs.exists(logPath);
if (!exists) { if (!exists) {
@ -21,6 +31,14 @@ async function logFile() {
} }
return path.join(logPath, 'mcopy-cli.log'); return path.join(logPath, 'mcopy-cli.log');
} }
/**
* Create and return the logger transport based on settings determined in
* arguments object
*
* @param {object} arg Arguments from process
*
* @returns {object} Logger transport
**/
module.exports = async function (arg) { module.exports = async function (arg) {
if (arg.quiet) { if (arg.quiet) {
transport = { transport = {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAC/D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;AACpD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,OAAO,GAAG,mBAAmB,CAAA;AACnC,IAAI,SAAe,CAAA;AAEnB,KAAK,UAAU,OAAO;IACrB,IAAI,MAAgB,CAAA;IACpB,IAAI,OAAO,GAAY,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,qBAAqB,CAAC,CAAA;IACrE,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAClC,OAAO,GAAG,IAAI,CAAC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AC;YACrB,IAAI,EAAG,cAAa,CAAC;YACrB,KAAK,EAAG,cAAa,CAAC;SACtB,CAAA;KACD;SAAM;QACN,SAAS,GAAG,YAAY,CAAC;YACxB,UAAU,EAAE;gBACX,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACxB,MAAM,EAAE,OAAO,CACd,MAAM,CAAC,QAAQ,EAAE,EACjB,MAAM,CAAC,MAAM,EAAE,CACf;iBACD,CAAC;gBACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;oBACrB,QAAQ,EAAE,MAAM,OAAO,EAAE;iBACzB,CAAC;aACF;SACD,CAAC,CAAA;KACF;IACD,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA"}

89
scad/anyeye_revere.scad Normal file
View File

@ -0,0 +1,89 @@
module motor_set_screw_120 () {
cube([10.19, 2.95, 2.95], center = true);
translate([(10.19 / 2) - (2.56 / 2), 0, 0]) cube([2.56, 5.8, 5.8], center = true);
}
module motor_set_screw_120_alt () {
$fn = 60;
cylinder(r = 2.95 / 2, h = 10.19, center= true);
translate([0, 0, (10.19 / 2) - (2.56 / 2)]) cylinder(r = 5.8 / 2, h = 2.56, center = true);
}
module hobbled_rod_120 (h = 10) {
d = 4.00;
diff = 3.33;
difference () {
cylinder(r = d/2, h = h, center = true, $fn = 60);
translate([d/2 + ((d/2) - (d - diff)), 0, 0]) cube([d, d, h + 1], center = true);
}
}
/**
* Notched
**/
module motor_key_120 (half = false, DECOYS = false, sides = 1, ALT = false) {
innerD = 7.85;
outer_d = 27.5 + 2;
notch_d = 10;
height = 7 + 5 + 4;
diff = 14 + 2.5 + 2;
$fn = 60;
difference () {
union () {
translate([0, 0, 12.1]) cylinder(r1 = 12 / 2, r2 = 12/2 + 4, h = 5, center = true);// padding against bearing
translate([0, 0, diff + 1]) cylinder(r=outer_d/2, h= height -2, center= true, $fn=200); //large cylinder
translate([0, 0, 6]) cylinder(r=innerD/2, h= 10, center= true);
//key_end([0, 180, -20], [0, 0, -3.5], ALT = ALT); // longer for laser cut board
}
//1 notch
translate([0, 0, diff]) {
translate ([-outer_d/2 - 2.5, 0, 0]) cylinder(r=notch_d/2, h= height, center= true); //notch
}
translate([0, 0, diff]) {
translate ([-outer_d/2 -.5, -3.5 , 0]) rotate([0, 0, 100]) cube([15, 5, height], center = true); // smooth notch
translate ([-outer_d/2 -.5, 3.5, 0]) rotate([0, 0, -100]) cube([15, 5, height], center = true); // smooth notch
}
if (sides == 2) {
//2 notch
translate([0, 0, diff]) {
translate ([outer_d/2 + 2.5, 0, 0]) cylinder(r=notch_d/2, h= height, center= true); //notch
}
translate([0, 0, diff]) {
translate ([outer_d/2 +.5, -3.5, 0]) rotate([0, 0, -100]) cube([15, 5, height], center = true); // smooth notch
translate ([outer_d/2 +.5, 3.5, 0]) rotate([0, 0, 100]) cube([15, 5, height], center = true); // smooth notch
}
}
//slot for hobbled(?) end
translate([0, 0, 17 + 2]) {
translate([0, 0, 6.5]) hobbled_rod_120(12);
translate([6.42 - .2, 0, 4.3 - 1]) rotate([0, 90, 0]) motor_set_screw_120_alt();
translate([14, 0, 4.3 - 1]) rotate([0, 90, 0]) cylinder(r2 = 6 / 2, r1 = 5.8 / 2, h = 6, center = true); //extension
}
if (half) {
translate([0 - 50 , 0, -50]) cube([100, 100, 200]);
}
}
}
module reference_projector_shaft () {
INNER_DIAMETER = 4.08;
OUTER_DIAMETER = 11.08;
H = 7.37;
WHEEL_DIAMETER = 54;
WHEEL_H = 3;
$fn = 120;
translate([0, 0, -15 + H]) difference () {
cylinder(r = OUTER_DIAMETER / 2, h = 30, center = true);
cylinder(r = INNER_DIAMETER / 2, h = 30 + 1, center = true);
}
translate([0, 0, -1.5]) cylinder(r = WHEEL_DIAMETER / 2, h = WHEEL_H, center = true);
translate([0, 0, 6 + 1.5]) cube([60, 60, 3], center = true);
}
reference_projector_shaft();
translate([0, 0, 60]) motor_key_120();

17
scad/jk_extras.scad Normal file
View File

@ -0,0 +1,17 @@
include <common.scad>;
IN = 25.4;
/**
* Parametric measurement bar to attach to rails
**/
module measurement_bar (X = 20 * IN, Y = 16.4, Z = 3, BOLT = 4, BOLT_OFFSET = (3/8) * IN, PROJ_ZERO = 43) {
$fn = 50;
difference () {
rounded_cube([X, Y, Z], d = 5, center = true);
translate([(X / 2) - BOLT_OFFSET, 0, 0]) cylinder(r = BOLT/2, h = Z + 1, center = true);
translate([-(X / 2) + BOLT_OFFSET, 0, 0]) cylinder(r = BOLT/2, h = Z + 1, center = true);
translate([(X / 2) - PROJ_ZERO, -(Y / 2) + (5 / 2), 0]) cube([0.2, 5, Z + 1], center = true);
}
}
projection() measurement_bar();

View File

@ -4,5 +4,5 @@
#electron-build fails when local modules are in parent directory #electron-build fails when local modules are in parent directory
#copy them into lib directory #copy them into lib directory
cp -r ./lib/ ./app/lib cp -r ./lib/* ./app/lib/
cp -r ./lib/ ./cli/lib cp -r ./lib/* ./cli/lib/

View File

@ -219,13 +219,28 @@ class Arduino {
confirmEnd (data : string) { confirmEnd (data : string) {
//console.dir(data) //console.dir(data)
if (data === cfg.arduino.cmd.connect if ( data === cfg.arduino.cmd.connect
|| data === cfg.arduino.cmd.proj_identifier || data === cfg.arduino.cmd.proj_identifier
|| data === cfg.arduino.cmd.cam_identifier || data === cfg.arduino.cmd.cam_identifier
|| data === cfg.arduino.cmd.light_identifier || data === cfg.arduino.cmd.light_identifier
|| data === cfg.arduino.cmd.proj_light_identifier || data === cfg.arduino.cmd.proj_light_identifier
|| data === cfg.arduino.cmd.proj_cam_light_identifier || data === cfg.arduino.cmd.proj_cam_light_identifier
|| data === cfg.arduino.cmd.proj_cam_identifier ) { || data === cfg.arduino.cmd.proj_cam_identifier
|| data === cfg.arduino.cmd.proj_second_identifier
|| data === cfg.arduino.cmd.proj_dual_identifier
|| data === cfg.arduino.cmd.proj_second_forward
|| data === cfg.arduino.cmd.proj_second_backward
|| data === cfg.arduino.cmd.projector_second
|| data === cfg.arduino.cmd.projectors
|| data === cfg.arduino.cmd.cam_second_identifier
|| data === cfg.arduino.cmd.cam_dual_identifier
|| data === cfg.arduino.cmd.cam_second_forward
|| data === cfg.arduino.cmd.cam_second_backward
|| data === cfg.arduino.cmd.camera_second
|| data === cfg.arduino.cmd.cameras) {
this.confirmExec(null, data); this.confirmExec(null, data);
this.confirmExec = {}; this.confirmExec = {};
} }
@ -274,7 +289,16 @@ class Arduino {
type = 'projector,camera' type = 'projector,camera'
} else if (data === cfg.ardino.cmd.proj_second_identifier) { } else if (data === cfg.ardino.cmd.proj_second_identifier) {
type = 'projector_second' type = 'projector_second'
} else if (data === cfg.ardino.cmd.proj_dual_identifier) {
type = 'projectors'
} else if (data === cfg.ardino.cmd.cam_second_identifier) {
type = 'camera_second'
} else if (data === cfg.ardino.cmd.cam_dual_identifier) {
type = 'cameras'
} }
//camera,projectors
//cameras,projector
//cameras,projectors
return resolve(type) return resolve(type)
} }
await delay(cfg.arduino.serialDelay) await delay(cfg.arduino.serialDelay)

View File

@ -9,21 +9,40 @@ const os = require('os')
const logTime = 'MM/DD/YY-HH:mm:ss' const logTime = 'MM/DD/YY-HH:mm:ss'
let transport : any let transport : any
/**
* Determine the location of the log file based on the operating system
* and return as an absolute string from os.homedir()
*
* @returns {string} Path to log file
**/
async function logFile () { async function logFile () {
let exists : boolean
let logPath : string = path.join(os.homedir(), `/.config/mcopy-cli/`) const homeDir : string = os.homedir();
if (process.platform === 'darwin') { const linuxDir : string = `/.config/mcopy-cli/`;
logPath = path.join(os.homedir(), `/Library/Logs/mcopy-cli/`) const macDir : string = `/Library/Logs/mcopy-cli/`;
} else if (process.platform === 'win32') { const winDir : string = `/AppData/Roaming/mcopy-cli/`;
logPath = path.join(os.homedir(), `/AppData/Roaming/mcopy-cli/`) let logPath : string = path.join(homeDir, linuxDir);
} let exists : boolean;
exists = await fs.exists(logPath)
if (!exists) {
await fs.mkdir(logPath)
}
return path.join(logPath, 'mcopy-cli.log')
}
if (process.platform === 'darwin') {
logPath = path.join(homeDir, macDir);
} else if (process.platform === 'win32') {
logPath = path.join(homeDir, winDir);
}
exists = await fs.exists(logPath);
if (!exists) {
await fs.mkdir(logPath);
}
return path.join(logPath, 'mcopy-cli.log');
}
/**
* Create and return the logger transport based on settings determined in
* arguments object
*
* @param {object} arg Arguments from process
*
* @returns {object} Logger transport
**/
module.exports = async function (arg : any) { module.exports = async function (arg : any) {
if (arg.quiet) { if (arg.quiet) {
transport = { transport = {