diff --git a/cli/.gitignore b/cli/.gitignore deleted file mode 100644 index 3c3629e..0000000 --- a/cli/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/cli/data/cfg.json b/cli/data/cfg.json deleted file mode 100644 index aa6d7e0..0000000 --- a/cli/data/cfg.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "version": "1.6.6", - "ext_port": 1111, - "profiles": { - "mcopy": { - "label": "Default mcopy profile", - "cam": { - "time": 850, - "delay": 50, - "momentary": 0 - }, - "proj": { - "time": 1400, - "delay": 50, - "momentary": 0 - }, - "black": { - "before": 0, - "after": 0 - }, - "light": false - }, - "jk103": { - "label": "JK103", - "cam": { - "time": 600, - "delay": 50, - "momentary": 240 - }, - "proj": { - "time": 950, - "delay": 50, - "momentary": 240 - }, - "black": { - "before": 0, - "after": 0 - }, - "light": false - }, - "jk_original": { - "label": "JK45 profile", - "cam": { - "time": 750, - "delay": 50, - "momentary": 300 - }, - "proj": { - "time": 1300, - "delay": 50, - "momentary": 300 - }, - "black": { - "before": 250, - "after": 250 - }, - "light": false - }, - "intval3": { - "label": "INTVAL3", - "cam": { - "time": 630, - "delay": 50, - "momentary": 0 - }, - "light": false - }, - "jk_mono": { - "label": "MONO's JK", - "cam": { - "time": 750, - "delay": 50, - "momentary": 300 - }, - "proj": { - "time": 1300, - "delay": 50, - "momentary": 300 - }, - "light": false, - "projector_second": true - }, - "oxberry": { - "label": "Oxberry", - "cam": { - "time": 550, - "delay": 50, - "momentary": 130 - }, - "proj": { - "time": 1340, - "delay": 50, - "momentary": 300 - }, - "light": false - }, - "norris": { - "label": "Norris", - "cam": { - "time": 650, - "delay": 50, - "momentary": 130 - }, - "light": false - } - }, - "cmd": { - "camera_forward": "CF", - "camera_backward": "CB", - "projector_forward": "PF", - "projector_backward": "PB", - "black_forward": "BF", - "black_backward": "BB", - "camera_second_forward": "C2F", - "camera_second_backward": "C2B", - "cameras_forward": "CCF", - "cameras_backward": "CCB", - "camera_forward_camera_second_backward": "CFCB", - "camera_backward_camera_second_forward": "CBCF", - "projector_second_forward": "P2F", - "projector_second_backward": "P2B", - "projectors_forward": "PPF", - "projectors_backward": "PPB", - "projector_forward_projector_second_backward": "PFPB", - "projector_backward_projector_second_forward": "PBPF", - "pause": "PA", - "alert": "AL" - }, - "arduino": { - "baud": 57600, - "board": "uno", - "serialDelay": 20, - "sequenceDelay": 100, - "cam": { - "time": 850, - "delay": 50, - "momentary": 300 - }, - "proj": { - "time": 1300, - "delay": 50, - "momentary": 300 - }, - "black": { - "before": 250, - "after": 250 - }, - "cmd": { - "debug": "d", - "connect": "i", - "light": "l", - "camera": "c", - "projector": "p", - "black": "b", - "camera_forward": "e", - "camera_backward": "f", - "projector_forward": "g", - "projector_backward": "h", - "projector_identifier": "j", - "camera_identifier": "k", - "mcopy_identifier": "m", - "camera_timed": "n", - "light_identifier": "o", - "projector_light_identifier": "q", - "projector_camera_light_identifier": "r", - "projector_camera_identifier": "s", - "projector_second_identifier": "t", - "projectors_identifier": "d", - "projector_second_forward": "u", - "projector_second_backward": "v", - "projector_second": "w", - "projectors": "x", - "camera_second_identifier": "y", - "cameras_identifier": "a", - "camera_second_forward": "1", - "camera_second_backward": "2", - "camera_second": "3", - "cameras": "4", - "camera_projectors_identifier": "5", - "cameras_projector_identifier": "6", - "cameras_projectors_identifier": "7" - } - } -} diff --git a/cli/index.js b/cli/index.js deleted file mode 100644 index 6a3bd5c..0000000 --- a/cli/index.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const program = require('commander') -const uuid = require('uuid') -const moment = require('moment') -const events = require('events') -const ee = new events.EventEmitter() - -const cfg = require('../app/data/cfg.json') -const pkg = require('./package.json') - -const { delay } = require('delay') -const { exit } = require('exit') -const intval = require('intval') -const arduino = require('arduino')(cfg, ee) -const Mscript = require('mscript') -const mscript = new Mscript() - -const dev = require('device')(arduino) -let log -let readline - -let devices - -async function command () { - return new Promise ((resolve, reject) => { - return readline.question(`Input:`, (str) => { - log.info(str) - console.dir(mscript.interpret(str)) - - //interpret string - //readline.close() - return resolve(true) - }) - }) -} - -async function live () { - readline = require('readline').createInterface({ - input: process.stdin, - output: process.stdout - }) - log.info('Starting live control mode') - while (true) { - try { - await command() - } catch (err) { - log.error('Error executing command', err) - } - } -} - -function parsePattern () { - -} - -async function main (arg) { - log = await require('log')(arg) - - log.info('mcopy-cli') - - try { - devices = await arduino.enumerate() - } catch (err) { - log.error('Error enumerating devices') - log.error(err) - } - - if (!devices ||devices.length > 1) { - //return exit('No devices found', 1) - devices = [] - } - - await dev.all(devices) - - if (arg.pattern) { - - } - - if (arg.live) { - try { - await live() - } catch (err) { - log.error('Error running in live control mode', err) - } - } -} - -program - .version(pkg.version) - .option('-l, --live', 'Live control mode') - .option('-f, --frames', 'Number of frames to capture with camera') - .option('-p, --pattern', 'Pattern of sequence to be repeated') - .option('-i, --intval', 'URL of intval3') - .option('-m, --mscript', 'Execute an mscript file') - .option('-q, --quiet', 'Suppresses all log messages') - .parse(process.argv) - -main(program) \ No newline at end of file diff --git a/cli/lib/Readme.md b/cli/lib/Readme.md deleted file mode 100644 index 9a1dbf0..0000000 --- a/cli/lib/Readme.md +++ /dev/null @@ -1,37 +0,0 @@ -## Functions - -
-
dependencies(platform)
-

Evaluates system dependencies for digital -projector features by executing processes with ---help flag. If they do not exist, log to console

-
-
system()object
-

Profile the current system and return an object with -data about the displays and dependencies for the digital -projector feature.

-
-
- - - -## dependencies(platform) -Evaluates system dependencies for digital -projector features by executing processes with ---help flag. If they do not exist, log to console - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| platform | string | Operating system type | - - - -## system() ⇒ object -Profile the current system and return an object with -data about the displays and dependencies for the digital -projector feature. - -**Kind**: global function -**Returns**: object - Object containing system information diff --git a/cli/lib/arduino/Readme.md b/cli/lib/arduino/Readme.md deleted file mode 100644 index 2e22601..0000000 --- a/cli/lib/arduino/Readme.md +++ /dev/null @@ -1,71 +0,0 @@ - - -## Arduino -Class representing the arduino communication features - -**Kind**: global class - -* [Arduino](#Arduino) - * [.enumerate()](#Arduino+enumerate) ⇒ Promise - * [.sendAsync(device, cmd)](#Arduino+sendAsync) ⇒ Promise - * [.writeAsync(device, str)](#Arduino+writeAsync) ⇒ Promise - * [.openArduino(device)](#Arduino+openArduino) ⇒ Promise - * [.closeArduino(device)](#Arduino+closeArduino) ⇒ Promise - - - -### arduino.enumerate() ⇒ Promise -Enumerate all connected devices that might be Arduinos - -**Kind**: instance method of [Arduino](#Arduino) -**Returns**: Promise - Resolves after enumerating - - -### arduino.sendAsync(device, cmd) ⇒ Promise -Send a command to an Arduino using async/await - -**Kind**: instance method of [Arduino](#Arduino) -**Returns**: Promise - Resolves after sending - -| Param | Type | Description | -| --- | --- | --- | -| device | string | Arduino identifier | -| cmd | string | Single character command to send | - - - -### arduino.writeAsync(device, str) ⇒ Promise -Send a string to an Arduino using async/await - -**Kind**: instance method of [Arduino](#Arduino) -**Returns**: Promise - Resolves after sending - -| Param | Type | Description | -| --- | --- | --- | -| device | string | Arduino identifier | -| str | string | String to send | - - - -### arduino.openArduino(device) ⇒ Promise -Connect to an Arduino using async/await - -**Kind**: instance method of [Arduino](#Arduino) -**Returns**: Promise - Resolves after opening - -| Param | Type | Description | -| --- | --- | --- | -| device | string | Arduino identifier | - - - -### arduino.closeArduino(device) ⇒ Promise -Close a connection to an Arduino using async/await - -**Kind**: instance method of [Arduino](#Arduino) -**Returns**: Promise - Resolves after closing - -| Param | Type | Description | -| --- | --- | --- | -| device | string | Arduino identifier | - diff --git a/cli/lib/arduino/index.js b/cli/lib/arduino/index.js deleted file mode 100644 index 67ac29b..0000000 --- a/cli/lib/arduino/index.js +++ /dev/null @@ -1,408 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -//import Log = require('log'); -const delay_1 = require("delay"); -const SerialPort = require('serialport'); -const Readline = SerialPort.parsers.Readline; -const exec = require('child_process').exec; -const parser = new Readline(''); -const newlineRe = new RegExp('\n', 'g'); -const returnRe = new RegExp('\r', 'g'); -let eventEmitter; -let cfg; -let arduino; -const KNOWN = [ - '/dev/tty.usbmodem1a161', - '/dev/tty.usbserial-A800f8dk', - '/dev/tty.usbserial-A900cebm', - '/dev/tty.usbmodem1a131', - '/dev/tty.usbserial-a900f6de', - '/dev/tty.usbmodem1a141', - '/dev/ttyACM0', - 'COM3' -]; -/** - * Class representing the arduino communication features - **/ -class Arduino { - constructor(errorState) { - this.path = {}; - this.known = KNOWN; - this.alias = {}; - this.serial = { connect: {}, projector: {}, camera: {}, light: {} }; - this.baud = 57600; - this.queue = {}; - this.timer = 0; - this.lock = false; - this.locks = {}; - this.errorState = errorState; - this.init(); - } - async init() { - const Log = require('log'); - this.log = await Log({ label: 'arduino' }); - } - /** - * Enumerate all connected devices that might be Arduinos - * - * @returns {Promise} Resolves after enumerating - **/ - async enumerate() { - let ports; - let matches = []; - try { - ports = await SerialPort.list(); - } - catch (err) { - throw err; - } - this.log.info('Available ports:'); - this.log.info(ports.map((port) => { return port.path; }).join(',')); - ports.forEach((port) => { - if (this.known.indexOf(port.path) !== -1) { - matches.push(port.path); - } - else if ((port.manufacturer + '').toLowerCase().indexOf('arduino') !== -1) { - matches.push(port.path); - } - else if ((port.path + '').toLowerCase().indexOf('usbserial') !== -1) { - matches.push(port.path); - } - else if ((port.path + '').toLowerCase().indexOf('usbmodem') !== -1) { - matches.push(port.path); - } - else if ((port.path + '').toLowerCase().indexOf('ttyusb') !== -1) { - matches.push(port.path); - } - }); - if (matches.length === 0) { - throw new Error('No USB devices found'); - } - else if (matches.length > 0) { - return matches; - } - } - /** - * Send a command to an Arduino using async/await - * - * @param {string} device Arduino identifier - * @param {string} cmd Single character command to send - * - * @returns {Promise} Resolves after sending - **/ - async sendAsync(device, cmd) { - return new Promise((resolve, reject) => { - this.queue[cmd] = (ms) => { - return resolve(ms); - }; - return this.serial[device].write(cmd, (err, results) => { - if (err) { - //console.error(err) - return reject(err); - } - // - }); - }); - } - async send(serial, cmd) { - const device = this.alias[serial]; - let results; - console.log(`${cmd} -> ${serial}`); - if (this.locks[serial]) { - return false; - } - this.timer = new Date().getTime(); - this.locks[serial] = true; - await delay_1.delay(cfg.arduino.serialDelay); - try { - results = await this.sendAsync(device, cmd); - } - catch (e) { - return console.error(e); - } - this.locks[serial] = false; - await eventEmitter.emit('arduino_send', cmd); - return results; - } - async string(serial, str) { - const device = this.alias[serial]; - let writeSuccess; - await delay_1.delay(cfg.arduino.serialDelay); - if (typeof this.serial[device].fake !== 'undefined' - && this.serial[device].fake) { - return this.serial[device].string(str); - } - else { - try { - writeSuccess = await this.writeAsync(device, str); - } - catch (e) { - return console.error(e); - } - return writeSuccess; - } - } - /** - * Send a string to an Arduino using async/await - * - * @param {string} device Arduino identifier - * @param {string} str String to send - * - * @returns {Promise} Resolves after sending - **/ - async writeAsync(device, str) { - return new Promise((resolve, reject) => { - this.serial[device].write(str, function (err, results) { - if (err) { - return reject(err); - } - return resolve(results); - }); - }); - } - end(serial, data) { - const end = new Date().getTime(); - const ms = end - this.timer; - let complete; - console.log(`${serial} -> ${data}`); - if (this.queue[data] !== undefined) { - this.locks[serial] = false; - complete = this.queue[data](ms); //execute callback - eventEmitter.emit('arduino_end', data); - delete this.queue[data]; - } - else if (data === 'E') { - //error state - //stop sequence - //throw error in ui - } - else { - //console.log('Received stray "' + data + '"'); //silent to user - } - return ms; - } - aliasSerial(serial, device) { - //this.log.info(`Making "${serial}" an alias of ${device}`); - this.alias[serial] = device; - } - async connect(serial, device, confirm) { - return new Promise(async (resolve, reject) => { - let connectSuccess; - this.path[serial] = device; - this.alias[serial] = device; - this.serial[device] = new SerialPort(this.path[serial], { - autoOpen: false, - baudRate: cfg.arduino.baud, - parser: parser - }); - this.locks[device] = false; - try { - connectSuccess = await this.openArduino(device); - } - catch (e) { - console.error('failed to open: ' + e); - return reject(e); - } - //console.log(`Opened connection with ${this.path[serial]} as ${serial}`); - if (!confirm) { - this.serial[device].on('data', async (data) => { - let d = data.toString('utf8'); - d = d.replace(newlineRe, '').replace(returnRe, ''); - return this.end(serial, d); - }); - } - else { - this.serial[device].on('data', async (data) => { - let d = data.toString('utf8'); - d = d.replace(newlineRe, '').replace(returnRe, ''); - return await this.confirmEnd(d); - }); - } - return resolve(this.path[serial]); - }); - } - confirmEnd(data) { - //console.dir(data) - if (data === cfg.arduino.cmd.connect - || data === cfg.arduino.cmd.projector_identifier - || data === cfg.arduino.cmd.camera_identifier - || data === cfg.arduino.cmd.light_identifier - || data === cfg.arduino.cmd.projector_light_identifier - || data === cfg.arduino.cmd.projector_camera_light_identifier - || data === cfg.arduino.cmd.projector_camera_identifier - || data === cfg.arduino.cmd.projector_second_identifier - || data === cfg.arduino.cmd.projectors_identifier - || data === cfg.arduino.cmd.projector_second_forward - || data === cfg.arduino.cmd.projector_second_backward - || data === cfg.arduino.cmd.projector_second - || data === cfg.arduino.cmd.projectors - || data === cfg.arduino.cmd.camera_second_identifier - || data === cfg.arduino.cmd.cameras_identifier - || data === cfg.arduino.cmd.camera_second_forward - || data === cfg.arduino.cmd.camera_second_backward - || data === cfg.arduino.cmd.camera_second - || data === cfg.arduino.cmd.cameras) { - this.confirmExec(null, data); - this.confirmExec = {}; - } - } - async verify() { - return new Promise(async (resolve, reject) => { - const device = this.alias['connect']; - let writeSuccess; - this.confirmExec = function (err, data) { - if (data === cfg.arduino.cmd.connect) { - return resolve(true); - } - else { - return reject('Wrong data returned'); - } - }; - await delay_1.delay(cfg.arduino.serialDelay); - try { - writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect); - } - catch (e) { - return reject(e); - } - return resolve(writeSuccess); - }); - } - async distinguish() { - return new Promise(async (resolve, reject) => { - const device = this.alias['connect']; - let writeSuccess; - let type; - this.confirmExec = function (err, data) { - if (data === cfg.arduino.cmd.projector_identifier) { - type = 'projector'; - } - else if (data === cfg.arduino.cmd.camera_identifier) { - type = 'camera'; - } - else if (data === cfg.arduino.cmd.light_identifier) { - type = 'light'; - } - else if (data === cfg.arduino.cmd.projector_light_identifier) { - type = 'projector,light'; - } - else if (data === cfg.arduino.cmd.projector_camera_light_identifier) { - type = 'projector,camera,light'; - } - else if (data === cfg.arduino.cmd.projector_camera_identifier) { - type = 'projector,camera'; - } - else if (data === cfg.arduino.cmd.projector_second_identifier) { - type = 'projector_second'; - } - else if (data === cfg.arduino.cmd.projectors_identifier) { - type = 'projector,projector_second'; - } - else if (data === cfg.arduino.cmd.camera_second_identifier) { - type = 'camera_second'; - } - else if (data === cfg.arduino.cmd.cameras_identifier) { - type = 'camera,camera_second'; - } - else if (data === cfg.arduino.cmd.camera_projectors_identifier) { - type = 'camera,projector,projector_second'; - } - else if (data === cfg.arduino.cmd.cameras_projector_identifier) { - type = 'camera,camera_second,projector'; - } - else if (data === cfg.arduino.cmd.cameras_projectors_identifier) { - type = 'camera,camera_second,projector,projector_second'; - } - return resolve(type); - }; - await delay_1.delay(cfg.arduino.serialDelay); - try { - writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier); - } - catch (e) { - return reject(e); - } - }); - } - async close() { - const device = this.alias['connect']; - let closeSuccess; - try { - closeSuccess = await this.closeArduino(device); - } - catch (e) { - throw e; - } - return closeSuccess; - } - ; - async fakeConnect(serial) { - const device = '/dev/fake'; - this.alias[serial] = device; - this.serial[device] = { - write: async function (cmd, cb) { - const t = { - c: cfg.arduino.cam.time + cfg.arduino.cam.delay, - p: cfg.arduino.proj.time + cfg.arduino.proj.delay - }; - let timeout = t[cmd]; - if (typeof timeout === 'undefined') - timeout = 10; - arduino.timer = +new Date(); - await delay_1.delay(timeout); - arduino.end(serial, cmd); - return cb(); - }, - string: async function (str) { - //do nothing - return true; - }, - fake: true - }; - //console.log('Connected to fake arduino! Not real! Does not exist!'); - return true; - } - /** - * Connect to an Arduino using async/await - * - * @param {string} device Arduino identifier - * - * @returns {Promise} Resolves after opening - **/ - async openArduino(device) { - return new Promise((resolve, reject) => { - return this.serial[device].open((err) => { - if (err) { - return reject(err); - } - return resolve(true); - }); - }); - } - /** - * Close a connection to an Arduino using async/await - * - * @param {string} device Arduino identifier - * - * @returns {Promise} Resolves after closing - **/ - async closeArduino(device) { - return new Promise((resolve, reject) => { - return this.serial[device].close((err) => { - if (err) { - return reject(err); - } - return resolve(true); - }); - }); - } -} -if (typeof module !== 'undefined' && module.parent) { - module.exports = function (c, ee, errorState) { - eventEmitter = ee; - cfg = c; - arduino = new Arduino(errorState); - return arduino; - }; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/arduino/index.js.map b/cli/lib/arduino/index.js.map deleted file mode 100644 index a5ad869..0000000 --- a/cli/lib/arduino/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/arduino/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,8BAA8B;AAC9B,iCAA+B;AAE/B,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAA;AAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,IAAI,CAAA;AAE1C,MAAM,MAAM,GAAS,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAA;AACrC,MAAM,SAAS,GAAY,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AAChD,MAAM,QAAQ,GAAY,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AAE/C,IAAI,YAAkB,CAAA;AACtB,IAAI,GAAS,CAAA;AACb,IAAI,OAAa,CAAA;AAEjB,MAAM,KAAK,GAAc;IACxB,wBAAwB;IACxB,6BAA6B;IAC7B,6BAA6B;IAC7B,wBAAwB;IACxB,6BAA6B;IAC7B,wBAAwB;IACxB,cAAc;IACd,MAAM;CACN,CAAA;AAED;;IAEI;AAEJ,MAAM,OAAO;IAeZ,YAAa,UAAqB;QAZ1B,SAAI,GAAS,EAAE,CAAC;QAChB,UAAK,GAAc,KAAK,C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O,OAAO,CAAC,IAAI,CAAC,CAAA;YACrB,CAAC,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACH,CAAC;CACD;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE;IACnD,MAAM,CAAC,OAAO,GAAG,UAAU,CAAO,EAAE,EAAQ,EAAE,UAAqB;QAClE,YAAY,GAAG,EAAE,CAAA;QACjB,GAAG,GAAG,CAAC,CAAA;QACP,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAA;QACjC,OAAO,OAAO,CAAA;IACf,CAAC,CAAA;CACD"} \ No newline at end of file diff --git a/cli/lib/arduino/package.json b/cli/lib/arduino/package.json deleted file mode 100644 index 43708c1..0000000 --- a/cli/lib/arduino/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "arduino", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/cam/Readme.md b/cli/lib/cam/Readme.md deleted file mode 100644 index 3825697..0000000 --- a/cli/lib/cam/Readme.md +++ /dev/null @@ -1,49 +0,0 @@ - - -## Camera -class representing camera functions - -**Kind**: global class - -* [Camera](#Camera) - * [.init()](#Camera+init) - * [.listen()](#Camera+listen) - * [.set()](#Camera+set) - * [.move()](#Camera+move) - * [.exposure()](#Camera+exposure) - * [.connectIntval()](#Camera+connectIntval) - * [.listener()](#Camera+listener) - * [.end()](#Camera+end) - - - -### camera.init() -**Kind**: instance method of [Camera](#Camera) - - -### camera.listen() -**Kind**: instance method of [Camera](#Camera) - - -### camera.set() -**Kind**: instance method of [Camera](#Camera) - - -### camera.move() -**Kind**: instance method of [Camera](#Camera) - - -### camera.exposure() -**Kind**: instance method of [Camera](#Camera) - - -### camera.connectIntval() -**Kind**: instance method of [Camera](#Camera) - - -### camera.listener() -**Kind**: instance method of [Camera](#Camera) - - -### camera.end() -**Kind**: instance method of [Camera](#Camera) diff --git a/cli/lib/cam/index.js b/cli/lib/cam/index.js deleted file mode 100644 index a69c877..0000000 --- a/cli/lib/cam/index.js +++ /dev/null @@ -1,224 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const intval_1 = require("intval"); -/** class representing camera functions **/ -class Camera { - /** - * - **/ - constructor(arduino, cfg, ui, filmout, second = false) { - this.state = { - pos: 0, - dir: true - }; - this.arduino = null; - this.intval = null; - this.id = 'camera'; - this.arduino = arduino; - this.cfg = cfg; - this.ui = ui; - this.filmout = filmout; - if (second) - this.id += '_second'; - this.init(); - } - /** - * - **/ - async init() { - const Log = require('log'); - this.log = await Log({ label: this.id }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * - **/ - listen() { - this.ipc.on(this.id, this.listener.bind(this)); - this.ipc.on('intval', this.connectIntval.bind(this)); - } - /** - * - **/ - async set(dir, id) { - let cmd; - let ms; - if (dir) { - cmd = this.cfg.arduino.cmd[`${this.id}_forward`]; - } - else { - cmd = this.cfg.arduino.cmd[`${this.id}_backward`]; - } - this.state.dir = dir; - if (this.intval) { - try { - ms = await this.intval.setDir(dir); - } - catch (err) { - this.log.error(err); - } - } - else { - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(err); - } - } - return await this.end(cmd, id, ms); - } - /** - * - **/ - async move(frame, id) { - const cmd = this.cfg.arduino.cmd[this.id]; - let ms; - if (this.filmout.state.enabled) { - await this.filmout.start(); - } - if (this.intval) { - try { - ms = await this.intval.move(); - } - catch (err) { - this.log.error(err); - } - } - else { - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(err); - } - } - if (this.filmout.state.enabled) { - //await delay(100 * 1000); - await this.filmout.end(); - } - //this.log.info('Camera move time', { ms }); - return this.end(cmd, id, ms); - } - async both(frame, id) { - const cmd = this.cfg.arduino.cmd[id]; - let ms; - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(`Error moving ${this.id}`, err); - } - //this.log.info('Cameras move time', { ms }); - return await this.end(cmd, id, ms); - } - /** - * - **/ - exposure(exposure, id) { - let cmd = 'E'; - this.intval.setExposure(this.id, exposure, (ms) => { - this.end(cmd, id, ms); - }); - } - /** - * - **/ - async connectIntval(event, arg) { - return new Promise((resolve, reject) => { - if (arg.connect) { - this.intval = new intval_1.Intval(arg.url); - this.intval.connect((err, ms, state) => { - if (err) { - this.ui.send('intval', { connected: false }); - this.log.info(`Cannot connect to ${arg.url}`, 'INTVAL'); - this.intval = null; - } - else { - this.ui.send('intval', { connected: true, url: arg.url, state: state }); - this.log.info(`Connected to INTVAL3 @ ${arg.url}`, 'INTVAL'); - } - return resolve(true); - }); - } - else if (arg.disconnect) { - this.intval = null; - return resolve(false); - } - }); - } - /** - * - **/ - async listener(event, arg) { - if (typeof arg.dir !== 'undefined') { - try { - await this.set(arg.dir, arg.id); - } - catch (err) { - this.log.error(err); - } - } - else if (typeof arg.frame !== 'undefined') { - try { - await this.move(arg.frame, arg.id); - } - catch (err) { - this.log.error(err); - } - } - else if (typeof arg.val !== 'undefined') { - this.state.pos = arg.val; - } - event.returnValue = true; - } - /** - * - **/ - async end(cmd, id, ms) { - let message = ''; - if (cmd === this.cfg.arduino.cmd.camera_forward) { - message = 'Camera set to FORWARD'; - } - else if (cmd === this.cfg.arduino.cmd.camera_backward) { - message = 'Camera set to BACKWARD'; - } - else if (cmd === this.cfg.arduino.cmd.camera_second_forward) { - message = 'Camera second set to FORWARD'; - } - else if (cmd === this.cfg.arduino.cmd.camera_second_backward) { - message = 'Camera second set to BACKWARD'; - } - else if (cmd === this.cfg.arduino.cmd.camera) { - message = 'Camera '; - if (this.state.dir) { - message += 'ADVANCED'; - } - else { - message += 'REWOUND'; - } - message += ' 1 frame'; - } - else if (cmd === this.cfg.arduino.cmd.camera_second) { - message = 'Camera second '; - if (this.state.dir) { - message += 'ADVANCED'; - } - else { - message += 'REWOUND'; - } - message += ' 1 frame'; - } - else if (cmd === this.cfg.arduino.cmd.camerass) { - message += 'Cameras both MOVED 1 frame each'; - } - message += ` ${ms}ms`; - this.log.info(message); - this.ui.send(this.id, { cmd: cmd, id: id, ms: ms }); - } -} -module.exports = function (arduino, cfg, ui, filmout, second) { - return new Camera(arduino, cfg, ui, filmout, second); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/cam/index.js.map b/cli/lib/cam/index.js.map deleted file mode 100644 index a1ece7a..0000000 --- a/cli/lib/cam/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cam/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,mCAAgC;AAGhC,2CAA2C;AAE3C,MAAM,MAAM;IAaX;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ,EAAE,OAAa,EAAE,SAAmB,KAAK;QAfpF,UAAK,GAAS;YACrB,GAAG,EAAG,CAAC;YACP,GAAG,EAAG,IAAI;SACV,CAAC;QACM,YAAO,GAAa,IAAI,CAAC;QACzB,WAAM,GAAS,IAAI,CAAC;QAMpB,OAAE,GAAY,QAAQ,CAAC;QAK9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,MAAM;YAAE,IAAI,CAAC,EAAE,IAAI,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,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ACtB;aAAM,IAAI,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;YACjD,OAAO,IAAI,iCAAiC,CAAC;SAC7C;QACD,OAAO,IAAI,IAAI,EAAE,IAAI,CAAA;QACrB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC;IACpD,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,OAAiB,EAAE,GAAS,EAAE,EAAQ,EAAE,OAAa,EAAE,MAAgB;IACjG,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/cam/package.json b/cli/lib/cam/package.json deleted file mode 100644 index 980dbbd..0000000 --- a/cli/lib/cam/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "cam", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/cmd/Readme.md b/cli/lib/cmd/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/cmd/index.js b/cli/lib/cmd/index.js deleted file mode 100644 index b159fc6..0000000 --- a/cli/lib/cmd/index.js +++ /dev/null @@ -1,577 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const uuid_1 = require("uuid"); -const delay_1 = require("delay"); -class Commands { - /** - * @constructor - * Assign all connected devices and mock devices as private classes. - * - * @param {object} cfg Configuration object - * @param {object} proj Projector 1 - * @param {object} cam Camera 1 - * @param {object} light Light source - * @param {object} cam2 (optional) Camera 2 - * @param {object} proj2 {optional} Projector 2 - **/ - constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) { - this.cfg = cfg; - this.proj = proj; - this.cam = cam; - this.light = light; - if (cam2) - this.cam2 = cam2; - if (proj2) - this.proj2 = proj2; - this.ipc = require('electron').ipcMain; - } - /** - * Move the projector one frame forward - * - * @returns {integer} Length of action in ms - **/ - async projector_forward() { - let ms; - try { - if (!this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.proj.move(); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the projector one frame backward - * - * @returns {integer} Length of action in ms - **/ - async projector_backward() { - let ms; - try { - if (this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.proj.move(); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the camera one frame forward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async camera_forward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (!this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the camera one frame forward with light off - * - * @returns {integer} Length of action in ms - **/ - async black_forward() { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (!this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); //make sure set to off - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the camera one frame backward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async camera_backward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the camera one frame forward, light set to black or off - * - * @returns {integer} Length of action in ms - **/ - async black_backward() { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); //make sure set to off - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the second camera one frame forward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async camera_second_forward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (!this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam2.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the second camera one frame backward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async camera_second_backward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let ms; - try { - if (this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.cam2.move(); - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the both cameras one frame forward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async cameras_forward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let both; - let ms; - try { - if (!this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(true); - } - if (!this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) { - ms = await this.cam.both(); - } - else { - this.cam.move(); - this.cam2.move(); - both = [await this.cam.move, await this.cam2.move]; - ms = Math.max(...both); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the both cameras one frame backward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async cameras_backward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let both; - let ms; - try { - if (this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(false); - } - if (this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) { - ms = await this.cam.both(); - } - else { - this.cam.move(); - this.cam2.move(); - both = [await this.cam.move, await this.cam2.move]; - ms = Math.max(...both); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move first camera one frame forward and rewind secondary camera one frame backward - * - * @param {array} rgb Color to set light for frames - * - * @returns {integer} Length of action in ms - **/ - async camera_forward_camera_second_backward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let both; - let ms; - try { - if (!this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(true); - } - if (this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) { - ms = await this.cam.both(); - } - else { - this.cam.move(); - this.cam2.move(); - both = [await this.cam.move, await this.cam2.move]; - ms = Math.max(...both); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Rewind first camera one frame backward and move secondary camera one frame forward - * - * @param {array} rgb Color to set light for frame - * - * @returns {integer} Length of action in ms - **/ - async camera_backward_camera_second_forward(rgb = [255, 255, 255]) { - const id = uuid_1.v4(); - const off = [0, 0, 0]; - let both; - let ms; - try { - if (this.cam.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam.set(false); - } - if (!this.cam2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.cam2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(rgb, id); - await delay_1.delay(this.cfg.arduino.serialDelay); - if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) { - ms = await this.cam.both(); - } - else { - this.cam.move(); - this.cam.move(); - both = [await this.cam.move, await this.proj2.move]; - ms = Math.max(...both); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.light.set(off, id); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the secondary projector forward one frame - * - * @returns {integer} Length of action in ms - **/ - async projector_second_forward() { - let ms; - try { - if (!this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.proj2.move(); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Rewind the secondary projector backward one frame - * - * @returns {integer} Length of action in ms - **/ - async projector_second_backward() { - let ms; - try { - if (this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - ms = await this.proj2.move(); - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the both projectors forward one frame - * - * @returns {integer} Length of action in ms - **/ - async projectors_forward() { - let both; - let ms; - try { - if (!this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(true); - } - if (!this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) { - ms = await this.proj.both(); - } - else { - this.proj.move(); - this.proj2.move(); - both = [await this.proj.move, await this.proj2.move]; - ms = Math.max(...both); - } - } - catch (err) { - throw err; - } - return ms; - } - /** - * Rewind both projectors backwards one frame - * - * @returns {integer} Length of action in ms - **/ - async projectors_backward() { - let both; - let ms; - try { - if (this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(false); - } - if (this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - //run one projector without await? - if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) { - ms = await this.proj.both(); - } - else { - this.proj.move(); - this.proj2.move(); - both = [await this.proj.move, await this.proj2.move]; - ms = Math.max(...both); - } - } - catch (err) { - throw err; - } - return ms; - } - /** - * Move the primary projector forward one frame and rewind the secondary projector - * one frame backwards. - * - * @returns {integer} Length of action in ms - **/ - async projector_forward_projector_second_backward() { - let both; - let ms; - try { - if (!this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(true); - } - if (this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(false); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - //run one projector without await? - if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) { - ms = await this.proj.both(); - } - else { - this.proj.move(); - this.proj2.move(); - both = [await this.proj.move, await this.proj2.move]; - ms = Math.max(...both); - } - } - catch (err) { - throw err; - } - return ms; - } - /** - * Rewind the primary projector backwards one frame and move the secondary - * projector forward one frame. - * - * @returns {integer} Length of action in ms - **/ - async projector_backward_projector_second_forward() { - let both; - let ms; - try { - if (this.proj.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj.set(false); - } - if (!this.proj2.state.dir) { - await delay_1.delay(this.cfg.arduino.serialDelay); - await this.proj2.set(true); - } - await delay_1.delay(this.cfg.arduino.serialDelay); - //run one projector without await? - if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) { - ms = await this.proj.both(); - } - else { - this.proj.move(); - this.proj2.move(); - both = [await this.proj.move, await this.proj2.move]; - ms = Math.max(...both); - } - } - catch (err) { - throw err; - } - return ms; - } -} -module.exports = function (cfg, proj, cam, light, cam2, proj2) { - return new Commands(cfg, proj, cam, light, cam2, proj2); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/cmd/index.js.map b/cli/lib/cmd/index.js.map deleted file mode 100644 index f91a2d1..0000000 --- a/cli/lib/cmd/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cmd/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAkC;AAClC,iCAA8B;AAE9B,MAAM,QAAQ;IAWb;;;;;;;;;;QAUI;IAEJ,YAAa,GAAS,EAAE,IAAU,EAAE,GAAS,EAAE,KAAW,EAAE,OAAa,IAAI,EAAE,QAAc,IAAI;QAChG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3B,IAAI,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAE9B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;IACxC,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,iBAAiB;QAC7B,IAAI,EAAW,CAAC;QAChB,IAAI;YACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;gBACzB,MAAM,aAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC1C,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aAC1B;YACD,MAAM,aAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1C,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YAC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ED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS,EAAE,IAAU,EAAE,GAAS,EAAE,KAAW,EAAE,IAAU,EAAE,KAAW;IAChG,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/cmd/package.json b/cli/lib/cmd/package.json deleted file mode 100644 index c8b0f10..0000000 --- a/cli/lib/cmd/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "cmd", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/delay/Readme.md b/cli/lib/delay/Readme.md deleted file mode 100644 index 7110004..0000000 --- a/cli/lib/delay/Readme.md +++ /dev/null @@ -1,12 +0,0 @@ - - -## delay(ms) ⇒ 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/cli/lib/delay/index.js b/cli/lib/delay/index.js deleted file mode 100644 index 4a0d243..0000000 --- a/cli/lib/delay/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -/** - * Delay in an async/await function - * - * @param {integer} ms Milliseconds to delay for - * - * @returns {Promise} Promise to resolve after timeout - **/ -function delay(ms) { - return new Promise((resolve) => { - return setTimeout(resolve, ms); - }); -} -module.exports.delay = delay; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/delay/index.js.map b/cli/lib/delay/index.js.map deleted file mode 100644 index 38ed5e5..0000000 --- a/cli/lib/delay/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delay/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;IAMI;AAEJ,SAAS,KAAK,CAAE,EAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAa,EAAE,EAAE;QACpC,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC"} \ No newline at end of file diff --git a/cli/lib/delay/package.json b/cli/lib/delay/package.json deleted file mode 100644 index 9a1fe44..0000000 --- a/cli/lib/delay/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "delay", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/device/index.js b/cli/lib/device/index.js deleted file mode 100644 index 40193cd..0000000 --- a/cli/lib/device/index.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict' - -let arduino -const log = require('log')({quiet : false}) -const dev = {} - -dev.init = function () { - dev.listen() -} - -dev.listen = function () { - ipcMain.on('profile', (event, arg) => { - log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false) - settings.update('profile', arg.profile) - settings.save() - }) -} - -dev.enumerate = async function () { - let devices - try{ - devices = await arduino.enumerate() - } catch (err) { - log.info(err, 'SERIAL', false, true) - await delay(1000) - return dev.all([]) - } - log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true) - devices = dev.favor(devices) - return await dev.all(devices) -} - -dev.favor = function (devices) { - const past = mcopy.settings.devices.filter(device => { - if (device.arduino) { - return device - } - }).map(device => { - return device.arduino - }) - if (past.length === 0) { - return devices - } - devices.sort((a, b) => { - if (past.indexOf(a) !== -1 && past.indexOf(b) === -1) { - return 1 - } else if (past.indexOf(a) === -1 && past.indexOf(b) !== -1) { - return -1 - } - return 0 - }) - return devices -} - -dev.distinguish = async function (device) { - let connectSuccess - let verifySuccess - let type - - try { - connectSuccess = await arduino.connect('connect', device, true) - } catch (err) { - console.error(err) - return null - } - - await delay(2000) - - try { - verifySuccess = await arduino.verify() - } catch (err) { - console.error(err) - return null - } - - log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true) - - await delay(1000) - - try { - type = await arduino.distinguish() - } catch (err) { - console.error(err) - return null - } - - dev.remember('arduino', device, type) - log.info(`Determined ${device} to be ${type}`, 'SERIAL', true, true) - - return type -} - -dev.fakeProjector = async function () { - dev.connected.projector = '/dev/fake' - try { - await arduino.fakeConnect('projector') - } catch (err) { - console.error(err) - log.error(`Error connecting to fake PRONECTOR device`, 'SERIAL', true, true) - return false - } - log.info('Connected to fake PROJECTOR device', 'SERIAL', true, true) - return true -} -dev.fakeCamera = async function () { - dev.connected.camera = '/dev/fake' - try { - await arduino.fakeConnect('camera') - } catch (err) { - console.error(err) - log.error(`Error connecting to fake CAMERA device`, 'SERIAL', true, true) - return false - } - log.info('Connected to fake CAMERA device', 'SERIAL', true, true) - return true -} -dev.fakeLight = async function () { - dev.connected.light = '/dev/fake' - try { - await arduino.fakeConnect('light') - } catch (err) { - console.error(err) - log.error(`Error connecting to fake LIGHT device`, 'SERIAL', true, true) - return false - } - log.info('Connected to fake LIGHT device', 'SERIAL', true, true) - return true -} - -dev.connectDevice = async function (device, type) { - let closeSuccess - let connectSuccess - try { - closeSuccess = await arduino.close() - } catch (err) { - console.error(err) - return false - } - if (type === 'projector') { - dev.connected.projector = device - try { - connectSuccess = await arduino.connect('projector', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as PROJECTOR`, 'SERIAL', true, true) - } else if (type === 'camera') { - dev.connected.camera = device - try { - connectSuccess = await arduino.connect('camera', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as CAMERA`, 'SERIAL', true, true) - } else if (type === 'light') { - dev.connected.light = device - try { - connectSuccess = await arduino.connect('light', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as LIGHT`, 'SERIAL', true, true) - } else if (type === 'projector,light') { - dev.connected.projector = device - dev.connected.light = device - arduino.alias('light', device) - try{ - connectSuccess = await arduino.connect('projector', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as PROJECTOR + LIGHT`, 'SERIAL', true, true) - - } else if (type === 'projector,camera,light') { - dev.connected.projector = device - dev.connected.camera = device - dev.connected.light = device - arduino.alias('camera', device) - arduino.alias('light', device) - try { - connectSuccess = await arduino.connect('projector', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as PROJECTOR + CAMERA + LIGHT`, 'SERIAL', true, true) - - } else if (type === 'projector,camera') { - dev.connected.projector = device - dev.connected.camera = device - arduino.alias('camera', device) - try { - connectSuccess = await arduino.connect('projector', device, false) - } catch (err) { - console.error(err) - return false - } - log.info(`Connected to ${device} as PROJECTOR`, 'SERIAL', true, true) - } - return connectSuccess -} - -//Cases for 1 or 2 arduinos connected -dev.all = async function (devices) { - let c = {} - let p = {} - let l = {} - let type - let d - - - dev.connected = { - projector : false, - camera : false, - light : false - } - - let checklist = [] - - for (let device of devices) { - try { - type = await dev.distinguish(device) - } catch (err) { - console.error(err) - return reject(err) - } - - try { - await dev.connectDevice(device, type) - } catch (err) { - console.error(err) - return reject(err) - } - } - - //done checking devices - - if (!dev.connected.projector) { - await dev.fakeProjector() - } - p.arduino = dev.connected.projector - if (!dev.connected.camera) { - await dev.fakeCamera() - } - c.arduino = dev.connected.camera - - if (mcopy.settings.camera.intval) { - c.intval = mcopy.settings.camera.intval - await delay(1000) - await cam.connectIntval(null, { connect : true, url : c.intval }) - } - - if (!dev.connected.light) { - await dev.fakeLight() - } - - l.arduino = dev.connected.light - - return dev.ready(p, c, l) -} - -dev.remember = function (which, device, type) { - let deviceEntry - const match = mcopy.settings.devices.filter(dev => { - if (dev[which] && dev[which] === device) { - return dev - } - }) - if (match.length === 0) { - deviceEntry = { - type : type - } - deviceEntry[which] = device - mcopy.settings.devices.push(deviceEntry) - settings.update('devices', mcopy.settings.devices) - settings.save() - } -}; - -dev.ready = function (projector, camera, light) { - mainWindow.webContents.send('ready', { - camera, - projector, - light, - profile: mcopy.settings.profile - }) - settings.update('camera', camera) - settings.update('projector', projector) - settings.update('light', light) - settings.save() - return true -}; - -module.exports = function (a) { - arduino = a - return dev -} \ No newline at end of file diff --git a/cli/lib/device/package.json b/cli/lib/device/package.json deleted file mode 100644 index 5911476..0000000 --- a/cli/lib/device/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "device", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/devices/Readme.md b/cli/lib/devices/Readme.md deleted file mode 100644 index e48bcbe..0000000 --- a/cli/lib/devices/Readme.md +++ /dev/null @@ -1,74 +0,0 @@ - - -## Devices -class representing the device discovery features - -**Kind**: global class - -* [Devices](#Devices) - * [.init()](#Devices+init) - * [.listen()](#Devices+listen) - * [.listener()](#Devices+listener) - * [.enumerate()](#Devices+enumerate) - * [.favor()](#Devices+favor) - * [.distinguish()](#Devices+distinguish) - * [.fakeProjector()](#Devices+fakeProjector) - * [.fakeCamera()](#Devices+fakeCamera) - * [.fakeLight()](#Devices+fakeLight) - * [.connectDevice()](#Devices+connectDevice) - * [.all()](#Devices+all) - * [.remember()](#Devices+remember) - * [.ready()](#Devices+ready) - - - -### devices.init() -**Kind**: instance method of [Devices](#Devices) - - -### devices.listen() -**Kind**: instance method of [Devices](#Devices) - - -### devices.listener() -**Kind**: instance method of [Devices](#Devices) - - -### devices.enumerate() -**Kind**: instance method of [Devices](#Devices) - - -### devices.favor() -**Kind**: instance method of [Devices](#Devices) - - -### devices.distinguish() -**Kind**: instance method of [Devices](#Devices) - - -### devices.fakeProjector() -**Kind**: instance method of [Devices](#Devices) - - -### devices.fakeCamera() -**Kind**: instance method of [Devices](#Devices) - - -### devices.fakeLight() -**Kind**: instance method of [Devices](#Devices) - - -### devices.connectDevice() -**Kind**: instance method of [Devices](#Devices) - - -### devices.all() -**Kind**: instance method of [Devices](#Devices) - - -### devices.remember() -**Kind**: instance method of [Devices](#Devices) - - -### devices.ready() -**Kind**: instance method of [Devices](#Devices) diff --git a/cli/lib/devices/index.js b/cli/lib/devices/index.js deleted file mode 100644 index 0a64a76..0000000 --- a/cli/lib/devices/index.js +++ /dev/null @@ -1,466 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const delay_1 = require("delay"); -const Log = require("log"); -/** - * class representing the device discovery features - * - * - **/ -class Devices { - /** - * Constructor assigns arduino, settings, UI browser window and cam objects - * locally to this class for reference. - **/ - constructor(arduino, settings, mainWindow, cam) { - this.connected = {}; - this.arduino = arduino; - this.settings = settings; - this.mainWindow = mainWindow; - this.ui = this.mainWindow.webContents; - this.cam = cam; - this.init(); - } - /** - * Initialize the log for "devices". Establish an ipc connection to the UI. - * Start listening on that ipc connection. - **/ - async init() { - this.log = await Log({ label: 'devices' }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * Listen to the "profile" channel for messages from the UI. - **/ - listen() { - this.ipc.on('profile', this.listener.bind(this)); - } - /** - * The "profile" channel callback. If a profile is changed, set it in the - * local settings object. - **/ - listener(event, arg) { - this.log.info(`Saving profile ${arg.profile}`, 'SETTINGS', false, false); - this.settings.update('profile', arg.profile); - this.settings.save(); - } - /** - * - **/ - async enumerate() { - let devices; - try { - devices = await this.arduino.enumerate(); - } - catch (err) { - this.log.warn(err, 'SERIAL', false, true); - await delay_1.delay(1000); - return this.all([]); - } - this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true); - devices = this.favor(devices); - return await this.all(devices); - } - /** - * - **/ - favor(devices) { - const past = this.settings.state.devices.filter((device) => { - if (device.arduino) { - return device; - } - }).map((device) => { - return device.arduino; - }); - if (past.length === 0) { - return devices; - } - devices.sort((a, b) => { - if (past.indexOf(a) !== -1 && past.indexOf(b) === -1) { - return 1; - } - else if (past.indexOf(a) === -1 && past.indexOf(b) !== -1) { - return -1; - } - return 0; - }); - return devices; - } - /** - * - **/ - async distinguish(device) { - let connectSuccess; - let verifySuccess; - let type; - try { - connectSuccess = await this.arduino.connect('connect', device, true); - } - catch (err) { - this.log.error('Error connecting', err); - return null; - } - await delay_1.delay(2000); - try { - verifySuccess = await this.arduino.verify(); - } - catch (err) { - this.log.error('Error verifying device', err); - return null; - } - this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true); - await delay_1.delay(1000); - try { - type = await this.arduino.distinguish(); - } - catch (err) { - this.log.error('Error distinguishing device', err); - return null; - } - this.remember('arduino', device, type); - this.log.info(`Determined ${device} to be ${type}`, 'SERIAL', true, true); - return type; - } - /** - * - **/ - async fakeProjector() { - this.connected.projector = '/dev/fake'; - try { - await this.arduino.fakeConnect('projector'); - } - catch (err) { - console.error(err); - this.log.error(`Error connecting to fake PRONECTOR device`, 'SERIAL', true, true); - return false; - } - this.log.info('Connected to fake PROJECTOR device', 'SERIAL', true, true); - return true; - } - /** - * - **/ - async fakeCamera() { - this.connected.camera = '/dev/fake'; - try { - await this.arduino.fakeConnect('camera'); - } - catch (err) { - console.error(err); - this.log.error(`Error connecting to fake CAMERA device`, 'SERIAL', true, true); - return false; - } - this.log.info('Connected to fake CAMERA device', 'SERIAL', true, true); - return true; - } - /** - * - **/ - async fakeLight() { - this.connected.light = '/dev/fake'; - try { - await this.arduino.fakeConnect('light'); - } - catch (err) { - console.error(err); - this.log.error(`Error connecting to fake LIGHT device`, 'SERIAL', true, true); - return false; - } - this.log.info('Connected to fake LIGHT device', 'SERIAL', true, true); - return true; - } - /** - * - **/ - async connectDevice(device, type) { - let closeSuccess; - let connectSuccess; - try { - closeSuccess = await this.arduino.close(); - } - catch (err) { - this.log.error('Error closing arduino connection', err); - return false; - } - if (type === 'projector') { - this.connected.projector = device; - try { - connectSuccess = await this.arduino.connect('projector', device, false); - } - catch (err) { - this.log.error('Error connecting to projector', err); - return false; - } - this.log.info(`Connected to ${device} as PROJECTOR`, 'SERIAL', true, true); - } - else if (type === 'camera') { - this.connected.camera = device; - try { - connectSuccess = await this.arduino.connect('camera', device, false); - } - catch (err) { - this.log.error('Error connecting to camera', err); - return false; - } - this.log.info(`Connected to ${device} as CAMERA`, 'SERIAL', true, true); - } - else if (type === 'light') { - this.connected.light = device; - try { - connectSuccess = await this.arduino.connect('light', device, false); - } - catch (err) { - this.log.error('Error connecting to light', err); - return false; - } - this.log.info(`Connected to ${device} as LIGHT`, 'SERIAL', true, true); - } - else if (type === 'projector,light') { - this.connected.projector = device; - this.connected.light = device; - this.arduino.aliasSerial('light', device); - try { - connectSuccess = await this.arduino.connect('projector', device, false); - } - catch (err) { - this.log.error('Error connecting to projector and light', err); - return false; - } - this.log.info(`Connected to ${device} as PROJECTOR + LIGHT`, 'SERIAL', true, true); - } - else if (type === 'projector,camera,light') { - this.connected.projector = device; - this.connected.camera = device; - this.connected.light = device; - this.arduino.aliasSerial('camera', device); - this.arduino.aliasSerial('light', device); - try { - connectSuccess = await this.arduino.connect('projector', device, false); - } - catch (err) { - this.log.error('Error connecting to projector, camera and light', err); - return false; - } - this.log.info(`Connected to ${device} as PROJECTOR + CAMERA + LIGHT`, 'SERIAL', true, true); - } - else if (type === 'projector,camera') { - this.connected.projector = device; - this.connected.camera = device; - this.arduino.aliasSerial('camera', device); - try { - connectSuccess = await this.arduino.connect('projector', device, false); - } - catch (err) { - this.log.error('Error connecting to projector and camera', err); - return false; - } - this.log.info(`Connected to ${device} as PROJECTOR + CAMERA`, 'SERIAL', true, true); - } - else if (type === 'projector_second') { - this.connected.projector_second = device; - try { - connectSuccess = await this.arduino.connect('projector_second', device, false); - } - catch (err) { - this.log.error('Error connecting to secondary projector', err); - return false; - } - this.log.info(`Connected to ${device} as PROJECTOR_SECOND`, 'SERIAL', true, true); - } - else if (type === 'projector,projector_second') { - this.connected.projector = device; - this.connected.projector_second = device; - this.arduino.aliasSerial('projector_second', device); - try { - connectSuccess = await this.arduino.connect('projector', device, false); - } - catch (err) { - this.log.error('Error connecting to projector and secondary projector', err); - return false; - } - } - else if (type === 'camera_second') { - this.connected.camera_second = device; - try { - connectSuccess = await this.arduino.connect('camera_second', device, false); - } - catch (err) { - console.error(err); - return false; - } - } - else if (type === 'camera,camera_second') { - this.connected.camera = device; - this.connected.camera_second = device; - this.arduino.aliasSerial('camera_second', device); - try { - connectSuccess = await this.arduino.connect('camera', device, false); - } - catch (err) { - this.log.error('Error connecting to camera, camera_secondary and projector', err); - return false; - } - } - else if ('camera,projector,projector_second') { - this.connected.camera = device; - this.connected.projector = device; - this.connected.projector_second = device; - this.arduino.aliasSerial('projector', device); - this.arduino.aliasSerial('projector_second', device); - try { - connectSuccess = await this.arduino.connect('camera', device, false); - } - catch (err) { - this.log.error('Error connecting to camera, projector and projector_second', err); - return false; - } - } - else if ('camera,camera_second,projector') { - this.connected.camera = device; - this.connected.camera_second = device; - this.connected.projector = device; - this.arduino.aliasSerial('camera_second', device); - this.arduino.aliasSerial('projector', device); - try { - connectSuccess = await this.arduino.connect('camera', device, false); - } - catch (err) { - this.log.error('Error connecting to camera, camera_second and projector', err); - return false; - } - } - else if ('camera,camera_second,projector,projector_second') { - this.connected.camera = device; - this.connected.camera_second = device; - this.connected.projector = device; - this.connected.projector_second = device; - this.arduino.aliasSerial('camera_second', device); - this.arduino.aliasSerial('projector', device); - this.arduino.aliasSerial('projector_second', device); - try { - connectSuccess = await this.arduino.connect('camera', device, false); - } - catch (err) { - this.log.error('Error connecting to camera, camera_second, projector and projector_second', err); - return false; - } - } - return connectSuccess; - } - /** - * - **/ - //Cases for 1 or 2 arduinos connected - async all(devices) { - let c = {}; - let p = {}; - let l = {}; - let type; - let d; - let cs = {}; - let ps = {}; - let checklist = []; - this.connected = { - projector: false, - camera: false, - light: false, - projector_second: false - }; - for (let device of devices) { - try { - type = await this.distinguish(device); - } - catch (err) { - this.log.error('Error distinguishing device', err); - throw err; - } - try { - await this.connectDevice(device, type); - } - catch (err) { - this.log.error('Error connecting to device', err); - throw err; - } - } - //done checking devices - if (!this.connected.projector) { - await this.fakeProjector(); - } - p.arduino = this.connected.projector; - if (!this.connected.camera) { - await this.fakeCamera(); - } - c.arduino = this.connected.camera; - if (!this.connected.light) { - await this.fakeLight(); - } - l.arduino = this.connected.light; - if (this.connected.camera_second) { - cs = { arduino: this.connected.camera_second }; - } - if (this.connected.projector_second) { - ps = { arduino: this.connected.projector_second }; - } - if (this.settings.state.camera && this.settings.state.camera.intval) { - c.intval = this.settings.state.camera.intval; - } - return this.ready(p, c, l, cs, ps); - } - /** - * - **/ - remember(which, device, type) { - let deviceEntry; - const match = this.settings.state.devices.filter((dev) => { - if (dev[which] && dev[which] === device) { - return dev; - } - }); - if (match.length === 0) { - deviceEntry = { - type: type - }; - deviceEntry[which] = device; - this.settings.state.devices.push(deviceEntry); - this.settings.update('devices', this.settings.state.devices); - this.settings.save(); - } - } - /** - * - **/ - ready(projector, camera, light, camera_second, projector_second) { - let args = { - camera, - projector, - light, - profile: this.settings.state.profile - }; - if (projector_second && projector_second.arduino) { - args.projector_second = projector_second; - this.settings.update('projector_second', projector_second); - this.mainWindow.setSize(800, 800); - } - if (camera_second && camera_second.arduino) { - args.camera_second = camera_second; - this.settings.update('camera_second', camera_second); - if (projector_second && projector_second.arduino) { - this.mainWindow.setSize(900, 800); - } - else { - this.mainWindow.setSize(800, 800); - } - } - this.settings.update('camera', camera); - this.settings.update('projector', projector); - this.settings.update('light', light); - this.settings.save(); - this.ui.send('ready', args); - return true; - } -} -module.exports = function (arduino, settings, mainWindow, cam) { - return new Devices(arduino, settings, mainWindow, cam); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/devices/index.js.map b/cli/lib/devices/index.js.map deleted file mode 100644 index fd06dab..0000000 --- a/cli/lib/devices/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/devices/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,iCAA8B;AAC9B,2BAA4B;AAE5B;;;;IAII;AAEJ,MAAM,OAAO;IAYZ;;;QA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G,aAAa,CAAA;YAClC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;YACpD,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,EAAE;gBACjD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;aACjC;iBAAM;gBACN,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;aACjC;SACD;QAED,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,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;QAEpB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAE3B,OAAO,IAAI,CAAA;IACZ,CAAC;CAMD;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/cli/lib/devices/package.json b/cli/lib/devices/package.json deleted file mode 100644 index 53b9f3e..0000000 --- a/cli/lib/devices/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "devices", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/display/Readme.md b/cli/lib/display/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/display/index.js b/cli/lib/display/index.js deleted file mode 100644 index 38653c2..0000000 --- a/cli/lib/display/index.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * @module display - * Provides features for displaying a full screen display of images for the digital module. - **/ -const path_1 = require("path"); -const url_1 = require("url"); -const delay_1 = require("delay"); -const { BrowserWindow } = require('electron'); -class WebView { - constructor(platform, display) { - this.opened = false; - this.showing = false; - this.loadWait = {}; - const prefs = { - webPreferences: { - nodeIntegration: true, - allowRunningInsecureContent: false - }, - width: 800, - height: 600, - minWidth: 800, - minHeight: 600 //, - //icon: path.join(__dirname, '../../assets/icons/icon.png') - }; - const pagePath = path_1.normalize(path_1.join(__dirname, '../../display.html')); - const pageUrl = url_1.format({ - pathname: pagePath, - protocol: 'file:' - }); - if (!display.primary) { - prefs.x = display.x + 50; - prefs.y = display.y + 50; - } - this.digitalWindow = new BrowserWindow(prefs); - this.digitalWindow.loadURL(pageUrl); - if (process.argv.indexOf('-d') !== -1 || process.argv.indexOf('--dev') !== -1) { - this.digitalWindow.webContents.openDevTools(); - } - this.digitalWindow.on('closed', () => { - this.digitalWindow = null; - this.close(); - }); - //this.digitalWindow.hide(); - this.platform = platform; - this.display = display; - this.ipc = require('electron').ipcMain; - this.ipc.on('display_load', this.onLoad.bind(this)); - } - async open() { - this.digitalWindow.show(); - this.showing = true; - this.opened = true; - await this.digitalWindow.setFullScreen(true); - await delay_1.delay(300); - if (this.platform === 'osx') { - await delay_1.delay(300); //give macs an extra 300ms to open fullscreen - } - } - async show(src) { - const normalSrc = path_1.normalize(path_1.join(src)); - if (!this.digitalWindow) { - console.warn(`Cannot show "${src}" because window does not exist`); - return false; - } - try { - this.digitalWindow.webContents.send('display', { src: normalSrc }); - } - catch (err) { - console.error(err); - } - this.showing = true; - return new Promise(function (resolve) { - this.loadWait[src] = resolve; - }.bind(this)); - } - onLoad(evt, arg) { - if (this.loadWait[arg.src]) { - this.loadWait[arg.src](); - delete this.loadWait[arg.src]; - } - } - async focus() { - if (!this.digitalWindow) { - console.warn(`Cannot show focus screen because window does not exist`); - return false; - } - await delay_1.delay(500); - try { - this.digitalWindow.webContents.send('focus', { focus: true }); - } - catch (err) { - console.error(err); - } - } - async field(ratio) { - if (!this.digitalWindow) { - console.warn(`Cannot show field guide because window does not exist`); - return false; - } - await delay_1.delay(500); - try { - this.digitalWindow.webContents.send('field', { field: true, ratio }); - } - catch (err) { - console.error(err); - } - } - async meter() { - if (!this.digitalWindow) { - console.warn(`Cannot show meter screen because window does not exist`); - return false; - } - await delay_1.delay(500); - try { - this.digitalWindow.webContents.send('meter', { meter: true }); - } - catch (err) { - console.error(err); - } - } - hide() { - if (this.digitalWindow) { - this.digitalWindow.hide(); - } - this.showing = false; - return true; - } - close() { - this.hide(); - if (this.digitalWindow) { - this.digitalWindow.close(); - this.digitalWindow = null; - } - this.opened = false; - this.showing = false; - return true; - } -} -class Display { - constructor(sys) { - this.platform = sys.platform; - this.displays = sys.displays; - this.tmpdir = path_1.join(sys.tmp, 'mcopy_digital'); - this.display = this.displays.find((display) => { - if (display.primary) - return true; - }); - } - async open() { - if (this.wv && this.wv.display && this.wv.display.id !== this.display.id) { - this.wv.close(); - } - if (!this.wv || !this.wv.opened) { - this.wv = new WebView(this.platform, this.display); - await this.wv.open(); - } - } - async show(src) { - await this.wv.show(src); - } - async showPath(pathStr) { - return await this.wv.show(pathStr); - } - hide() { - } - async close() { - return await this.wv.close(); - } - async focus() { - return await this.wv.focus(); - } - async field(ratio) { - return await this.wv.field(ratio); - } - async meter() { - return await this.wv.meter(); - } - change(id) { - this.display = this.displays.find((display) => { - if (display.id == id) - return true; - }); - } -} -module.exports = function (sys) { - return new Display(sys); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/display/index.js.map b/cli/lib/display/index.js.map deleted file mode 100644 index b9db160..0000000 --- a/cli/lib/display/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"A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E,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACM,KAAK,CAAC,KAAK;QACjB,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IACM,MAAM,CAAE,EAAQ;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAa,EAAE,EAAE;YACnD,IAAI,OAAO,CAAC,EAAE,IAAI,EAAE;gBAAE,OAAO,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/display/package.json b/cli/lib/display/package.json deleted file mode 100644 index 62e044a..0000000 --- a/cli/lib/display/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "display", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/exec/Readme.md b/cli/lib/exec/Readme.md deleted file mode 100644 index 7724e22..0000000 --- a/cli/lib/exec/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ - - -## exec(cmd, arg, opts) ⇒ Promise.<{stdout: string, stderr: stderr}> -Promisified child_process.exec - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| cmd | | | -| arg | | | -| opts | | See child_process.exec node docs | -| opts.stdout | stream.Writable | If defined, child process stdout will be piped to it. | -| opts.stderr | stream.Writable | If defined, child process stderr will be piped to it. | - diff --git a/cli/lib/exec/index.js b/cli/lib/exec/index.js deleted file mode 100644 index 2238120..0000000 --- a/cli/lib/exec/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; -const execRaw = require('child_process').exec; -/** - * Promisified child_process.exec - * - * @param cmd - * @param arg - * @param opts See child_process.exec node docs - * @param {stream.Writable} opts.stdout If defined, child process stdout will be piped to it. - * @param {stream.Writable} opts.stderr If defined, child process stderr will be piped to it. - * - * @returns {Promise<{ stdout: string, stderr: stderr }>} - */ -async function exec(...args) { - let cmd = args[0]; - let argz = null; - let opts = null; - if (typeof args[1] === 'object' && Array.isArray(args[1])) { - argz = args[1]; - } - if (argz === null && typeof args[1] === 'object') { - opts = args[1]; - } - else if (typeof args[2] === 'object') { - opts = args[2]; - } - if (opts === null) { - opts = { maxBuffer: 1024 * 1024 }; - } - return new Promise((resolve, reject) => { - const child = execRaw(cmd, opts, (err, stdout, stderr) => err ? reject(err) : resolve({ - stdout, - stderr - })); - if (opts.stdout) { - child.stdout.pipe(opts.stdout); - } - if (opts.stderr) { - child.stderr.pipe(opts.stderr); - } - }); -} -module.exports.exec = exec; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/exec/index.js.map b/cli/lib/exec/index.js.map deleted file mode 100644 index 1e32b7b..0000000 --- a/cli/lib/exec/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exec/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,IAAI,CAAA;AAE7C;;;;;;;;;;GAUG;AACH,KAAK,UAAU,IAAI,CAAC,GAAG,IAAe;IACrC,IAAI,GAAG,GAAY,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,IAAI,GAAY,IAAI,CAAA;IACxB,IAAI,IAAI,GAAS,IAAI,CAAA;IAErB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1D,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;KACd;IACD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;QACjD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;KACd;SAAM,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;QACvC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;KACd;IACD,IAAI,IAAI,KAAK,IAAI,EAAE;QAClB,IAAI,GAAG,EAAE,SAAS,EAAG,IAAI,GAAG,IAAI,EAAE,CAAA;KAClC;IACE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,EACjC,CAAC,GAAW,EAAE,MAAe,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7E,MAAM;YACN,MAAM;SACN,CAAC,CAAC,CAAC;QACC,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAClC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA"} \ No newline at end of file diff --git a/cli/lib/exec/package.json b/cli/lib/exec/package.json deleted file mode 100644 index 65f0c63..0000000 --- a/cli/lib/exec/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "exec", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/exit/Readme.md b/cli/lib/exit/Readme.md deleted file mode 100644 index 8bed916..0000000 --- a/cli/lib/exit/Readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## exit(msg, code) -Exit process with either a 0 code or other -specified failure code. Print message to console first. - -**Kind**: global function - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| msg | string | | Reason for exit | -| code | integer | 0 | process exit code, default 0 | - diff --git a/cli/lib/exit/index.js b/cli/lib/exit/index.js deleted file mode 100644 index aef14d4..0000000 --- a/cli/lib/exit/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; -/** - * Exit process with either a 0 code or other - * specified failure code. Print message to console first. - * - * @param {string} msg Reason for exit - * @param {integer} code process exit code, default 0 - **/ -function exit(msg, code = 0) { - if (code === 0) { - console.log(msg); - process.exit(); - } - else { - console.error(msg); - process.exit(code); - } -} -module.exports.exit = exit; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/exit/index.js.map b/cli/lib/exit/index.js.map deleted file mode 100644 index 32d707c..0000000 --- a/cli/lib/exit/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exit/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;IAMI;AAEJ,SAAS,IAAI,CAAE,GAAY,EAAE,OAAgB,CAAC;IAC7C,IAAI,IAAI,KAAK,CAAC,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,EAAE,CAAC;KACf;SAAM;QACN,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACnB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/cli/lib/exit/package.json b/cli/lib/exit/package.json deleted file mode 100644 index 0ab494d..0000000 --- a/cli/lib/exit/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "exit", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/ffmpeg/Readme.md b/cli/lib/ffmpeg/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/ffmpeg/index.js b/cli/lib/ffmpeg/index.js deleted file mode 100644 index db6f4eb..0000000 --- a/cli/lib/ffmpeg/index.js +++ /dev/null @@ -1,353 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -/** @module ffmpeg **/ -const path_1 = require("path"); -const fs_extra_1 = require("fs-extra"); -const exec_1 = require("exec"); -const child_process_1 = require("child_process"); -async function spawnAsync(bin, args) { - return new Promise((resolve, reject) => { - const child = child_process_1.spawn(bin, args); - let stdout = ''; - let stderr = ''; - child.on('exit', (code) => { - if (code === 0) { - return resolve({ stdout, stderr }); - } - else { - console.error(`Process exited with code: ${code}`); - console.error(stderr); - return reject(stderr); - } - }); - child.stdout.on('data', (data) => { - stdout += data; - }); - child.stderr.on('data', (data) => { - stderr += data; - }); - return child; - }); -} -/** @class FFMPEG **/ -class FFMPEG { - /** - * @constructor - * Creates an ffmpeg class - * - * @param {object} sys System object to be used to get temp directory - **/ - constructor(sys) { - this.id = 'ffmpeg'; - this.onProgress = () => { }; - this.bin = sys.deps.ffmpeg; - this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital'); - this.init(); - } - /** - * Async method to call async functions from constructor - **/ - async init() { - const Log = require('log'); - this.log = await Log({ label: this.id }); - await this.checkDir(); - } - /** - * Add padding to a number to 5 places. Return a string. - * - * @param {integer} i Integer to pad - * - * @returns {string} Padded string - **/ - padded_frame(i) { - let len = (i + '').length; - let str = i + ''; - for (let x = 0; x < 8 - len; x++) { - str = '0' + str; - } - return str; - } - /** - * Parse the stderr output of ffmpeg - * - * @param {string} line Stderr line - **/ - parseStderr(line) { - //frame= 6416 fps= 30 q=31.0 size= 10251kB time=00:03:34.32 bitrate= 391.8kbits/s speed= 1x - let obj = {}; - if (line.substring(0, 'frame='.length) === 'frame=') { - try { - obj.frame = line.split('frame=')[1].split('fps=')[0]; - obj.frame = parseInt(obj.frame); - obj.fps = line.split('fps=')[1].split('q=')[0]; - obj.fps = parseFloat(obj.fps); - obj.time = line.split('time=')[1].split('bitrate=')[0]; - obj.speed = line.split('speed=')[1].trim().replace('x', ''); - obj.speed = parseFloat(obj.speed); - obj.size = line.split('size=')[1].split('time=')[0].trim(); - } - catch (err) { - console.error(err); - console.log(line); - process.exit(); - } - } - else { - } - return obj; - } - /** - * Render a single frame from a video or image to a png. - * - * @param {object} state State object containing file data - * @param {object} light Object containing color information for frame - * - * @returns {string} Path of frame - **/ - async frame(state, light) { - const frameNum = state.frame; - const video = state.path; - const w = state.info.width; - const h = state.info.height; - const padded = this.padded_frame(frameNum); - let ext = 'png'; - let rgb = light.color; - let rgba = {}; - let tmpoutput; - let cmd; - let output; - let fileExists = false; - let scale = ''; - if (w && h) { - scale = `,scale=${w}:${h}`; - } - tmpoutput = path_1.join(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`); - try { - fileExists = await fs_extra_1.exists(tmpoutput); - } - catch (err) { - // - } - if (fileExists) { - this.log.info(`File ${tmpoutput} exists`); - return tmpoutput; - } - // - cmd = `${this.bin} -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 -crf 0 "${tmpoutput}"`; - //cmd2 = `${this.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}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff" - //-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png" - try { - this.log.info(cmd); - output = await exec_1.exec(cmd); - } - catch (err) { - this.log.error(err); - } - if (output && output.stdout) - this.log.info(`"${output.stdout.trim()}"`); - if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) { - rgb = rgb.map((e) => { - return parseInt(e); - }); - rgba = { r: rgb[0], g: rgb[1], b: rgb[2], a: 255 }; - try { - //await Frame.blend(tmpoutput, rgba, tmpoutput); - } - catch (err) { - this.log.error(err); - } - } - return tmpoutput; - } - /** - * Render all frames in a video to the temp directory. - * Not in use. - * - * @param {string} video Path to video - * @param {object} obj Not sure - * - * @returns {?} - **/ - async frames(state) { - const video = state.path; - const w = state.info.width; - const h = state.info.height; - const tmppath = this.TMPDIR; - let ext = 'png'; - let tmpoutput = path_1.join(tmppath, `${state.hash}-export-%08d.${ext}`); - let args; - let output; - let estimated = -1; - //cmd = `${this.bin} -y -i "${video}" -vf "${scale}" -compression_algo raw -pix_fmt rgb24 -crf 0 "${tmpoutput}"`; - args = [ - '-y', - '-i', video - ]; - if (w && h) { - args.push('-vf'); - args.push(`scale=${w}:${h}`); - } - args = args.concat([ - '-compression_algo', 'raw', - '-pix_fmt', 'rgb24', - '-crf', '0', - tmpoutput - ]); - //console.dir(args) - //console.dir(state) - try { - await fs_extra_1.mkdir(tmppath); - } - catch (err) { - if (err.code && err.code === 'EEXIST') { - //directory exists - } - else { - this.log.error(err); - } - } - //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}" - return new Promise((resolve, reject) => { - let stdout = ''; - let stderr = ''; - this.log.info(`${this.bin} ${args.join(' ')}`); - this.child = child_process_1.spawn(this.bin, args); - this.child.on('exit', (code) => { - //console.log('GOT TO EXIT'); - if (code === 0) { - console.log(stderr); - console.log(stdout); - return resolve(true); - } - else { - console.error(`Process exited with code: ${code}`); - console.error(stderr); - return reject(stderr + stdout); - } - }); - this.child.stdout.on('data', (data) => { - const line = data.toString(); - stdout += line; - }); - this.child.stderr.on('data', (data) => { - const line = data.toString(); - const obj = this.parseStderr(line); - if (obj.frame && state.frames) { - obj.progress = obj.frame / state.frames; - } - if (obj.frame && obj.speed && state.frames && state.info.fps) { - //scale by speed - obj.remaining = ((state.frames - obj.frame) / state.info.fps) / obj.speed; - obj.estimated = state.info.seconds / obj.speed; - if (obj.estimated > estimated) { - estimated = obj.estimated; - } - } - if (obj.frame) { - //log.info(`${input.name} ${obj.frame}/${input.frames} ${Math.round(obj.progress * 1000) / 10}% ${Math.round(obj.remaining)} seconds remaining of ${Math.round(obj.estimated)}`); - this.onProgress(obj); - } - }); - }); - } - cancel() { - if (this.child) { - this.child.kill(); - this.log.info(`Stopped exporting sequence with ffmpeg`); - } - } - /** - * Clears a specific frame from the tmp directory - * - * @param {integer} frame Integer of frame to clear - * - * @returns {boolean} True if successful, false if not - **/ - async clear(state) { - const padded = this.padded_frame(state.frame); - let ext = 'png'; - let tmppath; - let fileExists; - tmppath = path_1.join(this.TMPDIR, `${state.hash}-export-${padded}.${ext}`); - try { - fileExists = await fs_extra_1.exists(tmppath); - } - catch (err) { - this.log.error(err); - } - if (!fileExists) - return false; - try { - await fs_extra_1.unlink(tmppath); - this.log.info(`Cleared frame ${tmppath}`); - } - catch (err) { - this.log.error(err); - } - return true; - } - /** - * Deletes all frames in temp directory. - * - **/ - async clearAll() { - const tmppath = this.TMPDIR; - let files; - try { - files = await fs_extra_1.readdir(tmppath); - } - catch (err) { - this.log.error(err); - } - files = files.filter((file) => { - if (file.indexOf('-export-') !== -1) { - return true; - } - return false; - }); - if (files) { - files.forEach(async (file, index) => { - try { - await fs_extra_1.unlink(path_1.join(tmppath, file)); - } - catch (err) { - this.log.error(err); - } - }); - } - } - /** - * Checks if mcopy temp directory exists. If it doesn't, - * creates it. - **/ - async checkDir() { - let fileExists; - try { - fileExists = await fs_extra_1.exists(this.TMPDIR); - } - catch (err) { - this.log.error('Error checking for tmp dir', err); - } - if (!fileExists) { - try { - await fs_extra_1.mkdir(this.TMPDIR); - this.log.info(`Created tmpdir ${this.TMPDIR}`); - } - catch (err) { - this.log.error('Error creating tmp dir', err); - } - } - try { - await this.clearAll(); - } - catch (err) { - this.log.error(err); - } - } -} -module.exports = (sys) => { - return new FFMPEG(sys); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/ffmpeg/index.js.map b/cli/lib/ffmpeg/index.js.map deleted file mode 100644 index 238f534..0000000 --- a/cli/lib/ffmpeg/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,sBAAsB;AAEtB,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAC5B,iDAAsC;AAuBtC,KAAK,UAAU,UAAU,CAAE,GAAY,EAAE,IAAe;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAkB,EAAE,MAAiB,EAAE,EAAE;QACtD,MAAM,KAAK,GAAG,qBAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAa,EAAE,EAAE;YAC/B,IAAI,IAAI,KAAK,CAAC,EAAE;gBACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;aACtC;iBAAM;gBACH,OAAO,CAAC,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;gBACnD,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACtB,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAa,EAAE,EAAE;YACtC,MAAM,IAAI,IAAI,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAa,EAAE,EAAE;YACtC,M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;SACvC;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;SAClD;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,IAAI;gBACH,MAAM,gBAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;aAC/C;YAAC,OAAO,GAAG,EAAE;gBACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;aAC9C;SACD;QACD,IAAI;YACH,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;SACtB;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;IACF,CAAC;CACD;AAGD,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/ffmpeg/package.json b/cli/lib/ffmpeg/package.json deleted file mode 100644 index b78c1be..0000000 --- a/cli/lib/ffmpeg/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "ffmpeg", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/ffprobe/Readme.md b/cli/lib/ffprobe/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/ffprobe/index.js b/cli/lib/ffprobe/index.js deleted file mode 100644 index 0ff4750..0000000 --- a/cli/lib/ffprobe/index.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -/** @module FFPROBE **/ -const fs_extra_1 = require("fs-extra"); -const path_1 = require("path"); -const exec_1 = require("exec"); -//const spawn = require('spawn'); -//const exit = require('exit'); -class FFPROBE { - constructor(sys) { - this.bin = sys.deps.ffprobe; - } - /** - * Parse the fps entry into a float representing the fps of a video - **/ - parseFps(fpsStr) { - let fps = 30.0; - let parts; - if (fpsStr.indexOf('/') !== -1) { - parts = fpsStr.split('/'); - fps = parseFloat(parts[0]) / parseFloat(parts[1]); - } - else { - fps = parseFloat(fpsStr); - } - return fps; - } - /** - * Get info on a video in json format. Use for filmout. - * - * @param {string} video Path to video - * - * @returns {object} Video info in an object - **/ - async info(video) { - const cmd = `${this.bin} -v quiet -print_format json -show_format -show_streams "${video}"`; - let fileExists; - let raw; - let json; - let vid; //whether video has stream with video data - try { - fileExists = await fs_extra_1.exists(video); - } - catch (err) { - return exit(err, 5); - } - if (!fileExists) { - //return exit(`File ${video} does not exist`, 6); - console.error(new Error(`File ${video} does not exist`)); - return false; - } - try { - console.log(cmd); - raw = await exec_1.exec(cmd); - } - catch (err) { - //return exit(err, 7); - console.error(err); - return false; - } - try { - json = JSON.parse(raw.stdout); - } - catch (err) { - return raw.stdout; - } - if (json.format && json.format.duration) { - json.seconds = parseFloat(json.format.duration); - } - if (json && json.streams) { - vid = json.streams.find((stream) => { - if (stream.width && stream.height) - return stream; - }); - } - if (vid) { - json.width = vid.width; - json.height = vid.height; - json.fps = this.parseFps(vid.r_frame_rate); - } - return json; - } - /** - * Count the number of frames in the video using one of two methods. - * The first uses -select_streams and is very fast. The second uses - * -count_frames and is VERY slow. - * - * @param {string} video Path to video - * - * @returns {integer} Number of frames in video - **/ - async frames(video) { - const ext = path_1.extname(video.toLowerCase()); - let cmd = `${this.bin} -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`; - let backup_cmd = `${this.bin} -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`; - let gif_cmd = `identify -format "%n\n" "${video}" | head -1`; - let fileExists; - let raw; - let frames; - try { - fileExists = await fs_extra_1.exists(video); - } - catch (err) { - //return exit(err, 5); - console.error(err); - return false; - } - if (!fileExists) { - //return exit(`File ${video} does not exist`, 6); - console.error(new Error(`File ${video} does not exist`)); - return false; - } - if (ext === '.mkv') { - cmd = backup_cmd; - } - else if (ext === '.gif') { - cmd = gif_cmd; - } - try { - console.log(cmd); - raw = await exec_1.exec(cmd); - } - catch (err) { - console.error(err); - return false; - } - try { - frames = parseInt(raw.stdout); - } - catch (err) { - return raw.stdout; - } - return frames; - } -} -/* -function map (obj : any) { - console.dir(obj); -} -*/ -module.exports = (sys) => { - return new FFPROBE(sys); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/ffprobe/index.js.map b/cli/lib/ffprobe/index.js.map deleted file mode 100644 index 61187ca..0000000 --- a/cli/lib/ffprobe/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,uBAAuB;AAEvB,uCAAkC;AAClC,+BAA+B;AAC/B,+BAA4B;AAC5B,iCAAiC;AACjC,+BAA+B;AAE/B,MAAM,OAAO;IAGZ,YAAa,GAAS;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED;;QAEI;IACI,QAAQ,CAAE,MAAe;QAChC,IAAI,GAAG,GAAY,IAAI,CAAC;QACxB,IAAI,KAAgB,CAAC;QACrB,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC/B,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1B,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAClD;aAAM;YACN,GAAG,GAAG,UA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UAAU,CAAC;SACjB;aAAM,IAAI,GAAG,KAAK,MAAM,EAAE;YAC1B,GAAG,GAAG,OAAO,CAAC;SACd;QACD,IAAI;YACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;SACtB;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnB,OAAO,KAAK,CAAC;SACb;QAED,IAAI;YACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SAC9B;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,GAAG,CAAC,MAAM,CAAC;SAClB;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAED;;;;EAIE;AAEF,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/ffprobe/package.json b/cli/lib/ffprobe/package.json deleted file mode 100644 index 586ea4e..0000000 --- a/cli/lib/ffprobe/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "ffprobe", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/filmout/Readme.md b/cli/lib/filmout/Readme.md deleted file mode 100644 index 967474c..0000000 --- a/cli/lib/filmout/Readme.md +++ /dev/null @@ -1,44 +0,0 @@ - - -## Digital -**Kind**: global class - -* [Digital](#Digital) - * [.init()](#Digital+init) - * [.listen()](#Digital+listen) - * [.set()](#Digital+set) - * [.move()](#Digital+move) - * [.start()](#Digital+start) - * [.end()](#Digital+end) - * [.connectDigital()](#Digital+connectDigital) - - - -### digital.init() -**Kind**: instance method of [Digital](#Digital) - - -### digital.listen() -**Kind**: instance method of [Digital](#Digital) - - -### digital.set() -**Kind**: instance method of [Digital](#Digital) - - -### digital.move() -**Kind**: instance method of [Digital](#Digital) - - -### digital.start() -**Kind**: instance method of [Digital](#Digital) - - -### digital.end() -**Kind**: instance method of [Digital](#Digital) - - -### digital.connectDigital() -Use a file as the "digital" source on "projector" - -**Kind**: instance method of [Digital](#Digital) diff --git a/cli/lib/filmout/index.js b/cli/lib/filmout/index.js deleted file mode 100644 index 4b059d0..0000000 --- a/cli/lib/filmout/index.js +++ /dev/null @@ -1,382 +0,0 @@ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const animated_gif_detector_1 = __importDefault(require("animated-gif-detector")); -const path_1 = require("path"); -const fs_extra_1 = require("fs-extra"); -const delay_1 = require("delay"); -const crypto_1 = require("crypto"); -const frame_1 = __importDefault(require("frame")); -/** - * @module FilmOut - **/ -class FilmOut { - /** - * @constructor - * Builds FilmOut class with display, ffmpeg, ffprobe, ui and light as internal properties. - * - * @param {object} display Display object for showing frames - * @param {object} ffmpeg FFMPEG wrapper - * @param {object} ffprobe FFPROBE wrapper for file info - * @param {object} ui Electron ui object - * @param {object} light Light device object - **/ - constructor(display, ffmpeg, ffprobe, ui, light) { - this.id = 'filmout'; - this.videoExtensions = ['.mpg', '.mpeg', '.mov', '.mkv', '.avi', '.mp4']; - this.stillExtensions = ['.tif', '.tiff', '.png', '.jpg', '.jpeg', '.bmp']; - this.gifExtension = '.gif'; - this.state = { - frame: 0, - frames: 0, - still: false, - path: null, - fileName: null, - info: {}, - dir: true, - enabled: false - }; - this.display = display; - this.ffmpeg = ffmpeg; - this.ffprobe = ffprobe; - this.ui = ui; - this.light = light; - this.init(); - } - /** - * Async function for requiring log, ipcMain and bind events. - **/ - async init() { - const Log = require('log'); - this.log = await Log({ label: this.id }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * - **/ - listen() { - this.ipc.on(this.id, this.onConnect.bind(this)); - this.ipc.on('focus', this.focus.bind(this)); - this.ipc.on('field', this.field.bind(this)); - this.ipc.on('meter', this.meter.bind(this)); - this.ipc.on('filmout_close', this.close.bind(this)); - this.ipc.on('preview', this.preview.bind(this)); - this.ipc.on('preview_frame', this.previewFrame.bind(this)); - this.ipc.on('display', this.onDisplay.bind(this)); - this.ipc.on('pre_export', this.onPreExport.bind(this)); - this.ffmpeg.onProgress = (obj) => { - this.ui.send('pre_export_progress', { progress: obj }); - }; - } - /** - * Create a hash of a string. - * - * @param {string} data Data to produce hash of - */ - hash(data) { - return crypto_1.createHash('sha1').update(data).digest('hex'); - } - /** - * Sets filmout direction. - * - * @param {boolean} dir Direction of filmout - **/ - set(dir) { - this.state.dir = dir; - } - /** - * Moves filmout a frame at a time. - **/ - async move() { - let start = +new Date(); - if (this.state.still) { - return false; - } - if (this.state.dir) { - this.state.frame++; - } - else { - this.state.frame--; - } - if (this.state.frame < 1) { - this.state.frame = 1; - } - return (+new Date()) - start; - } - /** - * Begin the process of exporting single frames from the video for display. - **/ - async start() { - let path; - try { - path = await this.ffmpeg.frame(this.state, this.light.state); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - throw err; - } - await this.display.show(path); - await delay_1.delay(20); - } - /** - * Ends the filmout process and closes the display. - **/ - async end() { - await delay_1.delay(20); - this.display.hide(); - } - /** - * Use a video file as a film out source on "projector" - * - * @param {object} evt Original connect event - * @param {object} arg Arguments from ipc message - **/ - async onConnect(evt, arg) { - let frames = 0; - let isAnimated = false; - let info; - let ext; - ext = path_1.extname(arg.fileName.toLowerCase()); - if (ext === this.gifExtension) { - try { - isAnimated = await this.isGifAnimated(arg.path); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - await this.ui.send(this.id, { valid: false }); - return false; - } - this.state.still = !isAnimated; - } - else if (this.stillExtensions.indexOf(ext) !== -1) { - this.state.still = true; - } - else if (this.videoExtensions.indexOf(ext) !== -1) { - this.state.still = false; - } - else { - this.log.error(`File is not of a valid file type`, 'FILMOUT', true, true); - return false; - } - try { - await this.ffmpeg.clearAll(); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - throw err; - } - if (this.state.still) { - try { - info = await this.stillInfo(arg.path); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - this.state.enabled = false; - await this.ui.send(this.id, { valid: false }); - return false; - } - frames = 1; - } - else { - try { - info = await this.ffprobe.info(arg.path); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - this.state.enabled = false; - await this.ui.send(this.id, { valid: false }); - return false; - } - try { - frames = await this.ffprobe.frames(arg.path); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - this.state.enabled = false; - await this.ui.send(this.id, { valid: false }); - return false; - } - } - this.state.frame = 0; - this.state.path = arg.path; - this.state.fileName = arg.fileName; - this.state.frames = frames; - this.state.info = info; - this.state.hash = this.hash(arg.path); - if (info.seconds) { - this.state.seconds = info.seconds; - } - else if (info.fps && frames) { - this.state.seconds = frames / info.fps; - } - this.log.info(`Opened ${this.state.fileName}`, 'FILMOUT', true, true); - this.log.info(`Frames : ${frames}`, 'FILMOUT', true, true); - this.state.enabled = true; - return await this.ui.send(this.id, { valid: true, state: JSON.stringify(this.state) }); - } - /** - * Pre-export all frames from video for display. - * - * @param {object} evt IPC event - * @param {object} arg IPC args - */ - async onPreExport(evt, arg) { - if (!this.state.path) { - return await this.ui.send('pre_export', { complete: false, err: 'No file to pre export.' }); - } - try { - await this.ffmpeg.frames(this.state); - } - catch (err) { - return await this.ui.send('pre_export', { complete: false, err }); - } - return await this.ui.send('pre_export', { complete: true }); - } - /** - * Return true if gif is animated, false if it is a still - * - * @param {string} pathStr Path to gif to check - * - * @returns {boolean} Whether or not gif is animated - **/ - async isGifAnimated(pathStr) { - let gifBuffer; - try { - gifBuffer = await fs_extra_1.readFile(pathStr); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - return false; - } - return animated_gif_detector_1.default(gifBuffer); - } - /** - * Return information on a still image using the sharp module - * - * @param {string} pathStr Path to gif to check - * - * @returns {object} Info about still from sharp - **/ - async stillInfo(pathStr) { - let info; - try { - info = await frame_1.default.info(pathStr); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - return info; - } - /** - * Preview a frame from the selected video. - * - * @param {object} evt Original event - * @param {object} arg Arguments from message - **/ - async previewFrame(evt, arg) { - const state = JSON.parse(JSON.stringify(this.state)); - let path; - state.frame = arg.frame; - try { - path = await this.ffmpeg.frame(state, { color: [255, 255, 255] }); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - ; - throw err; - } - this.ui.send('preview_frame', { path, frame: arg.frame }); - } - /** - * Open a single frame in a display window to preview filmout. - * - * @param {object} evt Original event - * @param {object} arg Arguments from message - **/ - async preview(evt, arg) { - const state = JSON.parse(JSON.stringify(this.state)); - let path; - state.frame = arg.frame; - this.log.info(`Previewing frame ${state.frame} of ${state.fileName}`); - try { - path = await this.ffmpeg.frame(state, { color: [255, 255, 255] }); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - throw err; - } - try { - await this.display.open(); - await this.display.show(path); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - } - /** - * - **/ - async focus(evt, arg) { - this.log.info(`Showing focus screen`); - try { - await this.display.open(); - await this.display.focus(); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - } - /** - * - **/ - async field(evt, arg) { - const ratio = arg.ratio; - this.log.info(`Showing field guide screen`); - try { - await this.display.open(); - await this.display.field(ratio); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - } - /** - * - **/ - async meter(evt, arg) { - this.log.info(`Showing meter screen`); - try { - await this.display.open(); - await this.display.meter(); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - } - /** - * - **/ - async close(evt, arg) { - try { - await this.display.hide(); - await this.display.close(); - } - catch (err) { - this.log.error(err, 'FILMOUT', true, true); - } - } - /** - * - **/ - onDisplay(evt, arg) { - this.display.change(arg.display); - this.log.info(`Changing the display to ${arg.display}`); - } -} -module.exports = (display, ffmpeg, ffprobe, ui, light) => { - return new FilmOut(display, ffmpeg, ffprobe, ui, light); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/filmout/index.js.map b/cli/lib/filmout/index.js.map deleted file mode 100644 index 82a4c6f..0000000 --- a/cli/lib/filmout/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filmout/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,kFAA6D;AAC7D,+BAA+B;AAC/B,uCAAoC;AACpC,iCAA8B;AAC9B,mCAAoC;AAEpC,kDAA0B;AAE1B;;IAEI;AAEJ,MAAM,OAAO;IAsBZ;;;;;;;;;QASI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QA/BtE,OAAE,GAAY,SAAS,CAAC;QACxB,oBAAe,GAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAChF,oBAAe,GAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAChF,iBAAY,GAAY,MAAM,CAAC;QAChC,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,KAAK,EAAG,KAAK;YACb,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAmBD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,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AC,CAAC;SAC3C;IACF,CAAC;IACD;;QAEI;IACJ,KAAK,CAAC,KAAK,CAAE,GAAS,EAAE,GAAS;QAChC,IAAI;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SAC3B;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SAC3C;IACF,CAAC;IACD;;QAEI;IACJ,SAAS,CAAE,GAAS,EAAE,GAAS;QAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA2B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/filmout/package.json b/cli/lib/filmout/package.json deleted file mode 100644 index afe4e39..0000000 --- a/cli/lib/filmout/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "digital", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/frame/index.js b/cli/lib/frame/index.js deleted file mode 100644 index d740511..0000000 --- a/cli/lib/frame/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const jimp_1 = __importDefault(require("jimp")); -class Frame { - static async info(imagePath) { - let image; - try { - image = await jimp_1.default.read(imagePath); - } - catch (err) { - throw err; - } - return { - width: image.bitmap.width, - height: image.bitmap.height - }; - } - static async solidColor(width, height, color) { - //@ts-ignore - const colorInt = jimp_1.default.rgbaToInt(color.r, color.g, color.b, color.a); - return new Promise((resolve, reject) => { - return new jimp_1.default(width, height, colorInt, (err, image) => { - if (err) { - return reject(err); - } - return resolve(image); - }); - }); - } - static async blend(inPath, color, imagePath) { - //cmd2 = `${this.convert} "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; - const options = { - mode: jimp_1.default.BLEND_DARKEN, - opacitySource: 1.0, - opacityDest: 1.0 - }; - let width; - let height; - let bottom; - let top; - try { - top = await jimp_1.default.read(inPath); - } - catch (err) { - throw err; - } - width = top.bitmap.width; - height = top.bitmap.height; - try { - bottom = await Frame.solidColor(width, height, color); - } - catch (err) { - throw err; - } - bottom.composite(top, 0, 0, options); - try { - await bottom.writeAsync(imagePath); - } - catch (err) { - throw err; - } - return imagePath; - } -} -exports.default = Frame; -module.exports = Frame; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/frame/index.js.map b/cli/lib/frame/index.js.map deleted file mode 100644 index 5221429..0000000 --- a/cli/lib/frame/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/frame/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,gDAAwB;AASxB,MAAqB,KAAK;IACzB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAE,SAAkB;QACpC,IAAI,KAAW,CAAC;QAChB,IAAI;YACH,KAAK,GAAG,MAAM,cAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACnC;QAAC,OAAO,GAAG,EAAE;YACb,MAAM,GAAG,C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AG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;QAE3B,IAAI;YACH,MAAM,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;SACtD;QAAC,OAAO,GAAG,EAAE;YACb,MAAM,GAAG,CAAC;SACV;QAED,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAErC,IAAI;YACH,MAAM,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SACnC;QAAC,OAAO,GAAG,EAAE;YACb,MAAM,GAAG,CAAC;SACV;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AA/DD,wBA+DC;AAED,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA"} \ No newline at end of file diff --git a/cli/lib/intval/Readme.md b/cli/lib/intval/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/intval/index.js b/cli/lib/intval/index.js deleted file mode 100644 index 0ecb0fd..0000000 --- a/cli/lib/intval/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; -class Intval { - constructor(url) { - this._baseUrl = `http://${url}`; - this.req = require('request'); - } - async move() { - return new Promise((resolve, reject) => { - const timeStart = +new Date(); - const url = `${this._baseUrl}/frame`; - //console.log(url) - return this.req(url, (err, res, body) => { - let ms = (+new Date()) - timeStart; - if (err) { - return reject(err); - } - return resolve(ms); - }); - }); - } - async setDir(dir) { - return new Promise((resolve, reject) => { - const timeStart = +new Date(); - const url = `${this._baseUrl}/dir?dir=${dir}`; - //console.log(url) - return this.req(url, (err, res, body) => { - let ms = (+new Date()) - timeStart; - if (err) { - return reject(err); - } - return resolve(ms); - }); - }); - } - async setExposure(exposure, cb) { - return new Promise((resolve, reject) => { - const timeStart = +new Date(); - const url = `${this._baseUrl}/exposure?exposure=${exposure}`; - //console.log(url) - return this.req(url, (err, res, body) => { - let ms = (+new Date()) - timeStart; - if (err) { - return reject(err); - } - return resolve(ms); - }); - }); - } - connect(cb) { - const timeStart = +new Date(); - const url = `${this._baseUrl}/status`; - const opts = { - method: 'GET', - uri: url, - timeout: 5000 - }; - this.req(opts, (err, res, body) => { - let ms = (+new Date()) - timeStart; - if (err) { - //console.error(err) - return cb(err, ms); - } - cb(null, ms, body); - }); - } -} -module.exports.Intval = Intval; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/intval/index.js.map b/cli/lib/intval/index.js.map deleted file mode 100644 index b951f19..0000000 --- a/cli/lib/intval/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/intval/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,MAAM;IAGX,YAAa,GAAY;QACxB,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAA;QAC/B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IACM,KAAK,CAAC,IAAI;QAChB,OAAO,IAAI,OAAO,CAAE,CAAC,OAAa,EAAE,MAAY,EAAE,EAAE;YACnD,MAAM,SAAS,GAAY,CAAC,IAAI,IAAI,EAAE,CAAA;YACtC,MAAM,GAAG,GAAY,GAAG,IAAI,CAAC,QAAQ,QAAQ,CAAA;YAC7C,kBAAkB;YAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAW,EAAE,GAAS,EAAE,IAAa,EAAE,EAAE;gBAC9D,IAAI,EAAE,GAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,SAAS,CAAA;gBAC3C,IAAI,GAAG,EAAE;oBACR,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;iBAClB;gBACD,OAAO,OAAO,CAAC,EAAE,CAAC,CAAA;YACnB,CAAC,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACH,CAAC;IACM,KAAK,CAAC,MAAM,CAAE,GAAa;QACj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AI,EAAE,CAAA;QACtC,MAAM,GAAG,GAAY,GAAG,IAAI,CAAC,QAAQ,SAAS,CAAA;QAC9C,MAAM,IAAI,GAAS;YAClB,MAAM,EAAG,KAAK;YACd,GAAG,EAAG,GAAG;YACT,OAAO,EAAE,IAAI;SACb,CAAA;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAW,EAAE,GAAS,EAAE,IAAa,EAAE,EAAE;YACxD,IAAI,EAAE,GAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,SAAS,CAAA;YAC3C,IAAI,GAAG,EAAE;gBACR,oBAAoB;gBACpB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;aAClB;YACD,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAA;QACnB,CAAC,CAAC,CAAA;IACH,CAAC;CACD;AAED,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/cli/lib/intval/package.json b/cli/lib/intval/package.json deleted file mode 100644 index d888b72..0000000 --- a/cli/lib/intval/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "intval", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/light/Readme.md b/cli/lib/light/Readme.md deleted file mode 100644 index fbc28b4..0000000 --- a/cli/lib/light/Readme.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## Light -**Kind**: global class - -* [Light](#Light) - * [.init()](#Light+init) - * [.listen()](#Light+listen) - * [.listener()](#Light+listener) - * [.set()](#Light+set) - * [.end()](#Light+end) - - - -### light.init() -**Kind**: instance method of [Light](#Light) - - -### light.listen() -**Kind**: instance method of [Light](#Light) - - -### light.listener() -**Kind**: instance method of [Light](#Light) - - -### light.set() -**Kind**: instance method of [Light](#Light) - - -### light.end() -**Kind**: instance method of [Light](#Light) diff --git a/cli/lib/light/index.js b/cli/lib/light/index.js deleted file mode 100644 index 33b901b..0000000 --- a/cli/lib/light/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const delay_1 = require("delay"); -const Log = require("log"); -class Light { - /** - * - **/ - constructor(arduino, cfg, ui) { - this.state = { color: [0, 0, 0] }; - this.enabled = true; - this.id = 'light'; - this.arduino = arduino; - this.cfg = cfg; - this.ui = ui; - this.init(); - } - /** - * - **/ - async init() { - this.log = await Log({ label: this.id }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * - **/ - listen() { - this.ipc.on(this.id, this.listener.bind(this)); - } - /** - * - **/ - async listener(event, arg) { - if (typeof arg.rgb !== 'undefined') { - try { - await this.set(arg.rgb, arg.id, true); - } - catch (err) { - this.log.error('Error setting light', err); - } - } - else if (typeof arg.enable !== 'undefined') { - this.enabled = true; - } - else if (typeof arg.disable !== 'undefined') { - this.enabled = false; - } - event.returnValue = true; - } - /** - * - **/ - async set(rgb, id, on = true) { - const str = rgb.join(','); - let ms; - this.state.color = rgb; - try { - ms = await this.arduino.send(this.id, this.cfg.arduino.cmd.light); - } - catch (err) { - this.log.error('Error sending light command', err); - } - await delay_1.delay(1); - try { - this.arduino.string(this.id, str); - } - catch (err) { - this.log.error('Error sending light string', err); - } - await delay_1.delay(1); - await ms; - return await this.end(rgb, id, ms); - } - /** - * - **/ - async end(rgb, id, ms) { - let res; - //console.trace() - this.log.info(`Light set to ${rgb.join(',')}`, 'LIGHT', true, true); - try { - //console.dir({ rgb, id, ms }) - res = await this.ui.send(this.id, { rgb, id, ms }); - } - catch (err) { - console.error(err); - throw err; - } - return res; - } -} -module.exports = function (arduino, cfg, ui) { - return new Light(arduino, cfg, ui); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/light/index.js.map b/cli/lib/light/index.js.map deleted file mode 100644 index 850542d..0000000 --- a/cli/lib/light/index.js.map +++ /dev/null @@ -1 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AK,CAAC,GAAG,CAAE,GAAc,EAAE,EAAW,EAAE,EAAW;QAC1D,IAAI,GAAG,CAAC;QACR,iBAAiB;QACjB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI;YACH,8BAA8B;YAC9B,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnB,MAAM,GAAG,CAAA;SACT;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,OAAiB,EAAE,GAAS,EAAE,EAAQ;IAChE,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/light/package.json b/cli/lib/light/package.json deleted file mode 100644 index 0d59b65..0000000 --- a/cli/lib/light/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "light", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/log/Readme.md b/cli/lib/log/Readme.md deleted file mode 100644 index 4c3bea3..0000000 --- a/cli/lib/log/Readme.md +++ /dev/null @@ -1,8 +0,0 @@ - - -## logFile() ⇒ string -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**: string - Path to log file diff --git a/cli/lib/log/index.js b/cli/lib/log/index.js deleted file mode 100644 index a7e5a3f..0000000 --- a/cli/lib/log/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const winston_1 = require("winston"); -const path_1 = require("path"); -const fs_extra_1 = require("fs-extra"); -const os_1 = require("os"); -const logTime = 'MM/DD/YY-HH:mm:ss'; -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() { - const homeDir = os_1.homedir(); - const linuxDir = `/.mcopy/`; - const macDir = `/Library/Logs/mcopy/`; - const winDir = `/AppData/Roaming/mcopy/`; - let logPath = path_1.normalize(path_1.join(homeDir, linuxDir)); - let dirExists; - if (process.platform === 'darwin') { - logPath = path_1.normalize(path_1.join(homeDir, macDir)); - } - else if (process.platform === 'win32') { - logPath = path_1.normalize(path_1.join(homeDir, winDir)); - } - try { - dirExists = await fs_extra_1.exists(logPath); - } - catch (err) { - console.error(err); - } - if (!dirExists) { - try { - await fs_extra_1.mkdir(logPath); - } - catch (err) { - console.error(`Error creating directory for mcopy log file, ${logPath}`); - console.error(err); - } - } - return path_1.join(logPath, 'mcopy.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) { - let consoleFormat = { - colorize: true - }; - let fileFormat = { - filename: await logFile(), - json: true - }; - if (arg && arg.quiet) { - transport = { - info: function () { return false; }, - warn: function () { return false; }, - error: function () { return false; } - }; - } - else { - if (arg && arg.label) { - consoleFormat.label = arg.label; - fileFormat.label = arg.label; - } - transport = winston_1.createLogger({ - format: winston_1.format.combine(winston_1.format.label({ label: arg.label || 'mcopy' }), winston_1.format.timestamp({ - format: 'YYYY-MM-DD HH:mm:ss' - }), winston_1.format.printf((info) => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}` + (info.splat !== undefined ? `${info.splat}` : " "))), - transports: [ - new (winston_1.transports.Console)(consoleFormat), - new (winston_1.transports.File)(fileFormat) - ] - }); - } - return transport; -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/log/index.js.map b/cli/lib/log/index.js.map deleted file mode 100644 index 5bdb4b0..0000000 --- a/cli/lib/log/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,qCAA2D;AAC3D,+BAAuC;AACvC,uCAAyC;AACzC,2BAA6B;AAE7B,MAAM,OAAO,GAAG,mBAAmB,CAAA;AACnC,IAAI,SAAe,CAAA;AAEnB;;;;;IAKI;AACJ,KAAK,UAAU,OAAO;IACrB,MAAM,OAAO,GAAY,YAAO,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAY,UAAU,CAAC;IACrC,MAAM,MAAM,GAAY,sBAAsB,CAAC;IAC/C,MAAM,MAAM,GAAY,yBAAyB,CAAC;IAClD,IAAI,OAAO,GAAY,gBAAS,CAAC,WAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,IAAI,SAAmB,CAAC;IAExB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;QAClC,OAAO,GAAG,gBAAS,CAAC,WAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;KAC3C;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACxC,OAAO,GAAG,gBAAS,CAAC,WAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;KAC3C;IAED,IAAI;QACH,SAAS,GAAG,MAAM,iBAAM,CAAC,OAAO,CAAC,CAAC;KAClC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnB;IAED,IAAI,CAAC,SAAS,EAAE;QACf,IAAI;YACH,MAAM,gBAAK,CAAC,OAAO,CAAC,CAAC;SACrB;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,gDAAgD,OAAO,EAAE,CAAC,CAAC;Y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K,EAAE,CAAA,CAAC,CAAA,GAAG,CAAC,CAAC,CAC7I;YACH,UAAU,EAAE;gBACX,IAAI,CAAC,oBAAU,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC;gBACvC,IAAI,CAAC,oBAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC;aACjC;SACD,CAAC,CAAA;KACF;IACD,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/log/package.json b/cli/lib/log/package.json deleted file mode 100644 index 7d7202a..0000000 --- a/cli/lib/log/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "log", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/mscript/Readme.md b/cli/lib/mscript/Readme.md deleted file mode 100644 index 3112f09..0000000 --- a/cli/lib/mscript/Readme.md +++ /dev/null @@ -1,186 +0,0 @@ - - -## lib/mscript - -* [lib/mscript](#module_lib/mscript) - * [~Mscript](#module_lib/mscript..Mscript) - * [.clear()](#module_lib/mscript..Mscript+clear) - * [.interpret()](#module_lib/mscript..Mscript+interpret) - * [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd) - * [.new_loop()](#module_lib/mscript..Mscript+new_loop) - * [.end_loop()](#module_lib/mscript..Mscript+end_loop) - * [.move_cam()](#module_lib/mscript..Mscript+move_cam) - * [.move_proj()](#module_lib/mscript..Mscript+move_proj) - * [.set_state()](#module_lib/mscript..Mscript+set_state) - * [.last_loop()](#module_lib/mscript..Mscript+last_loop) - * [.parent_loop()](#module_lib/mscript..Mscript+parent_loop) - * [.loop_count()](#module_lib/mscript..Mscript+loop_count) - * [.fade()](#module_lib/mscript..Mscript+fade) - * [.fade_count()](#module_lib/mscript..Mscript+fade_count) - * [.fade_start()](#module_lib/mscript..Mscript+fade_start) - * [.fade_end()](#module_lib/mscript..Mscript+fade_end) - * [.update()](#module_lib/mscript..Mscript+update) - * [.str_to_arr()](#module_lib/mscript..Mscript+str_to_arr) - * [.light_to_arr()](#module_lib/mscript..Mscript+light_to_arr) - * [.light_state()](#module_lib/mscript..Mscript+light_state) - * [.fail()](#module_lib/mscript..Mscript+fail) - * [~startsWith()](#module_lib/mscript..startsWith) - - - -### lib/mscript~Mscript -class Mscript - -**Kind**: inner class of [lib/mscript](#module_lib/mscript) - -* [~Mscript](#module_lib/mscript..Mscript) - * [.clear()](#module_lib/mscript..Mscript+clear) - * [.interpret()](#module_lib/mscript..Mscript+interpret) - * [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd) - * [.new_loop()](#module_lib/mscript..Mscript+new_loop) - * [.end_loop()](#module_lib/mscript..Mscript+end_loop) - * [.move_cam()](#module_lib/mscript..Mscript+move_cam) - * [.move_proj()](#module_lib/mscript..Mscript+move_proj) - * [.set_state()](#module_lib/mscript..Mscript+set_state) - * [.last_loop()](#module_lib/mscript..Mscript+last_loop) - * [.parent_loop()](#module_lib/mscript..Mscript+parent_loop) - * [.loop_count()](#module_lib/mscript..Mscript+loop_count) - * [.fade()](#module_lib/mscript..Mscript+fade) - * [.fade_count()](#module_lib/mscript..Mscript+fade_count) - * [.fade_start()](#module_lib/mscript..Mscript+fade_start) - * [.fade_end()](#module_lib/mscript..Mscript+fade_end) - * [.update()](#module_lib/mscript..Mscript+update) - * [.str_to_arr()](#module_lib/mscript..Mscript+str_to_arr) - * [.light_to_arr()](#module_lib/mscript..Mscript+light_to_arr) - * [.light_state()](#module_lib/mscript..Mscript+light_state) - * [.fail()](#module_lib/mscript..Mscript+fail) - - - -#### mscript.clear() -Clear the state of the script - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.interpret() -Main function, accepts multi-line string, parses into lines -and interprets the instructions from the text. Returns an array -of steps to be fed into the mcopy. - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.basic\_cmd() -Apply a basic two character command - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.new\_loop() -Start a new loop - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.end\_loop() -Close the most recent loop - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.move\_cam() -Move camera to explicitly-defined frame - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.move\_proj() -Move projector to explicitly-defined frame - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.set\_state() -Set the state of either the cam or projector - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.last\_loop() -Return the last loop - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.parent\_loop() -Return the second-last loop - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.loop\_count() -Extract the loop count integer from a LOOP cmd - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.fade() -Execute a fade of frame length, from color to another color - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.fade\_count() -Extract the fade length integer from a FADE cmd - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.fade\_start() -Extract the start color from a string - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.fade\_end() -Extract the end color from a string - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.update() -Increase the state of a specific object, such as the camera/projector, -by the value defined in val - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.str\_to\_arr() -Split string on command, extract any integers from string - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.light\_to\_arr() -Split a string on a command to extract data for light array - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.light\_state() -Split a string to extract an rgb color value - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -#### mscript.fail() -Throw an error with specific message - -**Kind**: instance method of [Mscript](#module_lib/mscript..Mscript) - - -### lib/mscript~startsWith() -startswith function from lodash, do not want the entire lib for this - -**Kind**: inner method of [lib/mscript](#module_lib/mscript) diff --git a/cli/lib/mscript/TODO.md b/cli/lib/mscript/TODO.md deleted file mode 100644 index b0f824f..0000000 --- a/cli/lib/mscript/TODO.md +++ /dev/null @@ -1,13 +0,0 @@ -# TODO - mscript - -* Add variables and simple evaluation -* Add "Light" feature - -Bash-like variables? -Similar to LESS/SASS? -Makes a tokenization easier - -@ is better than $ - -RangeError: Invalid array length - at Mscript.str_to_arr (./mcopy/app/lib/mscript/index.js:474:9) diff --git a/cli/lib/mscript/index.js b/cli/lib/mscript/index.js deleted file mode 100644 index daf4dbd..0000000 --- a/cli/lib/mscript/index.js +++ /dev/null @@ -1,691 +0,0 @@ -'use strict'; -const BLACK = '0,0,0'; -const WHITE = '255,255,255'; -const CMD = [ - 'CF', - 'PF', - 'BF', - 'CB', - 'PB', - 'BB' -]; -const ALTS = { - 'CF': ['CAMERA FORWARD', 'CAM FORWARD'], - 'PF': ['PROJECTOR FORWARD', 'PROJ FORWARD'], - 'BF': ['BLACK FORWARD', 'BLACK', 'BLANK FORWARD', 'BLANK'], - 'CB': ['CAMERA BACKWARD', 'CAM BACKWARD', 'CAMERA BACK', 'CAM BACK'], - 'PB': ['PROJECTOR FORWARD', 'PROJ FORWARD', 'PROJECTOR BACK', 'PROJ BACK'], - 'BB': ['BLACK BACKWARD', 'BLACK BACK', 'BLANK BACK'], - 'L ': ['LIGHT', 'COLOR', 'LAMP'], - 'F ': ['FADE'] -}; -const PAUSE = 'PAUSE'; -const ALERT = 'ALERT'; -/** helper functions */ -/** startswith function from lodash, do not want the entire lib for this - * @param str {string} Text to evaluate - * @param target {string} Text to compare string against - * @param position {integer} Position in the string to make comparison at - * - * @returns {boolean} True for match, false for no match - **/ -function startsWith(str, target, position) { - const { length } = str; - position = position == null ? 0 : position; - if (position < 0) { - position = 0; - } - else if (position > length) { - position = length; - } - target = `${target}`; - return str.slice(position, position + target.length) == target; -} -/** class Mscript */ -class Mscript { - /** - * @constructor - * Create new Mscript interpreter - **/ - constructor() { - this.output = {}; - } - /** - * Clear the state of the script - */ - clear() { - this.lines = []; - this.cam = 0; - this.proj = 0; - this.color = ''; - this.loops = []; - this.rec = -1; - this.two = ''; - this.arr = []; - this.meta = []; - this.target = 0; //move to target using CAM # or PROJ # - this.dist = 0; - this.variables = {}; - this.output = {}; - } - /** - * Main function, accepts multi-line string, parses into lines - * and interprets the instructions from the text. Returns an array - * of steps to be fed into the mcopy sequence. - * - * @param {string} text Mscript text to interpret - * @param {function} callback Function to call when string is interpreted - * - * @returns {object} if callback is not provided - */ - interpret(text, callback) { - this.clear(); - if (typeof text === 'undefined') { - return this.fail('No input'); - } - //split string into lines, each containing a command - this.lines = text.split('\n'); - this.lines = this.lines.map(line => { - line = line.replace(/\t+/g, ''); //strip tabs - line = line.trim(); //remove excess whitespace before and after command - line = line.toUpperCase(); - return line; - }); - for (let line of this.lines) { - this.two = line.substring(0, 2); - if (CMD.indexOf(this.two) !== -1) { - this.basic_cmd(line); - } - else if (startsWith(line, PAUSE)) { - this.pause(line); - } - else if (startsWith(line, ALERT)) { - this.alert(line); - } - else if (startsWith(line, '@') || line.indexOf('@') !== -1) { - this.variable(line); - } - else if (startsWith(line, 'LOOP')) { - this.new_loop(line); - } - else if (startsWith(line, 'L ')) { - this.light_state(line); - } - else if (startsWith(line, 'F ')) { - this.new_loop(line, true); - } - else if (startsWith(line, 'END')) { - this.end_loop(line); - } - else if (startsWith(line, 'CAM')) { //directly go to that frame (black?) - this.move_cam(line); - } - else if (startsWith(line, 'PROJ')) { //directly go to that frame - this.move_proj(line); - } - else if (startsWith(line, 'SET')) { //set that state - this.set_state(line); - } - else if (startsWith(line, '#') || startsWith(line, '//')) { - //comments - //ignore while parsing - } - else if (startsWith(line, 'ALERT')) { - } - else if (startsWith(line, 'PAUSE')) { - this.pause(line); - } - } - this.output.success = true; - this.output.arr = this.arr; //all instructions - this.output.meta = this.meta; //all metadata for instructions - this.output.cam = this.cam; - this.output.proj = this.proj; - if (typeof callback !== 'undefined') { - //should only be invoked by running mscript.tests() - callback(this.output); - } - else { - return this.output; - } - } - /** - * Interprets variables for complex sequence behavior. - * TODO: Fully implement, add test coverage - * - * @param {string} line Line containing a variable assignment - * - **/ - variable(line) { - let parts = line.split('='); - let key = parts[0]; - let value = parts[1]; - let update = false; - if (value && value.indexOf('#') !== -1) { - value = value.split('#')[0]; - } - if (value && value.indexOf('//') !== -1) { - value = value.split('//')[0]; - } - if (value && value.indexOf('+') !== -1) { - if (value) - update = true; - } - if (line.indexOf('-') !== -1) { - update = true; - } - if (line.indexOf(',') === -1) { //if not color string - try { - value = parseInt(value); - } - catch (err) { - //supress parsing error - } - } - //console.dir(parts) - if (!this.variables[key] || update) { - this.variables[key] = value; - } - //console.dir(this.variables) - } - /** - * Replace variable with value at time of interpretation - * TODO: Implement this please - * - * @param {string} line Line containing variable to be replaced with value - * - * @returns {string} New string to be interpreted - **/ - variable_replace(line) { - return line; - } - /** - * Interpret a basic two character command - * - * @param {string} line Line of script to interpret - */ - basic_cmd(line) { - if (this.rec !== -1) { - //hold generated arr in state loop array - this.loops[this.rec].arr - .push.apply(this.loops[this.rec].arr, this.str_to_arr(line, this.two)); - this.loops[this.rec].meta - .push.apply(this.loops[this.rec].meta, this.light_to_arr(line, this.two)); - } - else { - this.arr.push.apply(this.arr, this.str_to_arr(line, this.two)); - this.meta.push.apply(this.meta, this.light_to_arr(line, this.two)); - } - } - /** - * Start a new loop - * - * @param {string} line Line to evaluate as either loop or fade - * @param {boolean} fade Flag as boolean if true - */ - new_loop(line, fade) { - this.rec++; - this.loops[this.rec] = { - arr: [], - meta: [], - cam: 0, - proj: 0, - cmd: line + '' - }; - if (fade) { - this.fade(line); - } - } - /** - * Close the most recent loop - * - * @param {string} line Line to interpret - */ - end_loop(line) { - let meta_arr; - let start; - let end; - let len; - for (let x = 0; x < this.loop_count(this.loops[this.rec].cmd); x++) { - meta_arr = this.loops[this.rec].meta; - if (this.loops[this.rec].fade) { - start = this.loops[this.rec].start; - end = this.loops[this.rec].end; - len = this.loops[this.rec].fade_len; - meta_arr = meta_arr.map(l => { - return this.fade_rgb(start, end, len, x); - }); - } - if (this.rec === 0) { - this.arr.push.apply(this.arr, this.loops[this.rec].arr); - this.meta.push.apply(this.meta, meta_arr); - } - else if (this.rec >= 1) { - this.loops[this.rec - 1].arr - .push.apply(this.loops[this.rec - 1].arr, this.loops[this.rec].arr); - this.loops[this.rec - 1].meta - .push.apply(this.loops[this.rec - 1].meta, meta_arr); - } - } - this.update('END', this.loop_count(this.loops[this.rec].cmd)); - delete this.loops[this.rec]; - this.rec--; - } - /** - * Move camera to explicitly-defined frame - * - * @param {string} line Line to interpret with camera move statement - */ - move_cam(line) { - this.target = parseInt(line.split('CAM ')[1]); - if (this.rec !== -1) { - if (this.target > this.cam) { - this.dist = this.target - this.cam; - for (let x = 0; x < this.dist; x++) { - this.loops[this.rec].arr.push('BF'); - this.loops[this.rec].meta.push(BLACK); - this.update('BF'); - } - } - else { - this.dist = this.cam - this.target; - for (let x = 0; x < this.dist; x++) { - this.loops[this.rec].arr.push('BB'); - this.loops[this.rec].meta.push(BLACK); - this.update('BB'); - } - } - } - else { - if (this.target > this.cam) { - this.dist = this.target - this.cam; - for (let x = 0; x < this.dist; x++) { - this.arr.push('BF'); - this.meta.push(BLACK); - this.update('BF'); - } - } - else { - this.dist = this.cam - this.target; - for (let x = 0; x < this.dist; x++) { - this.arr.push('BB'); - this.meta.push(BLACK); - this.update('BB'); - } - } - } - } - /** - * Move projector to explicitly-defined frame - * - * @param {string} line Line containing `move` statement to interpret - */ - move_proj(line) { - this.target = parseInt(line.split('PROJ ')[1]); - if (this.rec !== -1) { - if (this.target > this.proj) { - this.dist = this.target - this.proj; - for (let x = 0; x < this.dist; x++) { - this.loops[this.rec].arr.push('PF'); - this.loops[this.rec].meta.push(''); - this.update('PF'); - } - } - else { - this.dist = this.proj - this.target; - for (let x = 0; x < this.dist; x++) { - this.loops[this.rec].arr.push('PB'); - this.loops[this.rec].meta.push(''); - this.update('PB'); - } - } - } - else { - if (this.target > this.proj) { - this.dist = this.target - this.proj; - for (let x = 0; x < this.dist; x++) { - this.arr.push('PF'); - this.meta.push(''); - this.update('PF'); - } - } - else { - this.dist = this.proj - this.target; - for (let x = 0; x < this.dist; x++) { - this.arr.push('PB'); - this.meta.push(''); - this.update('PB'); - } - } - } - } - /** - * Set the state of either the cam or projector - * - * @param line {string} String containing set statement - */ - set_state(line) { - if (startsWith(line, 'SET CAM')) { - this.cam = parseInt(line.split('SET CAM')[1]); - } - else if (startsWith(line, 'SET PROJ')) { - this.proj = parseInt(line.split('SET PROJ')[1]); - } - } - /** - * Return the last loop - * - * @returns {object} - */ - last_loop() { - return this.loops[this.loops.length - 1]; - } - /** - * Return the second-last loop - * - * @returns {object} Loop array - */ - parent_loop() { - return this.loops[this.loops.length - 2]; - } - /** - * Extract the loop count integer from a LOOP cmd - * - * @returns {integer} Loop count in string parsed into integer - */ - loop_count(str) { - return parseInt(str.split(' ')[1]); - } - /** - * Execute a fade of frame length, from color to another color - * - * @param {string} line Line containing a fade initiator - */ - fade(line) { - let len = this.fade_count(line); - let start = this.fade_start(line); - let end = this.fade_end(line); - this.loops[this.rec].start = start; - this.loops[this.rec].end = end; - this.loops[this.rec].fade = true; - this.loops[this.rec].fade_count = 0; - this.loops[this.rec].fade_len = len; - } - /** - * Extract the fade length integer from a FADE cmd - * - * @param {string} str Line containing the length of fade in frames - */ - fade_count(str) { - return parseInt(str.split(' ')[1]); - } - /** - * Extract the start color from a string - * - * @param {string} str Line containing the start color value in a fade initiator - * - * @returns {array} Array containing RGB color values - */ - fade_start(str) { - let color = str.split(' ')[2]; - return this.rgb(color.trim()); - } - /** - * Extract the end color from a string - * - * @param {string} str Line containing the end color value in a fade initiator - * - * @returns {array} Array containing RGB color values - */ - fade_end(str) { - let color = str.split(' ')[3]; - return this.rgb(color.trim()); - } - /** - * Determine the state of a fade at a particular frame in the sequence, x - * - * @param {array} start Color the fade starts at - * @param {array} end Color the fade finishes at - * @param {integer} len Total length of the fade in frames - * @param {integer} x Position of the fade to get color value of - * - * @returns {array} Array containing RGB color values - */ - fade_rgb(start, end, len, x) { - let cur = []; - let diff; - for (let i = 0; i < 3; i++) { - if (x === len - 1) { - cur[i] = end[i]; - } - else if (start[i] >= end[i]) { - diff = start[i] - end[i]; - cur[i] = start[i] - Math.round((diff / (len - 1)) * x); - } - else { - diff = end[i] - start[i]; - cur[i] = start[i] + Math.round((diff / (len - 1)) * x); - } - } - return this.rgb_str(cur); - } - /** - * Parse string into array of RGB color values. 0-255 octet. - * - * @param {string} str String containing only color values as `#,#,#` - **/ - rgb(str) { - let rgb = str.split(','); - return rgb.map((char) => { - return parseInt(char); - }); - } - /** - * Cast RGB color values as string - * - * @param {array} arr Array to join into string - * - * @returns {string} String of RGB values - **/ - rgb_str(arr) { - return arr.join(','); - } - /** - * Increase the state of a specific object, such as the camera/projector, - * by the value defined in val. - * - * @param {string} cmd String representing command to interpret and update state - */ - update(cmd, val = 1) { - if (cmd === 'END') { - //I don't understand this loop - for (let i = 0; i < val; i++) { - if (this.rec === 0) { - this.cam += this.loops[this.rec].cam; - this.proj += this.loops[this.rec].proj; - } - else if (this.rec >= 1) { - this.loops[this.rec - 1].cam += this.loops[this.rec].cam; - this.loops[this.rec - 1].proj += this.loops[this.rec].proj; - } - } - } - else if (cmd === 'CF') { - if (this.rec === -1) { - this.cam += val; - } - else { - this.loops[this.rec].cam += val; - } - } - else if (cmd === 'CB') { - if (this.rec === -1) { - this.cam -= val; - } - else { - this.loops[this.rec].cam--; - } - } - else if (cmd === 'PF') { - if (this.rec === -1) { - this.proj += val; - } - else { - this.loops[this.rec].proj += val; - } - } - else if (cmd === 'PB') { - if (this.rec === -1) { - this.proj -= val; - } - else { - this.loops[this.rec].proj--; - } - } - else if (cmd === 'BF') { - if (this.rec === -1) { - this.cam += val; - } - else { - this.loops[this.rec].cam += val; - } - } - else if (cmd === 'BB') { - if (this.rec === -1) { - this.cam -= val; - } - else { - this.loops[this.rec].cam -= val; - } - } - else if (cmd === 'L ') { - } - } - /** - * Split string on command, turn into array of commands - * as long as count variable. Default 1. - * - * @param {string} str String to split - * @param {string} cmd String representing command to split at - * - * @returns {array} Array containing commands - */ - str_to_arr(str, cmd) { - const cnt = str.split(cmd); - let c = parseInt(cnt[1]); - let arr = []; - if (cnt[1] === '') { - c = 1; - } - else { - c = parseInt(cnt[1]); - } - arr = new Array(c).fill(cmd); - this.update(cmd, c); - return arr; - } - /** - * Split a string on a command to extract data for light array - * - * @param {string} str String containing light command - * @param {string} cmd String representing command - * - * @returns {array} An RGB array containing the color values - */ - light_to_arr(str, cmd) { - const cnt = str.split(cmd); - let c = parseInt(cnt[1]); - let arr = []; - if (cnt[1] === '') { - c = 1; - } - else { - c = parseInt(cnt[1]); - } - for (let i = 0; i < c; i++) { - if (cmd === 'CF' - || cmd === 'CB') { - arr.push(this.color); - } - else if (cmd === 'BF' - || cmd === 'BB') { - arr.push(BLACK); - } - else { - arr.push(''); - } - } - return arr; - } - /** - * Split a string to extract an rgb color value - * - * @param {string} Color string assign to color property - */ - light_state(str) { - //add parsers for other color spaces - const color = str.replace('L ', '').trim(); - this.color = color; - } - /** - * Interpret a pause command - * - * @param {string} line String containing pause command - **/ - pause(line) { - let lenStr = line.split(' ')[1] || ''; - let len; - lenStr = lenStr.trim(); - try { - len = parseInt(lenStr, 10); //clean up string or fail - } - catch (err) { - len = 0; - } - if (isNaN(len)) { - len = 0; - } - lenStr = String(len); - if (this.rec !== -1) { - //hold generated arr in state loop array - this.loops[this.rec].arr - .push('PA'); - this.loops[this.rec].meta - .push(lenStr); - } - else { - this.arr.push('AL'); - this.meta.push(lenStr); - } - } - /** - * Interpret an alert command - * - * @param {string} line String containing pause command - **/ - alert(line) { - let msg = line.split(' ')[1] || ''; - msg = msg.trim(); - if (this.rec !== -1) { - //hold generated arr in state loop array - this.loops[this.rec].arr - .push('AL'); - this.loops[this.rec].meta - .push(msg); - } - else { - this.arr.push('AL'); - this.meta.push(msg); - } - } - /** - * Throw an error with specific message - * - * @param {string} msg Error message to print - */ - fail(msg) { - throw new Error(msg); - } -} -module.exports = Mscript; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/mscript/index.js.map b/cli/lib/mscript/index.js.map deleted file mode 100644 index ea5ec61..0000000 --- a/cli/lib/mscript/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mscript/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AASb,MAAM,KAAK,GAAG,OAAO,CAAC;AACtB,MAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,MAAM,GAAG,GAAG;IACX,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACJ,CAAC;AACF,MAAM,IAAI,GAAG;IACZ,IAAI,EAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC;IACxC,IAAI,EAAG,CAAC,mBAAmB,EAAE,cAAc,CAAC;IAC5C,IAAI,EAAG,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC;IAC3D,IAAI,EAAG,CAAC,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,CAAC;IACrE,IAAI,EAAG,CAAC,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,CAAC;IAC3E,IAAI,EAAG,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,CAAC;IACrD,IAAI,EAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;IACjC,IAAI,EAAG,CAAC,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,KAAK,GAAG,OAAO,CAAC;AACtB,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,uBAAuB;AAEvB;;;;;;IAMI;AACJ,SAAS,UAAU,CAAE,GAAY,EA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,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC3C,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE;YACrB,wCAAwC;YACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG;iBACtB,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI;iBACvB,IAAI,CAAC,GAAG,CAAC,CAAC;SACZ;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpB;IACD,CAAC;IAEF;;;;OAIG;IACH,IAAI,CAAE,GAAY;QACjB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/cli/lib/mscript/index.old.js b/cli/lib/mscript/index.old.js deleted file mode 100644 index 65e8d17..0000000 --- a/cli/lib/mscript/index.old.js +++ /dev/null @@ -1,476 +0,0 @@ -'use strict'; - -/** @module lib/mscript */ - -let fs; -let input; - -/** object mscript */ -const mscript = {}; - -/** - * Check for the presence of specific arguments in process - * argv - * - * @param {string} shrt Short version of argument or flag - * @param {string} lng Long version of argument or flag - * - * @return {boolean} Is flag present - */ -mscript.arg = function arg (shrt, lng) { - if (process.argv.indexOf(shrt) !== -1 || - process.argv.indexOf(lng) !== -1) { - return true; - } - return false; -}; - -/** - * Check for the position of specific arguments in process - * argv - * - * @param {string} shrt Short version of argument or flag - * @param {string} lng Long version of argument or flag - * - * @return {boolean} Position of arg or flag, for locating input - */ -mscript.arg_pos = function arg_pos (shrt, lng) { - var pos = -1; - pos = process.argv.indexOf(shrt); - if (pos === -1) { - pos = process.argv.indexOf(lng); - } - return pos; -}; - -mscript.black = '0,0,0'; -mscript.cmd = [ - 'CF', - 'PF', - 'BF', - 'CB', - 'PB', - 'BB' -]; -mscript.alts = { - 'CF' : ['CAMERA FORWARD', 'CAM FORWARD'], - 'PF' : ['PROJECTOR FORWARD', 'PROJ FORWARD'], - 'BF' : ['BLACK FORWARD', 'BLACK', 'BLANK FORWARD', 'BLANK'], - 'CB' : ['CAMERA BACKWARD', 'CAM BACKWARD', 'CAMERA BACK', 'CAM BACK'], - 'PB' : ['PROJECTOR FORWARD', 'PROJ FORWARD', 'PROJECTOR BACK', 'PROJ BACK'], - 'BB' : ['BLACK BACKWARD', 'BLACK BACK', 'BLANK BACK'], - 'L ' : ['LIGHT', 'COLOR', 'LAMP'], - 'F ' : ['FADE'] -}; - -mscript.state = {}; - -/** - * Clear the state object - */ -mscript.state_clear = function state_clear () { - mscript.state = { - cam : 0, - proj : 0, - color : '', - loops : [], - rec : -1 - }; -}; -/** - * This is never used and doesn't do anything? - */ -mscript.alts_unique = function alts_unique () { - var ids = Object.keys(mscript.alts), - all = []; - for (var i = 0; i < ids.length; i++) { - if (all.indexOf(ids[i]) === -1) { - all.push(ids[i]); - } else { - mscript.fail("Can't compile"); - } - } -}; -/** - * - */ -mscript.interpret = function interpret (text, callback) { - mscript.state_clear(); - if (typeof text === 'undefined') { - mscript.fail('No input'); - } - var lines = text.split('\n'), - two = '', - arr = [], - light = [], - target = 0, - dist = 0, //? - output = {}; - for (var i = 0; i < lines.length; i++) { - lines[i] = lines[i].replace(/\t+/g, ""); //strip tabs - lines[i] = lines[i].trim(); //remove excess whitespace before and after command - two = lines[i].substring(0, 2); - if (mscript.cmd.indexOf(two) !== -1) { - - if (mscript.state.loops.length > 0) { - //hold generated arr in state loop array - mscript.state.loops[mscript.state.rec].arr - .push.apply(mscript.state.loops[mscript.state.rec].arr, - mscript.str_to_arr(lines[i], - two)); - mscript.state.loops[mscript.state.rec].light - .push.apply(mscript.state.loops[mscript.state.rec].light, - mscript.light_to_arr(lines[i], - two)); - } else { - arr.push.apply(arr, mscript.str_to_arr(lines[i], two)); - light.push.apply(light, mscript.light_to_arr(lines[i], two)) - } - - } else if (lines[i].substring(0, 4) === 'LOOP') { - mscript.state.rec++; - mscript.state.loops[mscript.state.rec] = { - arr : [], - light : [], - cam : 0, - proj : 0, - cmd : lines[i] + '' - }; - } else if (lines[i].substring(0, 2) === 'L ') { - mscript.light_state(lines[i]); - } else if (lines[i].substring(0, 3) === 'END') { - for (var x = 0; x < mscript.loop_count(mscript.state.loops[mscript.state.rec].cmd); x++) { - if (mscript.state.rec === 0) { - arr.push.apply(arr, mscript.state.loops[mscript.state.rec].arr); - light.push.apply(light, mscript.state.loops[mscript.state.rec].light); - } else if (mscript.state.rec >= 1) { - mscript.state.loops[mscript.state.rec - 1].arr - .push.apply(mscript.state.loops[mscript.state.rec - 1].arr, - mscript.state.loops[mscript.state.rec].arr); - mscript.state.loops[mscript.state.rec - 1].light - .push.apply(mscript.state.loops[mscript.state.rec - 1].light, - mscript.state.loops[mscript.state.rec].light); - } - } - mscript.state_update('END', mscript.loop_count(mscript.state.loops[mscript.state.rec].cmd)); - delete mscript.state.loops[mscript.state.rec]; - mscript.state.rec--; - } else if (lines[i].substring(0, 3) === 'CAM') { //directly go to that frame (black?) - target = parseInt(lines[i].split('CAM ')[1]); - if (mscript.state.loops.length > 0) { - if (target > mscript.state.cam) { - dist = target - mscript.state.cam; - for (var x = 0; x < dist; x++) { - mscript.state.loops[mscript.state.rec].arr.push('BF'); - mscript.state.loops[mscript.state.rec].light.push(mscript.black); - mscript.state_update('BF'); - } - } else { - dist = mscript.state.cam - target; - for (var x = 0; x < dist; x++) { - mscript.state.loops[mscript.state.rec].arr.push('BB'); - mscript.state.loops[mscript.state.rec].light.push(mscript.black); - mscript.state_update('BB'); - } - } - } else { - if (target > mscript.state.cam) { - dist = target - mscript.state.cam; - for (var x = 0; x < dist; x++) { - arr.push('BF'); - light.push(mscript.black); - mscript.state_update('BF'); - } - } else { - dist = mscript.state.cam - target; - for (var x = 0; x < dist; x++) { - arr.push('BB'); - light.push(mscript.black); - mscript.state_update('BB'); - } - } - } - } else if (lines[i].substring(0, 4) === 'PROJ') { //directly go to that frame - target = parseInt(lines[i].split('PROJ ')[1]); - if (mscript.state.loops.length > 0) { - if (target > mscript.state.proj) { - dist = target - mscript.state.proj; - for (var x = 0; x < dist; x++) { - mscript.state.loops[mscript.state.rec].arr.push('PF'); - mscript.state.loops[mscript.state.rec].light.push(''); - mscript.state_update('PF'); - } - } else { - dist = mscript.state.proj - target; - for (var x = 0; x < dist; x++) { - mscript.state.loops[mscript.state.rec].arr.push('PB'); - mscript.state.loops[mscript.state.rec].light.push(''); - mscript.state_update('PB'); - } - } - } else { - if (target > mscript.state.proj) { - dist = target - mscript.state.proj; - for (var x = 0; x < dist; x++) { - arr.push('PF'); - light.push(''); - mscript.state_update('PF'); - } - } else { - dist = mscript.state.proj - target; - for (var x = 0; x < dist; x++) { - arr.push('PB'); - light.push(''); - mscript.state_update('PB'); - } - } - } - } else if (lines[i].substring(0, 3) === 'SET') { //set that state - if (lines[i].substring(0, 7) === 'SET CAM') { - mscript.state.cam = parseInt(lines[i].split('SET CAM')[1]); - } else if (lines[i].substring(0, 8) === 'SET PROJ') { - mscript.state.proj = parseInt(lines[i].split('SET PROJ')[1]); - } - } else if (lines[i].substring(0, 1) === '#' || lines[i].substring(0, 2) === '//') { - //comments - //ignore while parsing - } - } - output.success = true; - output.arr = arr; - output.light = light; - output.cam = mscript.state.cam; - output.proj = mscript.state.proj; - if (typeof callback !== 'undefined') { - //should only be invoked by running mscript.tests() - callback(output); - } else { - return mscript.output(output); - } -}; -/** - * - */ -mscript.last_loop = function last_loop () { - return mscript.state.loops[mscript.state.loops.length - 1]; -}; -/** - * - */ -mscript.parent_loop = function parent_loop () { - return mscript.state.loops[mscript.state.loops.length - 2]; -}; -/** - * - */ -mscript.state_update = function state_update (cmd, val) { - if (cmd === 'END') { - for (var i = 0; i < val; i++) { - if (mscript.state.rec === 0) { - mscript.state.cam += mscript.state.loops[mscript.state.rec].cam; - mscript.state.proj += mscript.state.loops[mscript.state.rec].proj; - } else if (mscript.state.rec >= 1) { - mscript.state.loops[mscript.state.rec - 1].cam += mscript.state.loops[mscript.state.rec].cam; - mscript.state.loops[mscript.state.rec - 1].proj += mscript.state.loops[mscript.state.rec].proj; - } - } - } else if (cmd === 'CF') { - if (mscript.state.loops.length < 1) { - mscript.state.cam++; - } else { - mscript.state.loops[mscript.state.rec].cam++; - } - } else if (cmd === 'CB') { - if (mscript.state.loops.length < 1) { - mscript.state.cam--; - } else { - mscript.state.loops[mscript.state.rec].cam--; - } - } else if (cmd === 'PF') { - if (mscript.state.loops.length < 1) { - mscript.state.proj++; - } else { - mscript.state.loops[mscript.state.rec].proj++; - } - } else if (cmd === 'PB') { - if (mscript.state.loops.length < 1) { - mscript.state.proj--; - } else { - mscript.state.loops[mscript.state.rec].proj--; - } - } else if (cmd === 'BF') { - if (mscript.state.loops.length < 1) { - mscript.state.cam++; - } else { - mscript.state.loops[mscript.state.rec].cam++; - } - } else if (cmd === 'BB') { - if (mscript.state.loops.length < 1) { - mscript.state.cam--; - } else { - mscript.state.loops[mscript.state.rec].cam++; - } - } else if (cmd === 'L ') { - - } -}; -/** - * - */ -mscript.str_to_arr = function str_to_arr (str, cmd) { - var cnt = str.split(cmd), - c = parseInt(cnt[1]), - arr = []; - if (cnt[1] === '') { - c = 1; - } else { - c = parseInt(cnt[1]); - } - for (var i = 0; i < c; i++) { - arr.push(cmd); - mscript.state_update(cmd); - } - return arr; -}; -/** - * - */ -mscript.light_state = function light_state (str) { - //add parsers for other color spaces - var color = str.replace('L ', '').trim(); - mscript.state.color = color; -}; -/** - * - */ -mscript.light_to_arr = function light_to_arr (str, cmd) { - var cnt = str.split(cmd), - c = parseInt(cnt[1]), - arr = []; - if (cnt[1] === '') { - c = 1; - } else { - c = parseInt(cnt[1]); - } - for (var i = 0; i < c; i++) { - if (cmd === 'CF' - || cmd === 'CB') { - arr.push(mscript.state.color); - } else if (cmd === 'BF' - || cmd === 'BB') { - arr.push(mscript.black); - } else { - arr.push(''); - } - } - return arr; -}; -/** - * - */ -mscript.loop_count = function loop_count (str) { - return parseInt(str.split(' ')[1]); -}; -mscript.fade_count = function fade_count (str) { - return parseInt(str.split(' ')[1]); -} -/** - * - */ -mscript.fail = function fail (reason) { - console.error(JSON.stringify({success: false, error: true, msg : reason})); - if (process) process.exit(); -}; -/** - * - */ -mscript.output = function output (data) { - var json = true; //default - if (mscript.arg('-j', '--json')) { - json = true; - } - - if (mscript.arg('-t', '--text')) { - json = false; - } - - if (json) { - console.log(JSON.stringify(data)); - } else { - var ids = Object.keys(data); - for (var i = 0; i < ids.length; i++) { - console.log(ids[i] + ': ' + data[ids[i]]); - } - } -}; -/** - * - */ -mscript.init = function init () { - if (mscript.arg('-t', '--tests')) { - return mscript.tests(); - } - - if (mscript.arg('-v', '--verbose')) { - console.time('mscript'); - } - - if (mscript.arg('-c', '--cam')) { - mscript.state.cam = parseInt(process.argv[mscript.arg_pos('-c', '--cam') + 1]); - } - - if (mscript.arg('-p', '--proj')) { - mscript.state.proj = parseInt(process.argv[mscript.arg_pos('-p', '--proj') + 1]); - } - - if (mscript.arg('-f', '--file')) { - input = process.argv[mscript.arg_pos('-f', '--file') + 1]; - mscript.interpret(fs.readFileSync(input, 'utf8')); - } else { - mscript.interpret(input); - } - - if (mscript.arg('-v', '--verbose')) { - console.timeEnd('mscript'); - } -}; - -if (typeof document === 'undefined' - && typeof module !== 'undefined' - && !module.parent) { - //node script - fs = require('fs'); - input = process.argv[2]; - mscript.init(); -} else if (typeof module !== 'undefined' && module.parent) { - //module - fs = require('fs'); - module.exports = mscript; -} else { - //web -} - - -/* - -CAM # - go to camera frame # -PROJ # - go to projector frame # - -SET CAM # - sets camera count to # -SET PROJ # - sets projector count to # - -LOOP # - begin loop, can nest recursively, # times -END LOOP - (or END) closes loop - -L #RGB - sets light to rgb value - -FADE - -CF - Camera forwards -PF - Projector forwards -BF - Black forwards -CB - Camera backwards -PB - Projector backwards -BB - Black backwards - -*/ \ No newline at end of file diff --git a/cli/lib/mscript/package.json b/cli/lib/mscript/package.json deleted file mode 100644 index 5453ae8..0000000 --- a/cli/lib/mscript/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "mscript", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/proj/Readme.md b/cli/lib/proj/Readme.md deleted file mode 100644 index a3d61e0..0000000 --- a/cli/lib/proj/Readme.md +++ /dev/null @@ -1,37 +0,0 @@ - - -## Projector -**Kind**: global class - -* [Projector](#Projector) - * [.init()](#Projector+init) - * [.listen()](#Projector+listen) - * [.set()](#Projector+set) - * [.move()](#Projector+move) - * [.listener()](#Projector+listener) - * [.end()](#Projector+end) - - - -### projector.init() -**Kind**: instance method of [Projector](#Projector) - - -### projector.listen() -**Kind**: instance method of [Projector](#Projector) - - -### projector.set() -**Kind**: instance method of [Projector](#Projector) - - -### projector.move() -**Kind**: instance method of [Projector](#Projector) - - -### projector.listener() -**Kind**: instance method of [Projector](#Projector) - - -### projector.end() -**Kind**: instance method of [Projector](#Projector) diff --git a/cli/lib/proj/index.js b/cli/lib/proj/index.js deleted file mode 100644 index 9eaf156..0000000 --- a/cli/lib/proj/index.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -/** class representing the Projector features **/ -Object.defineProperty(exports, "__esModule", { value: true }); -const Log = require("log"); -class Projector { - /** - * - **/ - constructor(arduino, cfg, ui, filmout, second = false) { - this.state = { - pos: 0, - dir: true - }; - this.arduino = null; - this.id = 'projector'; - this.arduino = arduino; - this.cfg = cfg; - this.ui = ui; - this.filmout = filmout; - if (second) - this.id += '_second'; - this.init(); - } - /** - * - **/ - async init() { - this.log = await Log({ label: this.id }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * - **/ - listen() { - this.ipc.on(this.id, this.listener.bind(this)); - } - /** - * - **/ - async set(dir, id) { - let cmd; - let ms; - if (dir) { - cmd = this.cfg.arduino.cmd[`${this.id}_forward`]; - } - else { - cmd = this.cfg.arduino.cmd[`${this.id}_backward`]; - } - this.state.dir = dir; - if (this.filmout.state.enabled) { - this.filmout.set(dir); - } - else { - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(`Error setting ${this.id} direction`, err); - } - } - return await this.end(cmd, id, ms); - } - /** - * - **/ - async move(frame, id) { - const cmd = this.cfg.arduino.cmd[this.id]; - let ms; - if (this.filmout.state.enabled) { - try { - ms = await this.filmout.move(); - } - catch (err) { - this.log.error(err); - } - } - else { - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(`Error moving ${this.id}`, err); - } - } - //this.log.info('Projector move time', { ms }); - return await this.end(cmd, id, ms); - } - async both(frame, id) { - const cmd = this.cfg.arduino.cmd[this.id + 's']; - let ms; - try { - ms = await this.arduino.send(this.id, cmd); - } - catch (err) { - this.log.error(`Error moving ${this.id}`, err); - } - //this.log.info('Projectors move time', { ms }); - return await this.end(cmd, id, ms); - } - /** - * - **/ - async listener(event, arg) { - if (typeof arg.dir !== 'undefined') { - try { - await this.set(arg.dir, arg.id); - } - catch (err) { - this.log.error(err); - } - } - else if (typeof arg.frame !== 'undefined') { - try { - await this.move(arg.frame, arg.id); - } - catch (err) { - this.log.error(err); - } - } - else if (typeof arg.val !== 'undefined') { - this.state.pos = arg.val; - this.filmout.state.frame = arg.val; - } - event.returnValue = true; - } - /** - * - **/ - async end(cmd, id, ms) { - let message = ''; - if (cmd === this.cfg.arduino.cmd.projector_forward) { - message = 'Projector set to FORWARD'; - } - 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) { - message += 'ADVANCED'; - } - else { - message += 'REWOUND'; - } - 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'; - } - else if (cmd === this.cfg.arduino.cmd.projectors) { - message += 'Projectors both MOVED 1 frame each'; - } - message += ` ${ms}ms`; - this.log.info(message, 'PROJECTOR'); - return await this.ui.send(this.id, { cmd: cmd, id: id, ms: ms }); - } -} -module.exports = function (arduino, cfg, ui, filmout, second) { - return new Projector(arduino, cfg, ui, filmout, second); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/proj/index.js.map b/cli/lib/proj/index.js.map deleted file mode 100644 index d6afd21..0000000 --- a/cli/lib/proj/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proj/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;;AAEjD,2BAA4B;AAE5B,MAAM,SAAS;IAad;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ,EAAE,OAAa,EAAE,SAAmB,KAAK;QAfpF,UAAK,GAAS;YACrB,GAAG,EAAG,CAAC;YACP,GAAG,EAAG,IAAI;SACV,CAAC;QACM,YAAO,GAAa,IAAI,CAAC;QAMzB,OAAE,GAAY,WAAW,CAAC;QAMjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,MAAM;YAAE,IAAI,CAAC,EAAE,IAAI,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;QAEI;IACI,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AE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,CAAC,CAAA;IAChE,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,OAAiB,EAAE,GAAS,EAAE,EAAQ,EAAE,OAAa,EAAE,MAAgB;IACjG,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/proj/package.json b/cli/lib/proj/package.json deleted file mode 100644 index 9c9782f..0000000 --- a/cli/lib/proj/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "proj", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/sequencer/Readme.md b/cli/lib/sequencer/Readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/cli/lib/sequencer/index.js b/cli/lib/sequencer/index.js deleted file mode 100644 index a742f34..0000000 --- a/cli/lib/sequencer/index.js +++ /dev/null @@ -1,240 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const Log = require("log"); -const electron_1 = require("electron"); -/** @module lib/sequencer **/ -let seq; -class Sequencer { - /** - * @constructor - * Create a new sequencer and assign command and UI as private sub-classes - * - * @param {object} cfg Configuration object - * @param {object} cmd Shared command class - * @param {object} ui Electron UI, browser window - **/ - constructor(cfg, cmd, ui) { - this.running = false; - this.paused = false; - this.grid = []; - this.gridLoops = 1; - this.arr = []; //store sequence from gui - this.loops = 1; - this.CMDS = {}; - this.id = 'sequence'; - this.alerted = false; - this.cfg = cfg; - this.cmd = cmd; - this.ui = ui; - this.cmds(cfg.cmd); - this.init(); - } - /** - * Take configuration object and assign all commands as keys - * in the internal CMDS object. - * - * @param {object} obj Configuration object - **/ - cmds(obj) { - let keys = Object.keys(obj); - for (let key of keys) { - this.CMDS[obj[key]] = key; - } - // - // - } - /** - * Initialize the class by requiring ipcMain from electron - * and creating logger. - * - **/ - async init() { - this.log = await Log({ label: this.id }); - this.ipc = require('electron').ipcMain; - this.listen(); - } - /** - * Bind ipc listener to channel 'sequencer' or current id of - * class. - **/ - listen() { - this.ipc.on(this.id, this.listener.bind(this)); - } - /** - * Listener callback function. Called whenever ipc - * message is sent to channel 'sequencer'. - * - * @param {object} event IPC message event - * @param {object} arg Arguments provided in message - **/ - async listener(event, arg) { - if (arg && arg.start) { - this.start(arg); - } - else if (arg && arg.stop) { - this.stop(); - } - else if (arg && arg.pause) { - this.pause(); - } - else if (arg && arg.set) { - this.setSteps(arg.set); - } - else if (arg && arg.unset) { - this.unsetSteps(arg.unset); - } - else if (arg && arg.loops) { - this.setLoops(arg.loops); - } - event.returnValue = true; - } - /** - * Sets the value of the loops in the grid sequence - * to value sent by UI in ipc message. - * - * @param {integer} count Number of loops to set grid sequence to - **/ - setLoops(count) { - this.gridLoops = count; - this.log.info(`Set loop count to ${count}`); - } - /** - * Sets multiple steps at once - * - * @param {array} steps Array of steps to set or update - **/ - setSteps(steps) { - for (let step of steps) { - this.grid[step.x] = step; - } - } - /** - * Resets multiple steps to default 'undefined' state - * - * @param {array} steps Array containing the x location of steps to unset - **/ - unsetSteps(steps) { - for (let x of steps) { - this.grid[x] = undefined; - } - } - /** - * Starts a sequence with the existing grid sequence, - * or if one is provided in the arg object, starts - * that sequence. - * - * @param {object} arg Arguments from ipc message - **/ - async start(arg) { - const psbId = electron_1.powerSaveBlocker.start('prevent-display-sleep'); - let startTime = +new Date(); - let ms; - if (arg && arg.arr) { - this.arr = arg.arr; //overwrite sequence - } - else { - this.arr = this.grid; - } - if (arg && arg.loops) { - this.loops = arg.loops; //overwrite loops - } - else { - this.loops = this.gridLoops; - } - this.running = true; - this.paused = false; - //start sequence - this.log.info(`Starting sequence...`); - this.ui.send(this.id, { start: true }); - if (this.cmd.proj.filmout.state.enabled === true) { - await this.cmd.proj.filmout.display.open(); - } - for (let x = 0; x < this.loops; x++) { - //start loop - this.log.info(`Starting loop ${x + 1}`); - this.ui.send(this.id, { loop: x, start: true }); - for (let y = 0; y < this.arr.length; y++) { - //start step - if (!this.running) { - break; - } - //UI initiates pause, not planned - while (this.paused) { - await delay(42); - } - if (typeof this.arr[y] === 'undefined') { - continue; - } - this.log.info(`Starting step ${y + 1} of loop ${x + 1}`); - this.ui.send(this.id, { step: y, loop: x, start: true }); - await this.step(y); - //end step - this.log.info(`Ended step ${y + 1} of loop ${x + 1}`); - this.ui.send(this.id, { step: y, loop: x, stop: true }); - } - if (!this.running) { - break; - } - //end loop - this.log.info(`Ended loop ${x + 1}`); - this.ui.send(this.id, { loop: x, stop: true }); - } - if (this.cmd.proj.filmout.state.enabled === true) { - await this.cmd.proj.filmout.display.close(); - } - electron_1.powerSaveBlocker.stop(psbId); - this.psbId = null; - ms = (+new Date()) - startTime; - //end sequence - this.log.info(`Ended sequence`); - this.ui.send(this.id, { stop: true, ms }); - } - /** - * Pauses sequence from UI. - **/ - pause() { - this.paused = true; - } - /** - * Stops the sequence - **/ - stop() { - if (this.cmd.proj.filmout.state.enabled === true) { - this.cmd.proj.filmout.display.close(); - } - this.running = false; - if (this.psbId) { - electron_1.powerSaveBlocker.stop(this.psbId); - } - //clear? - } - /** - * Execute command @ step x. Wrapper with try catch. - * - * @param {integer} x Step to execute command at - **/ - async step(x) { - try { - await this.cmdExec(x); - } - catch (err) { - throw err; - } - } - /** - * Locate step @ position x and execute the command. - * - * @param {integer} x Step to execute command at - **/ - async cmdExec(x) { - const cmdOriginal = this.arr[x].cmd; - const cmd = this.CMDS[cmdOriginal]; - this.log.info(`CMD: '${cmdOriginal}' -> ${cmd}`); - //I wrote this when I was very tired and delirious - return await this.cmd[cmd](); - } -} -module.exports = function (cfg, cmd, ui) { - return new Sequencer(cfg, cmd, ui); -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/sequencer/index.js.map b/cli/lib/sequencer/index.js.map deleted file mode 100644 index 08bcbc7..0000000 --- a/cli/lib/sequencer/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequencer/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,2BAA4B;AAC5B,uCAA2C;AAG3C,6BAA6B;AAE7B,IAAI,GAAe,CAAC;AAEpB,MAAM,SAAS;IAoBd;;;;;;;QAOI;IAEJ,YAAa,GAAS,EAAE,GAAS,EAAE,EAAQ;QA5BnC,YAAO,GAAa,KAAK,CAAC;QAC1B,WAAM,GAAa,KAAK,CAAC;QAEzB,SAAI,GAAW,EAAE,CAAC;QAClB,cAAS,GAAY,CAAC,CAAC;QAEvB,QAAG,GAAW,EAAE,CAAC,CAAC,yBAAyB;QAC3C,UAAK,GAAY,CAAC,CAAC;QAInB,SAAI,GAAS,EAAE,CAAC;QAIhB,OAAE,GAAY,UAAU,CAAC;QACzB,YAAO,GAAa,KAAK,CAAC;QAajC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;;;;QAKI;IACI,IAAI,CAAE,GAAS;QACtB,IAAI,IAAI,GAAc,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SAC1B;QACD,EAAE;QACF,EAAE;IACH,CAAC;IAED;;;;QAII;IACI,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,GAAG,GAAG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AI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE;YACjD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACtC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,KAAK,EAAE;YACf,2BAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAClC;QACD,QAAQ;IAET,CAAC;IAED;;;;QAII;IACI,KAAK,CAAC,IAAI,CAAG,CAAS;QAC7B,IAAI;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;SACrB;QAAC,OAAO,GAAG,EAAE;YACb,MAAM,GAAG,CAAC;SACV;IACF,CAAC;IAED;;;;QAII;IACI,KAAK,CAAC,OAAO,CAAE,CAAU;QAChC,MAAM,WAAW,GAAY,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC7C,MAAM,GAAG,GAAY,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,WAAW,QAAQ,GAAG,EAAE,CAAC,CAAC;QACjD,kDAAkD;QAClD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;IAC9B,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS,EAAE,GAAS,EAAE,EAAQ;IACxD,OAAO,IAAI,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAA"} \ No newline at end of file diff --git a/cli/lib/sequencer/package.json b/cli/lib/sequencer/package.json deleted file mode 100644 index 6fb32b0..0000000 --- a/cli/lib/sequencer/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "sequencer", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/settings/Readme.md b/cli/lib/settings/Readme.md deleted file mode 100644 index 7ed0553..0000000 --- a/cli/lib/settings/Readme.md +++ /dev/null @@ -1,42 +0,0 @@ - - -## 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/cli/lib/settings/index.js b/cli/lib/settings/index.js deleted file mode 100644 index 869e3b4..0000000 --- a/cli/lib/settings/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const os = require("os"); -const path = require("path"); -const fs = require("fs-extra"); -class Settings { - /** - * - **/ - constructor() { - this.file = path.join(os.homedir(), `/.mcopy/settings.json`); - this.defaultState = { - server: { - port: 1111, - enabled: true - }, - devices: [], - profile: 'mcopy', - camera: {}, - projector: {}, - light: {} - }; - this.state = this.freshState(); - } - freshState() { - return JSON.parse(JSON.stringify(this.defaultState)); - } - /** - * - **/ - async checkDir() { - const dir = path.join(os.homedir(), '.mcopy/'); - const exists = await fs.exists(dir); - if (!exists) { - try { - await fs.mkdir(dir); - } - catch (err) { - if (err.code === 'EEXIST') - return true; - console.error(err); - } - } - return true; - } - /** - * - **/ - async save() { - const str = JSON.stringify(this.state, null, '\t'); - this.checkDir(); - try { - await fs.writeFile(this.file, str, 'utf8'); - } - catch (err) { - console.error(err); - } - } - /** - * - **/ - update(key, val) { - this.state[key] = val; - } - /** - * - **/ - get(key) { - return this.state[key]; - } - /** - * - **/ - all() { - return this.state; - } - /** - * - **/ - async restore() { - let exists; - let str; - this.checkDir(); - exists = await fs.exists(this.file); - if (exists) { - str = await fs.readFile(this.file, 'utf8'); - this.state = JSON.parse(str); - //console.dir(this.state) - } - else { - this.save(); - } - } - /** - * - **/ - async reset() { - const exists = await fs.exists(this.file); - if (exists) { - try { - await fs.unlink(this.file); - } - catch (err) { - console.error(err); - } - } - this.state = this.freshState(); - this.restore(); - } - ; -} -module.exports = new Settings(); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/settings/index.js.map b/cli/lib/settings/index.js.map deleted file mode 100644 index 09bd78c..0000000 --- a/cli/lib/settings/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,yBAA0B;AAC1B,6BAA8B;AAC9B,+BAAgC;AAEhC,MAAM,QAAQ;IAcb;;QAEI;IACJ;QAhBQ,SAAI,GAAW,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,uBAAuB,CAAC,CAAC;QAChE,iBAAY,GAAS;YAC5B,MAAM,EAAG;gBACR,IAAI,EAAG,IAAI;gBACX,OAAO,EAAG,IAAI;aACd;YACD,OAAO,EAAG,EAAE;YACZ,OAAO,EAAG,OAAO;YACjB,MAAM,EAAG,EAAE;YACX,SAAS,EAAG,EAAE;YACd,KAAK,EAAG,EAAE;SACV,CAAA;QAMA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAEO,UAAU;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACtD,CAAC;IAC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AC;QAER,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,MAAM,EAAE;YACX,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7B,yBAAyB;SACzB;aAAM;YACN,IAAI,CAAC,IAAI,EAAE,CAAC;SACZ;IACF,CAAC;IACD;;QAEI;IACG,KAAK,CAAC,KAAK;QACjB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,MAAM,EAAE;YACX,IAAI;gBACH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;SACD;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAAA,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,QAAQ,EAAE,CAAA"} \ No newline at end of file diff --git a/cli/lib/settings/package.json b/cli/lib/settings/package.json deleted file mode 100644 index 87cc2fb..0000000 --- a/cli/lib/settings/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "settings", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/spawn/Readme.md b/cli/lib/spawn/Readme.md deleted file mode 100644 index 83592bb..0000000 --- a/cli/lib/spawn/Readme.md +++ /dev/null @@ -1,7 +0,0 @@ - - -## spawn() -Wrapper function around spawn that prints to console -after process closes. Not used. - -**Kind**: global function diff --git a/cli/lib/spawn/index.js b/cli/lib/spawn/index.js deleted file mode 100644 index 8ea761c..0000000 --- a/cli/lib/spawn/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const spawnRaw = require('child_process').spawn; - -/** - * Wrapper function around spawn that prints to console - * after process closes. Not used. - **/ -function spawn (cmd, args) { - const sp = spawnRaw(cmd, args); - let output = ''; - sp.stderr.on('data', (data) => { - output += data; - //console.log(`${data}`); - }); - sp.on('close', (code) => { - console.log(output); - }); - return sp; -} - -module.exports = spawn; \ No newline at end of file diff --git a/cli/lib/spawn/package.json b/cli/lib/spawn/package.json deleted file mode 100644 index 7fbd317..0000000 --- a/cli/lib/spawn/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "spawn", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/lib/system/Readme.md b/cli/lib/system/Readme.md deleted file mode 100644 index 9a1dbf0..0000000 --- a/cli/lib/system/Readme.md +++ /dev/null @@ -1,37 +0,0 @@ -## Functions - -
-
dependencies(platform)
-

Evaluates system dependencies for digital -projector features by executing processes with ---help flag. If they do not exist, log to console

-
-
system()object
-

Profile the current system and return an object with -data about the displays and dependencies for the digital -projector feature.

-
-
- - - -## dependencies(platform) -Evaluates system dependencies for digital -projector features by executing processes with ---help flag. If they do not exist, log to console - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| platform | string | Operating system type | - - - -## system() ⇒ object -Profile the current system and return an object with -data about the displays and dependencies for the digital -projector feature. - -**Kind**: global function -**Returns**: object - Object containing system information diff --git a/cli/lib/system/index.js b/cli/lib/system/index.js deleted file mode 100644 index a1a0436..0000000 --- a/cli/lib/system/index.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const os_1 = require("os"); -const electron_1 = require("electron"); -//private -const exec_1 = require("exec"); -/** - * Evaluates system dependencies for digital - * projector features by executing `which` on binary. - * If they do not exist, log to console - * - * @param {string} platform Operating system type - * - * @returns {object} Object containing path to dependency from `which`, if they exist - **/ -async function dependencies(platform) { - let obj = {}; - let ffmpeg = require('ffmpeg-static'); - let ffprobe = require('ffprobe-static'); - let ffoutput; - //let imoutput : ExecOutput; - let eogoutput; - obj.ffmpeg = ffmpeg; /*.replace( - 'app.asar', - 'app.asar.unpacked' - );*/ - obj.ffprobe = ffprobe.path; /*.replace( - 'app.asar', - 'app.asar.unpacked' - );*/ - try { - //imoutput = await exec('which convert'); - } - catch (err) { - console.error('imagemagick is not installed', err); - } - /*if (!imoutput || imoutput.stdout.trim() === '') { - console.error('imagemagick is not installed'); - } else { - obj.convert = imoutput.stdout.trim(); - }*/ - //if linux - if (platform === 'nix') { - try { - eogoutput = await exec_1.exec('which eog'); - } - catch (err) { - console.error('eog is not installed', err); - } - if (!eogoutput || eogoutput.stdout.trim() === '') { - console.error('eog is not installed'); - } - else { - obj.eog = eogoutput.stdout.trim(); - } - } - return obj; -} -function displayMap(obj) { - const sm = { - id: obj.id, - width: obj.size.width, - height: obj.size.height, - x: obj.bounds.x, - y: obj.bounds.y, - scale: obj.scaleFactor, - primary: (obj.bounds.x === 0 && obj.bounds.y === 0) - }; - const primary = sm.primary ? ' (Primary)' : ''; - sm.name = `${sm.width}x${sm.height}${primary}`; - return sm; -} -function displaySort(a, b) { - if (a.primary) { - return -1; - } - else if (b.primary) { - return 1; - } - return 0; -} -async function displays() { - let displays = electron_1.screen.getAllDisplays(); - displays = displays.map(displayMap); - displays.sort(displaySort); - return displays; -} -/** - * Profile the current system and return an object with - * data about the displays and dependencies for the digital - * projector feature. - * - * @returns {object} Object containing system information - */ -async function system(ui) { - const obj = {}; - let platform; - try { - obj.tmp = os_1.tmpdir(); - } - catch (err) { - obj.tmp = '/tmp'; - } - platform = os_1.type(); - if (platform === 'Darwin') { - obj.platform = 'osx'; - } - else if (platform === 'Windows_NT') { - obj.platform = 'win'; - } - else { - obj.platform = 'nix'; - } - obj.displays = await displays(); - obj.deps = await dependencies(obj.platform); - setTimeout(() => { - ui.send('system', obj); - }, 3000); - return obj; -} -module.exports = system; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/cli/lib/system/index.js.map b/cli/lib/system/index.js.map deleted file mode 100644 index f16e8c7..0000000 --- a/cli/lib/system/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;;;IAQI;AAGJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IACnB,IAAI,MAAM,GAAS,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAS,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9C,IAAI,QAAqB,CAAC;IAC1B,4BAA4B;IAC5B,IAAI,SAAsB,CAAC;IAE3B,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA,CAAA;;;QAGf;IACJ,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAA,CAAA;;;QAGtB;IAEJ,IAAI;QACH,yCAAyC;KACzC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAC;KACnD;IAED;;;;OAIG;IAEH,UAAU;IACV,IAAI,QAAQ,KAAK,KAAK,EAAE;QACvB,IAAI;YACH,SAAS,GAAG,MAAM,WAAI,CAAC,WAAW,CAAC,CAAC;SACpC;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SAC3C;QACD,IAAI,CAAC,SAAS,IAAI,SAAS,C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,GAAG,CAAC,UAAU,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3B,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,MAAM,CAAE,EAAQ;IAC9B,MAAM,GAAG,GAAS,EAAE,CAAC;IACrB,IAAI,QAAiB,CAAC;IAEtB,IAAI;QACH,GAAG,CAAC,GAAG,GAAG,WAAM,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACb,GAAG,CAAC,GAAG,GAAG,MAAM,CAAA;KAChB;IAED,QAAQ,GAAG,SAAI,EAAE,CAAC;IAElB,IAAI,QAAQ,KAAK,QAAQ,EAAE;QAC1B,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM,IAAI,QAAQ,KAAK,YAAY,EAAE;QACrC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/cli/lib/system/package.json b/cli/lib/system/package.json deleted file mode 100644 index 148877b..0000000 --- a/cli/lib/system/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "system", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/cli/package-lock.json b/cli/package-lock.json deleted file mode 100644 index e2a41bd..0000000 --- a/cli/package-lock.json +++ /dev/null @@ -1,1770 +0,0 @@ -{ - "name": "mcopy-cli", - "version": "1.6.6", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/parser": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", - "integrity": "sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig==", - "dev": true - }, - "@babel/runtime": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz", - "integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, - "@serialport/binding-abstract": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-8.0.4.tgz", - "integrity": "sha512-1/CWzAk0tIlaf+WkTYD9YogUi6RGurNSV78cHlpkwsJeLY7z3i1rtwapspV5lIziGT/UJPj8pNVcXrv3K2uKZQ==", - "requires": { - "debug": "^4.1.1" - } - }, - "@serialport/binding-mock": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-8.0.4.tgz", - "integrity": "sha512-n6XGkZQaEOZk+wvxKSCNwv9wopS3faD1nf97FJJwJXZdtKk7h2XFtScfrol3bBfHanDMLjwx8oLgs29Jtlxmwg==", - "requires": { - "@serialport/binding-abstract": "^8.0.4", - "debug": "^4.1.1" - } - }, - "@serialport/bindings": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-8.0.4.tgz", - "integrity": "sha512-VNEJs6swCw9D4X0M08850RFvj5wUt+YiVQrQ9/ms9sYfuh//S/TsEKKQuVkyYtaTkiyZUgknkzBH/8u74w8aKQ==", - "requires": { - "@serialport/binding-abstract": "^8.0.4", - "@serialport/parser-readline": "^8.0.4", - "bindings": "^1.5.0", - "debug": "^4.1.1", - "nan": "^2.14.0", - "prebuild-install": "^5.3.0" - } - }, - "@serialport/parser-byte-length": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-8.0.4.tgz", - "integrity": "sha512-5tQQbJZ5KL0eaP750oF1w0iT+E3lFkpDRz/BzONS2jJsGc+Warb+6FH2aWqj1+smz0mAZWdcxNQgJZLrhFy+sw==" - }, - "@serialport/parser-cctalk": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-8.0.4.tgz", - "integrity": "sha512-7GsVAlVgk9pAMfuhbEy5m5t1pe8WCdR8HzXjroE8jwXCPHrGT7aY/sjZSTF91fx+qzqhojLiTJyIlf1HwnqM+g==" - }, - "@serialport/parser-delimiter": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-8.0.4.tgz", - "integrity": "sha512-4XkOQD2uj7jj4q4CltAM74Rk3HNwCk8pqrgvfAtouA3Pmt0AdrC/n9OrpRY13ioZwv+Yjc54HWU2z9VOOGn45Q==" - }, - "@serialport/parser-readline": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-8.0.4.tgz", - "integrity": "sha512-STs0WnGKLBwlXbG3CnTiI+kuWxmHBzwcslrWA2su9G5pPYQJpKGCHs2URLDDhYKmGZtzTftCJXEXABpsTXfNxQ==", - "requires": { - "@serialport/parser-delimiter": "^8.0.4" - } - }, - "@serialport/parser-ready": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-8.0.4.tgz", - "integrity": "sha512-HXFmYve6mcFnOyX/efLvo7MpvOtD0uJrYWXFvuk0xw3DYRBvabL1zYvK0rYPrWJu32I0M3AFFsldSELm0Ic3mQ==" - }, - "@serialport/parser-regex": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-8.0.4.tgz", - "integrity": "sha512-uruaOaxBN4E90oqW/Tfb594uP9qPEgL79XXwXUQGbT554EK4k1VVa9TV1JO16qE8EB6Km6XxdEPEVxAx7HKmpg==" - }, - "@serialport/stream": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-8.0.4.tgz", - "integrity": "sha512-Ux6qhFRPGiW/2XYpR6PeZSCidF32eqC5GEpXrjwHGmif0wvuGWjbJVfl1azBvgXcjARWeyGjSwVEcsJbsDX1QQ==", - "requires": { - "@serialport/binding-mock": "^8.0.4", - "debug": "^4.1.1" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "12.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.18.tgz", - "integrity": "sha512-DBkZuIMFuAfjJHiunyRc+aNvmXYNwV1IPMgGKGlwCp6zh6MKrVtmvjSWK/axWcD25KJffkXgkfvFra8ndenXAw==", - "dev": true - }, - "ajv": { - "version": "6.9.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", - "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", - "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - }, - "dependencies": { - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "arduino": { - "version": "file:lib/arduino" - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bl": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.1.tgz", - "integrity": "sha512-jrCW5ZhfQ/Vt07WX1Ngs+yn9BDqPL/gw28S7s9H6QK/gupnizNzJAss5akW20ISgOrbLTlXOOCTJeNUQqruAWQ==", - "requires": { - "readable-stream": "^3.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "byline": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", - "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", - "dev": true - }, - "cam": { - "version": "file:lib/cam" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chownr": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", - "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" - }, - "cmd": { - "version": "file:lib/cmd" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "color": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", - "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", - "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.2" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "color-string": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", - "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "colornames": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", - "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=" - }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" - }, - "colorspace": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.1.tgz", - "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", - "requires": { - "color": "3.0.x", - "text-hex": "1.0.x" - } - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz", - "integrity": "sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "requires": { - "mimic-response": "^2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "delay": { - "version": "file:../app/lib/delay" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, - "device": { - "version": "file:lib/device" - }, - "devices": { - "version": "file:lib/devices" - }, - "diagnostics": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", - "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", - "requires": { - "colorspace": "1.1.x", - "enabled": "1.0.x", - "kuler": "1.0.x" - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "display": { - "version": "file:lib/display" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "enabled": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", - "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", - "requires": { - "env-variable": "0.0.x" - } - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "env-variable": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.5.tgz", - "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==" - }, - "escodegen": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", - "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "exec": { - "version": "file:lib/exec" - }, - "exit": { - "version": "file:lib/exit" - }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-glob": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", - "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2" - } - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fast-safe-stringify": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", - "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==" - }, - "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", - "dev": true, - "requires": { - "reusify": "^1.0.0" - } - }, - "fecha": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", - "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "filmout": { - "version": "file:lib/filmout" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", - "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "humanize-duration": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.21.0.tgz", - "integrity": "sha512-7BLsrQZ2nMGeakmGDUl1pDne6/7iAdvwf1RtDLCOPHNFIHjkOVW7lcu7xHkIM9HhZAlSSO5crhC1dHvtl4dIQw==" - }, - "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, - "into-stream": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", - "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", - "dev": true, - "requires": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - } - }, - "intval": { - "version": "file:lib/intval" - }, - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kuler": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", - "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", - "requires": { - "colornames": "^1.1.1" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "light": { - "version": "file:lib/light" - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" - }, - "log": { - "version": "file:lib/log" - }, - "logform": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", - "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", - "requires": { - "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", - "fecha": "^2.3.3", - "ms": "^2.1.1", - "triple-beam": "^1.3.0" - } - }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "requires": { - "mime-db": "~1.38.0" - } - }, - "mimic-response": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", - "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } - }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "mscript": { - "version": "file:../app/lib/mscript" - }, - "multistream": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/multistream/-/multistream-2.1.1.tgz", - "integrity": "sha512-xasv76hl6nr1dEy3lPvy7Ej7K/Lx3O/FCvwge8PeVJpciPPoNCbaANcNiBug3IpdvTveZUcAV0DJzdnUDMesNQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5" - } - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "napi-build-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", - "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" - }, - "node-abi": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.13.0.tgz", - "integrity": "sha512-9HrZGFVTR5SOu3PZAnAY2hLO36aW1wmA+FDsVkr85BTST32TLCA1H/AEcatVRAsWLyXS3bqUDYCAjq5/QGuSTA==", - "requires": { - "semver": "^5.4.1" - } - }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "one-time": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", - "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=" - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "picomatch": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.1.1.tgz", - "integrity": "sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA==", - "dev": true - }, - "pkg": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/pkg/-/pkg-4.4.2.tgz", - "integrity": "sha512-FEFX43fzHVyEl7fBTTaKxjN3OsWowNfcDGO7+NaxfUsMTMvy8aQX6DscjgoTNnbOehObRK/UqMUGKXt3mvnArg==", - "dev": true, - "requires": { - "@babel/parser": "^7.7.5", - "@babel/runtime": "^7.7.5", - "chalk": "^3.0.0", - "escodegen": "^1.12.0", - "fs-extra": "^8.1.0", - "globby": "^10.0.1", - "into-stream": "^5.1.1", - "minimist": "^1.2.0", - "multistream": "^2.1.1", - "pkg-fetch": "^2.6.4", - "progress": "^2.0.3", - "resolve": "^1.13.1", - "stream-meter": "^1.0.4" - } - }, - "pkg-fetch": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-2.6.4.tgz", - "integrity": "sha512-4j4jiuo6RRIuD9e9xUE6OQYnIkQCArZjkHXNYsSJjxhJeiHE16MA+rENMblvGLbeWsTY3BPfcYVCGFXzpfJetA==", - "dev": true, - "requires": { - "@babel/runtime": "^7.7.5", - "byline": "^5.0.0", - "chalk": "^3.0.0", - "expand-template": "^2.0.3", - "fs-extra": "^8.1.0", - "minimist": "^1.2.0", - "progress": "^2.0.3", - "request": "^2.88.0", - "request-progress": "^3.0.0", - "semver": "^6.3.0", - "unique-temp-dir": "^1.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "prebuild-install": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", - "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", - "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "proj": { - "version": "file:lib/proj" - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", - "dev": true - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "request-progress": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", - "integrity": "sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4=", - "dev": true, - "requires": { - "throttleit": "^1.0.0" - } - }, - "resolve": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", - "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "sequencer": { - "version": "file:lib/sequencer" - }, - "serialport": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-8.0.5.tgz", - "integrity": "sha512-hYWRpn+pRZWxwCZErLkYcja/ELSrB70dl+z9TcKIHKO2SlHDVNJmXAGGw2nfjg3AqmsHZvRRq8fu1SySYzbZUA==", - "requires": { - "@serialport/binding-mock": "^8.0.4", - "@serialport/bindings": "^8.0.4", - "@serialport/parser-byte-length": "^8.0.4", - "@serialport/parser-cctalk": "^8.0.4", - "@serialport/parser-delimiter": "^8.0.4", - "@serialport/parser-readline": "^8.0.4", - "@serialport/parser-ready": "^8.0.4", - "@serialport/parser-regex": "^8.0.4", - "@serialport/stream": "^8.0.4", - "debug": "^4.1.1" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "settings": { - "version": "file:lib/settings" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" - }, - "simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", - "requires": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "requires": { - "is-arrayish": "^0.3.1" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - }, - "spawn": { - "version": "file:lib/spawn" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, - "stream-meter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz", - "integrity": "sha1-Uq+Vql6nYKJJFxZwTb/5D3Ov3R0=", - "dev": true, - "requires": { - "readable-stream": "^2.1.4" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "systeminformation": { - "version": "4.27.11", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-4.27.11.tgz", - "integrity": "sha512-U7bigXbOnsB8k1vNHS0Y13RCsRz5/UohiUmND+3mMUL6vfzrpbe/h4ZqewowB+B+tJNnmGFDj08Z8xGfYo45dQ==" - }, - "tar-fs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", - "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", - "requires": { - "chownr": "^1.1.1", - "mkdirp": "^0.5.1", - "pump": "^3.0.0", - "tar-stream": "^2.0.0" - } - }, - "tar-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", - "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", - "requires": { - "bl": "^3.0.0", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" - }, - "throttleit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "uid2": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", - "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", - "dev": true - }, - "unique-temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", - "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1", - "os-tmpdir": "^1.0.1", - "uid2": "0.0.3" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "winston": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", - "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", - "requires": { - "async": "^2.6.1", - "diagnostics": "^1.1.1", - "is-stream": "^1.1.0", - "logform": "^2.1.1", - "one-time": "0.0.4", - "readable-stream": "^3.1.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.3.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "winston-transport": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", - "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", - "requires": { - "readable-stream": "^2.3.6", - "triple-beam": "^1.2.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/cli/package.json b/cli/package.json deleted file mode 100644 index 1e18c00..0000000 --- a/cli/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "mcopy-cli", - "version": "1.6.6", - "description": "CLI for controlling the mcopy optical printer platform", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sixteenmillimeter/mcopy.git" - }, - "author": "mmcwilliams", - "license": "MIT", - "bugs": { - "url": "https://github.com/sixteenmillimeter/mcopy/issues" - }, - "homepage": "https://github.com/sixteenmillimeter/mcopy#readme", - "dependencies": { - "arduino": "file:lib/arduino", - "cam": "file:lib/cam", - "cmd": "file:lib/cmd", - "commander": "^4.0.1", - "delay": "file:../app/lib/delay", - "device": "file:lib/device", - "devices": "file:lib/devices", - "filmout": "file:lib/filmout", - "display": "file:lib/display", - "exec": "file:lib/exec", - "exit": "file:lib/exit", - "fs-extra": "^8.1.0", - "humanize-duration": "^3.21.0", - "intval": "file:lib/intval", - "light": "file:lib/light", - "log": "file:lib/log", - "moment": "^2.24.0", - "mscript": "file:../app/lib/mscript", - "proj": "file:lib/proj", - "request": "^2.88.0", - "sequencer": "file:lib/sequencer", - "serialport": "^8.0.5", - "settings": "file:lib/settings", - "spawn": "file:lib/spawn", - "systeminformation": "^4.27.11", - "uuid": "^3.3.3", - "winston": "^3.2.1" - }, - "devDependencies": { - "pkg": "^4.4.2" - } -} diff --git a/cli/scripts/build.js b/cli/scripts/build.js deleted file mode 100644 index 64203a5..0000000 --- a/cli/scripts/build.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict' - -const { exec } = require('pkg') -const execRaw = require('child_process').exec -const os = require('os') -const fs = require('fs-extra') -const packageJson = require('./package.json') - -const platform = os.platform() -const arch = os.arch() -const name = packageJson.name; - -/** - * Shells out to execute a command with async/await. - * Async wrapper to exec module. - * - * @param {string} cmd Command to execute - * - * @returns {Promise} Promise containing the complete stdio - **/ -async function shell_out (cmd) { - return new Promise((resolve, reject) => { - return execRaw(cmd, (err, stdio, stderr) => { - if (err) return reject(err) - return resolve(stdio) - }) - }) -} - -//exec(args) takes an array of command line arguments and returns a promise. For example: - -if (!fs.existsSync(`./dist/${platform}_${arch}`)) { - fs.mkdirSync(`./dist/${platform}_${arch}`) -} - -console.log(`Building frameloom and saving in dist/${platform}_${arch}...`) -console.time('frameloom') -exec([ 'frameloom', '--target', 'host', '--output', `./dist/${platform}_${arch}/frameloom` ]).then(async (res) => { - try { - await shell_out(`zip -r ./dist/frameloom_${platform}_${arch}_${packageJson.version}.zip ./dist/${platform}_${arch}/frameloom`) - console.log(`Compressed binary to dist/frameloom_${platform}_${arch}_${packageJson.version}.zip`) - } catch (err) { - console.error(err) - process.exit(err) - } - - console.timeEnd('frameloom') - console.log('built') -}).catch(err => { - console.error(err) -}) \ No newline at end of file diff --git a/scripts/compile.sh b/scripts/compile.sh index 2f52709..c1a2c95 100644 --- a/scripts/compile.sh +++ b/scripts/compile.sh @@ -7,10 +7,8 @@ mkdir -p lib #electron-build fails when local modules are in parent directory #copy them into lib directory cp -r ./lib/* ./app/lib/ -cp -r ./lib/* ./cli/lib/ rm -r ./lib cp ./data/cfg.json ./app/data/ -cp ./data/cfg.json ./cli/data/ cp ./data/cfg.json ./processing/mcopy/ \ No newline at end of file diff --git a/scripts/version.sh b/scripts/version.sh index 222e46f..b47ed48 100644 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -6,7 +6,7 @@ npm version --no-git-tag-version ${1} version=$(jq -r '.version' ./package.json) echo "VERSION: $version" -declare -a fileArr=("./data/cfg.json" "./app/package.json" "./cli/package.json") +declare -a fileArr=("./data/cfg.json" "./app/package.json") for i in "${fileArr[@]}" do