Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3aeb971b4d
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
//import Log = require('log');
|
//import Log = require('log');
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const SerialPort = require('serialport');
|
const SerialPort = require('serialport');
|
||||||
const Readline = SerialPort.parsers.Readline;
|
const Readline = SerialPort.parsers.Readline;
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
|
@ -104,7 +104,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
this.timer = new Date().getTime();
|
this.timer = new Date().getTime();
|
||||||
this.locks[serial] = true;
|
this.locks[serial] = true;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
results = await this.sendAsync(device, cmd);
|
results = await this.sendAsync(device, cmd);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ class Arduino {
|
||||||
async string(serial, str) {
|
async string(serial, str) {
|
||||||
const device = this.alias[serial];
|
const device = this.alias[serial];
|
||||||
let writeSuccess;
|
let writeSuccess;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
if (typeof this.serial[device].fake !== 'undefined'
|
if (typeof this.serial[device].fake !== 'undefined'
|
||||||
&& this.serial[device].fake) {
|
&& this.serial[device].fake) {
|
||||||
return this.serial[device].string(str);
|
return this.serial[device].string(str);
|
||||||
|
@ -243,7 +243,7 @@ class Arduino {
|
||||||
return reject('Wrong data returned');
|
return reject('Wrong data returned');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
return resolve(type);
|
return resolve(type);
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ class Arduino {
|
||||||
if (typeof timeout === 'undefined')
|
if (typeof timeout === 'undefined')
|
||||||
timeout = 10;
|
timeout = 10;
|
||||||
arduino.timer = +new Date();
|
arduino.timer = +new Date();
|
||||||
await delay(timeout);
|
await delay_1.delay(timeout);
|
||||||
arduino.end(serial, cmd);
|
arduino.end(serial, cmd);
|
||||||
return cb();
|
return cb();
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -8,8 +8,8 @@ const parser = new Readline('');
|
||||||
const newlineRe = new RegExp('\n', 'g');
|
const newlineRe = new RegExp('\n', 'g');
|
||||||
const returnRe = new RegExp('\r', 'g');
|
const returnRe = new RegExp('\r', 'g');
|
||||||
|
|
||||||
const exec = require('exec');
|
const { exec } = require('exec');
|
||||||
const delay = require('delay');
|
const { delay } = require('delay');
|
||||||
|
|
||||||
let system = {};
|
let system = {};
|
||||||
let INTVAL;
|
let INTVAL;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
class Commands {
|
class Commands {
|
||||||
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
|
@ -20,10 +20,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -38,10 +38,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -59,14 +59,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -82,14 +82,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -107,14 +107,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -131,14 +131,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -156,14 +156,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -181,14 +181,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -207,16 +207,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -245,16 +245,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -278,16 +278,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -311,16 +311,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.proj2.move];
|
both = [await this.cam.move, await this.proj2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -346,10 +346,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -361,10 +361,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -377,14 +377,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
}
|
}
|
||||||
|
@ -405,14 +405,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -434,14 +434,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -463,14 +463,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,5 +11,5 @@ function delay(ms) {
|
||||||
return setTimeout(resolve, ms);
|
return setTimeout(resolve, ms);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
module.exports = delay;
|
module.exports.delay = delay;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
||||||
{"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,GAAG,KAAK,CAAC"}
|
{"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"}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
/**
|
/**
|
||||||
* class representing the device discovery features
|
* class representing the device discovery features
|
||||||
|
@ -55,7 +55,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.warn(err, 'SERIAL', false, true);
|
this.log.warn(err, 'SERIAL', false, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
return this.all([]);
|
return this.all([]);
|
||||||
}
|
}
|
||||||
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
||||||
|
@ -101,7 +101,7 @@ class Devices {
|
||||||
this.log.error('Error connecting', err);
|
this.log.error('Error connecting', err);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
await delay(2000);
|
await delay_1.delay(2000);
|
||||||
try {
|
try {
|
||||||
verifySuccess = await this.arduino.verify();
|
verifySuccess = await this.arduino.verify();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ class Devices {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
try {
|
try {
|
||||||
type = await this.arduino.distinguish();
|
type = await this.arduino.distinguish();
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Digital {
|
class Digital {
|
||||||
/**
|
/**
|
||||||
|
@ -78,13 +78,13 @@ class Digital {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
await this.display.show(this.state.frame);
|
await this.display.show(this.state.frame);
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
async end() {
|
async end() {
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
this.display.hide();
|
this.display.hide();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IA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,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,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"}
|
|
@ -2,7 +2,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const spawn = require("spawn");
|
const spawn = require("spawn");
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const { BrowserWindow } = require('electron');
|
const { BrowserWindow } = require('electron');
|
||||||
let wv;
|
let wv;
|
||||||
let cp;
|
let cp;
|
||||||
|
@ -41,7 +41,7 @@ class WebView {
|
||||||
async start() {
|
async start() {
|
||||||
await this.open();
|
await this.open();
|
||||||
await this.fullScreen();
|
await this.fullScreen();
|
||||||
await delay(300);
|
await delay_1.delay(300);
|
||||||
}
|
}
|
||||||
async fullScreen() {
|
async fullScreen() {
|
||||||
//this.digitalWindow.setFullScreen(true);
|
//this.digitalWindow.setFullScreen(true);
|
||||||
|
@ -90,7 +90,7 @@ function padded_frame(i) {
|
||||||
async function display_eog(src) {
|
async function display_eog(src) {
|
||||||
//timeout 3 eog --fullscreen ${src}
|
//timeout 3 eog --fullscreen ${src}
|
||||||
cp = spawn('eog', ['--fullscreen', src]);
|
cp = spawn('eog', ['--fullscreen', src]);
|
||||||
await delay(200);
|
await delay_1.delay(200);
|
||||||
}
|
}
|
||||||
function display_wv(src) {
|
function display_wv(src) {
|
||||||
wv.setImage(src);
|
wv.setImage(src);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,6BAA8B;AAE9B,+BAAgC;AAChC,+BAAgC;AAEhC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,IAAI,EAAQ,CAAC;AACb,IAAI,EAAQ,CAAC;AACb,IAAI,MAAM,GAAS,EAAE,CAAC;AAEtB,IAAI,MAAY,CAAC;AAEjB,MAAM,OAAO;IAIZ;QAFO,WAAM,GAAa,KAAK,CAAC;QACzB,YAAO,GAAa,KAAK,CAAC;QAEhC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC;YACtC,cAAc,EAAE;gBACV,eAAe,EAAE,IAAI;gBACrB,2BAA2B,EAAE,KAAK;gBAClC,aAAa,EAAG,KAAK;aACvB;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,QAAQ,EAAG,GAAG;YACd,SAAS,EAAG,GAAG,CAAA,GAAG;YAClB,2DAA2D;SAC3D,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,uBAAuB,CAAC,CAAC;QAC5E,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAA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B,MAAM,IAAI,EAAE,CAAA;QACZ,UAAU,CAAC,OAAO,CAAC,CAAC;KACpB;SAAM;QACN,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3B;AACF,CAAC;AAED,KAAK,UAAU,IAAI;IAClB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;YACnB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;SACnB;KACJ;SAAM;QACN,EAAE;KACF;AACF,CAAC;AAED,KAAK,UAAU,KAAK;IACnB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,EAAE,CAAC,KAAK,EAAE,CAAA;KACV;SAAM;QACN,IAAI,EAAE;YAAE,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,OAAO;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;KACL,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,7 +1,5 @@
|
||||||
'use strict'
|
'use strict';
|
||||||
|
const execRaw = require('child_process').exec;
|
||||||
const execRaw = require('child_process').exec
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promisified child_process.exec
|
* Promisified child_process.exec
|
||||||
*
|
*
|
||||||
|
@ -14,26 +12,26 @@ const execRaw = require('child_process').exec
|
||||||
* @returns {Promise<{ stdout: string, stderr: stderr }>}
|
* @returns {Promise<{ stdout: string, stderr: stderr }>}
|
||||||
*/
|
*/
|
||||||
async function exec(...args) {
|
async function exec(...args) {
|
||||||
let cmd = args[0]
|
let cmd = args[0];
|
||||||
let argz = null
|
let argz = null;
|
||||||
let opts = null
|
let opts = null;
|
||||||
if (typeof args[1] === 'object' && Array.isArray(args[1])) {
|
if (typeof args[1] === 'object' && Array.isArray(args[1])) {
|
||||||
argz = args[1]
|
argz = args[1];
|
||||||
}
|
}
|
||||||
if (argz === null && typeof args[1] === 'object') {
|
if (argz === null && typeof args[1] === 'object') {
|
||||||
opts = args[1]
|
opts = args[1];
|
||||||
} else if (typeof args[2] === 'object') {
|
}
|
||||||
opts = args[2]
|
else if (typeof args[2] === 'object') {
|
||||||
}
|
opts = args[2];
|
||||||
if (opts === null) {
|
}
|
||||||
opts = { maxBuffer : 1024 * 1024 }
|
if (opts === null) {
|
||||||
}
|
opts = { maxBuffer: 1024 * 1024 };
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = execRaw(cmd, opts,
|
const child = execRaw(cmd, opts, (err, stdout, stderr) => err ? reject(err) : resolve({
|
||||||
(err, stdout, stderr) => err ? reject(err) : resolve({
|
stdout,
|
||||||
stdout: stdout,
|
stderr
|
||||||
stderr: stderr
|
}));
|
||||||
}));
|
|
||||||
if (opts.stdout) {
|
if (opts.stdout) {
|
||||||
child.stdout.pipe(opts.stdout);
|
child.stdout.pipe(opts.stdout);
|
||||||
}
|
}
|
||||||
|
@ -42,5 +40,5 @@ async function exec(...args) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
module.exports.exec = exec;
|
||||||
module.exports = exec
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"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,CAA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AAA"}
|
|
@ -1,5 +1,4 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit process with either a 0 code or other
|
* Exit process with either a 0 code or other
|
||||||
* specified failure code. Print message to console first.
|
* specified failure code. Print message to console first.
|
||||||
|
@ -7,15 +6,15 @@
|
||||||
* @param {string} msg Reason for exit
|
* @param {string} msg Reason for exit
|
||||||
* @param {integer} code process exit code, default 0
|
* @param {integer} code process exit code, default 0
|
||||||
**/
|
**/
|
||||||
|
function exit(msg, code = 0) {
|
||||||
function exit (msg, code = 0) {
|
if (code === 0) {
|
||||||
if (code === 0) {
|
console.log(msg);
|
||||||
console.log(msg);
|
process.exit();
|
||||||
process.exit();
|
}
|
||||||
} else {
|
else {
|
||||||
console.error(msg);
|
console.error(msg);
|
||||||
process.exit(code);
|
process.exit(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
module.exports.exit = exit;
|
||||||
module.exports = exit;
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"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"}
|
|
@ -1,179 +1,168 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
const uuid = require('uuid').v4;
|
if (mod && mod.__esModule) return mod;
|
||||||
const path = require('path');
|
var result = {};
|
||||||
const fs = require('fs-extra');
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
const exec = require('exec');
|
return result;
|
||||||
//const spawn = require('spawn');
|
};
|
||||||
const exit = require('exit');
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const path = __importStar(require("path"));
|
||||||
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
let system = {};
|
let system = {};
|
||||||
let TMPDIR;
|
let TMPDIR;
|
||||||
|
function padded_frame(i) {
|
||||||
function padded_frame (i) {
|
let len = (i + '').length;
|
||||||
let len = (i + '').length;
|
let str = i + '';
|
||||||
let str = i + '';
|
for (let x = 0; x < 5 - len; x++) {
|
||||||
for (let x = 0; x < 5 - len; x++) {
|
str = '0' + str;
|
||||||
str = '0' + str;
|
}
|
||||||
}
|
return str;
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
|
async function frame(state, light) {
|
||||||
async function frame (state, light) {
|
let frame = state.frame;
|
||||||
let frame = state.frame
|
let video = state.path;
|
||||||
let video = state.path
|
let w = state.info.width;
|
||||||
let w = state.info.width
|
let h = state.info.height;
|
||||||
let h = state.info.height
|
let padded = padded_frame(frame);
|
||||||
let padded = padded_frame(frame)
|
let ext = 'tif';
|
||||||
let ext = 'tif'
|
let rgb = light.color;
|
||||||
let rgb = light.color;
|
let tmpoutput;
|
||||||
let tmpoutput
|
let cmd;
|
||||||
let cmd
|
let output;
|
||||||
let output
|
let cmd2;
|
||||||
let cmd2
|
let output2;
|
||||||
let output2
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
if (system.platform !== 'nix') {
|
}
|
||||||
ext = 'png'
|
rgb = rgb.map((e) => {
|
||||||
}
|
return parseInt(e);
|
||||||
|
});
|
||||||
rgb = rgb.map(e => {
|
tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
return parseInt(e);
|
cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`;
|
||||||
});
|
cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`;
|
||||||
|
//ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg"
|
||||||
tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`);
|
//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"
|
||||||
cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`;
|
try {
|
||||||
cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`;
|
console.log(cmd);
|
||||||
|
output = await exec_1.exec(cmd);
|
||||||
//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"
|
catch (err) {
|
||||||
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
console.error(err);
|
||||||
|
}
|
||||||
try {
|
if (output && output.stdout)
|
||||||
console.log(cmd);
|
console.log(`"${output.stdout}"`);
|
||||||
output = await exec(cmd);
|
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
||||||
} catch (err) {
|
try {
|
||||||
console.error(err);
|
console.log(cmd2);
|
||||||
}
|
output2 = await exec_1.exec(cmd2);
|
||||||
if (output && output.stdout) console.log(`"${output.stdout}"`);
|
}
|
||||||
|
catch (err) {
|
||||||
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
console.error(err);
|
||||||
try {
|
}
|
||||||
console.log(cmd2);
|
}
|
||||||
output2 = await exec(cmd2);
|
if (output2 && output2.stdout)
|
||||||
} catch (err) {
|
console.log(`"${output2.stdout}"`);
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (output2 && output2.stdout) console.log(`"${output2.stdout}"`);
|
|
||||||
}
|
}
|
||||||
|
async function frames(video, obj) {
|
||||||
async function frames (video, obj) {
|
let tmppath = TMPDIR;
|
||||||
let tmppath = TMPDIR;
|
let ext = 'tif';
|
||||||
let ext = 'tif';
|
let tmpoutput;
|
||||||
let tmpoutput;
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
if (system.platform !== 'nix') {
|
}
|
||||||
ext = 'png';
|
tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
|
||||||
}
|
try {
|
||||||
|
await fs_extra_1.mkdir(tmppath);
|
||||||
tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
|
}
|
||||||
try {
|
catch (err) {
|
||||||
await fs.mkdir(tmppath)
|
console.error(err);
|
||||||
} catch (Err) {
|
}
|
||||||
console.error(err);
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
|
||||||
}
|
|
||||||
|
|
||||||
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
|
|
||||||
}
|
}
|
||||||
|
async function clear(frame) {
|
||||||
async function clear (frame) {
|
let padded = padded_frame(frame);
|
||||||
let padded = padded_frame(frame);
|
let ext = 'tif';
|
||||||
let ext = 'tif';
|
let tmppath;
|
||||||
let tmppath;
|
let tmpoutput;
|
||||||
let tmpoutput;
|
let cmd;
|
||||||
let cmd;
|
let fileExists;
|
||||||
let exists;
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
if (system.platform !== 'nix') {
|
}
|
||||||
ext = 'png';
|
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
}
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(tmppath);
|
||||||
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
}
|
||||||
|
catch (err) {
|
||||||
try {
|
console.error(err);
|
||||||
exists = await fs.exists(tmppath);
|
}
|
||||||
} catch (err) {
|
if (!fs_extra_1.exists)
|
||||||
console.error(err);
|
return false;
|
||||||
}
|
try {
|
||||||
|
await fs_extra_1.unlink(tmppath);
|
||||||
if (!exists) return false;
|
console.log(`Cleared frame ${tmppath}`);
|
||||||
|
}
|
||||||
try {
|
catch (err) {
|
||||||
await fs.unlink(tmppath);
|
console.error(err);
|
||||||
console.log(`Cleared frame ${tmppath}`);
|
}
|
||||||
} catch (err) {
|
return true;
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
async function clearAll() {
|
||||||
async function clearAll () {
|
let tmppath = TMPDIR;
|
||||||
let tmppath = TMPDIR;
|
let files;
|
||||||
let files;
|
try {
|
||||||
try {
|
files = await fs_extra_1.readdir(tmppath);
|
||||||
files = await fs.readdir(tmppath);
|
}
|
||||||
} catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
if (files) {
|
if (files) {
|
||||||
files.forEach(async (file, index) => {
|
files.forEach(async (file, index) => {
|
||||||
try {
|
try {
|
||||||
await fs.unlink(path.join(tmppath, file));
|
await fs_extra_1.unlink(path.join(tmppath, file));
|
||||||
} catch (err) {
|
}
|
||||||
console.error(err);
|
catch (err) {
|
||||||
}
|
console.error(err);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
async function checkDir() {
|
||||||
async function checkDir () {
|
let fileExists;
|
||||||
let exists;
|
try {
|
||||||
try {
|
fileExists = await fs_extra_1.exists(TMPDIR);
|
||||||
exists = await fs.exists(TMPDIR);
|
}
|
||||||
} catch (err) {
|
catch (err) {
|
||||||
console.error('Error checking for tmp dir', err);
|
console.error('Error checking for tmp dir', err);
|
||||||
}
|
}
|
||||||
|
if (!fs_extra_1.exists) {
|
||||||
if (!exists) {
|
try {
|
||||||
try {
|
await fs_extra_1.mkdir(TMPDIR);
|
||||||
await fs.mkdir(TMPDIR);
|
console.log(`Created tmpdir ${TMPDIR}`);
|
||||||
console.log(`Created tmpdir ${TMPDIR}`);
|
}
|
||||||
} catch (err) {
|
catch (err) {
|
||||||
console.error('Error creating tmp dir', err);
|
console.error('Error creating tmp dir', err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await clearAll();
|
await clearAll();
|
||||||
} catch (err) {
|
}
|
||||||
console.error(err);
|
catch (err) {
|
||||||
}
|
console.error(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = (sys) => {
|
module.exports = (sys) => {
|
||||||
system = sys;
|
system = sys;
|
||||||
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||||
|
checkDir();
|
||||||
checkDir();
|
return {
|
||||||
|
frames,
|
||||||
return {
|
frame,
|
||||||
frames,
|
clear,
|
||||||
frame,
|
clearAll
|
||||||
clear,
|
};
|
||||||
clearAll
|
};
|
||||||
}
|
//# sourceMappingURL=index.js.map
|
||||||
}
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAGb,2CAA6B;AAC7B,uCAA0D;AAC1D,+BAA4B;AAI5B,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,MAAe,CAAC;AAEpB,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,C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AQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,104 +1,96 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const fs = require('fs-extra');
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
const exec = require('exec');
|
|
||||||
//const spawn = require('spawn');
|
//const spawn = require('spawn');
|
||||||
//const exit = require('exit');
|
//const exit = require('exit');
|
||||||
|
|
||||||
let system = {};
|
let system = {};
|
||||||
|
async function info(video) {
|
||||||
async function info (video) {
|
let cmd = `ffprobe -v quiet -print_format json -show_format -show_streams "${video}"`;
|
||||||
let cmd = `ffprobe -v quiet -print_format json -show_format -show_streams "${video}"`
|
let fileExists;
|
||||||
let exists;
|
let raw;
|
||||||
let raw;
|
let json;
|
||||||
let json;
|
let vid;
|
||||||
let vid;
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(video);
|
||||||
try {
|
}
|
||||||
exists = await fs.exists(video);
|
catch (err) {
|
||||||
} catch (err) {
|
return exit(err, 5);
|
||||||
return exit(err, 5);
|
}
|
||||||
}
|
if (!fileExists) {
|
||||||
if (!exists) {
|
//return exit(`File ${video} does not exist`, 6);
|
||||||
//return exit(`File ${video} does not exist`, 6);
|
console.error(new Error(`File ${video} does not exist`));
|
||||||
console.error(err);
|
return false;
|
||||||
return false
|
}
|
||||||
}
|
try {
|
||||||
|
console.log(cmd);
|
||||||
try {
|
raw = await exec_1.exec(cmd);
|
||||||
console.log(cmd);
|
}
|
||||||
raw = await exec(cmd);
|
catch (err) {
|
||||||
} catch (err) {
|
//return exit(err, 7);
|
||||||
//return exit(err, 7);
|
console.error(err);
|
||||||
console.error(err);
|
return false;
|
||||||
return false
|
}
|
||||||
}
|
try {
|
||||||
|
json = JSON.parse(raw.stdout);
|
||||||
try {
|
}
|
||||||
json = JSON.parse(raw.stdout);
|
catch (err) {
|
||||||
} catch (err) {
|
return raw.stdout;
|
||||||
return raw.stdout;
|
}
|
||||||
}
|
if (json && json.streams) {
|
||||||
|
vid = json.streams.find((stream) => {
|
||||||
if (json && json.streams) {
|
if (stream.width && stream.height)
|
||||||
vid = json.streams.find(stream => {
|
return stream;
|
||||||
if (stream.width && stream.height) return stream;
|
});
|
||||||
});
|
}
|
||||||
}
|
if (vid) {
|
||||||
|
json.width = vid.width;
|
||||||
if (vid) {
|
json.height = vid.height;
|
||||||
json.width = vid.width;
|
}
|
||||||
json.height = vid.height;
|
return json;
|
||||||
}
|
|
||||||
|
|
||||||
return json;
|
|
||||||
}
|
}
|
||||||
|
async function frames(video) {
|
||||||
async function frames (video) {
|
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||||
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
let fileExists;
|
||||||
let exists;
|
let raw;
|
||||||
let raw;
|
let frames;
|
||||||
let frames;
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(video);
|
||||||
try {
|
}
|
||||||
exists = await fs.exists(video);
|
catch (err) {
|
||||||
} catch (err) {
|
//return exit(err, 5);
|
||||||
//return exit(err, 5);
|
console.error(err);
|
||||||
console.error(err);
|
return false;
|
||||||
return false
|
}
|
||||||
}
|
if (!fileExists) {
|
||||||
if (!exists) {
|
//return exit(`File ${video} does not exist`, 6);
|
||||||
//return exit(`File ${video} does not exist`, 6);
|
console.error(new Error(`File ${video} does not exist`));
|
||||||
console.error(err);
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
try {
|
||||||
|
console.log(cmd);
|
||||||
try {
|
raw = await exec_1.exec(cmd);
|
||||||
console.log(cmd);
|
}
|
||||||
raw = await exec(cmd);
|
catch (err) {
|
||||||
} catch (err) {
|
console.error(err);
|
||||||
console.error(err);
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
try {
|
||||||
|
frames = parseInt(raw.stdout);
|
||||||
try {
|
}
|
||||||
frames = parseInt(raw.stdout)
|
catch (err) {
|
||||||
} catch (err) {
|
return raw.stdout;
|
||||||
return raw.stdout;
|
}
|
||||||
}
|
return frames;
|
||||||
|
|
||||||
return frames;
|
|
||||||
}
|
}
|
||||||
|
function map(obj) {
|
||||||
function map (obj) {
|
console.dir(obj);
|
||||||
console.dir(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = (sys) => {
|
module.exports = (sys) => {
|
||||||
system = sys;
|
system = sys;
|
||||||
return {
|
return {
|
||||||
info,
|
info,
|
||||||
frames
|
frames
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,uCAAkC;AAClC,+BAA4B;AAC5B,iCAAiC;AACjC,+BAA+B;AAE/B,IAAI,MAAM,GAAG,EAAE,CAAC;AAEhB,KAAK,UAAU,IAAI,CAAE,KAAc;IAClC,IAAI,GAAG,GAAG,mEAAmE,KAAK,GAAG,CAAA;IACrF,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GAAG,CAAC;IAER,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpB;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAA;KACZ;IAED,IAAI;QACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,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C,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,GAAG,CAAE,GAAS;IACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Light {
|
class Light {
|
||||||
/**
|
/**
|
||||||
|
@ -62,14 +62,14 @@ class Light {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light command', err);
|
this.log.error('Error sending light command', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
try {
|
try {
|
||||||
this.arduino.string(this.id, str);
|
this.arduino.string(this.id, str);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light string', err);
|
this.log.error('Error sending light string', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
await ms;
|
await ms;
|
||||||
return await this.end(rgb, id, ms);
|
return await this.end(rgb, id, ms);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/light/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,KAAK;IAYV;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ;QAd5C,UAAK,GAAS,EAAE,KAAK,EAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;QAOlC,YAAO,GAAa,IAAI,CAAC;QAEzB,OAAE,GAAY,OAAO,CAAC;QAM7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,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,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IAED;;QAEI;IACI,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,QAAQ,CAAE,KAAW,EAAE,GAAS;QAC7C,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,WAAW,EAAE;YACnC,IAAI;gBACH,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACt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AAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC5D;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;SACnD;QACD,MAAM,aAAK,CAAC,CAAC,CAAC,CAAC;QACf,IAAI;YACH,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;SAClC;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;SAClD;QACD,MAAM,aAAK,CAAC,CAAC,CAAC,CAAC;QACf,MAAM,EAAE,CAAC;QACT,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,GAAG,CAAE,GAAc,EAAE,EAAW,EAAE,EAAW;QAC1D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACpE,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,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"}
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const os = require("os");
|
const os_1 = require("os");
|
||||||
const si = require("systeminformation");
|
const systeminformation_1 = require("systeminformation");
|
||||||
//private
|
//private
|
||||||
const exec = require('exec');
|
const exec_1 = require("exec");
|
||||||
/**
|
/**
|
||||||
* Evaluates system dependencies for digital
|
* Evaluates system dependencies for digital
|
||||||
* projector features by executing processes with
|
* projector features by executing processes with
|
||||||
|
@ -14,7 +14,7 @@ const exec = require('exec');
|
||||||
async function dependencies(platform) {
|
async function dependencies(platform) {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
try {
|
try {
|
||||||
await exec('ffmpeg -h');
|
await exec_1.exec('ffmpeg -h');
|
||||||
obj.ffmpeg = 'ffmpeg';
|
obj.ffmpeg = 'ffmpeg';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -24,7 +24,7 @@ async function dependencies(platform) {
|
||||||
//if linux
|
//if linux
|
||||||
if (platform === 'nix') {
|
if (platform === 'nix') {
|
||||||
try {
|
try {
|
||||||
await exec('eog -h');
|
await exec_1.exec('eog -h');
|
||||||
obj.eog = 'eog';
|
obj.eog = 'eog';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -42,7 +42,7 @@ function displayMap(obj) {
|
||||||
return sm;
|
return sm;
|
||||||
}
|
}
|
||||||
async function displays() {
|
async function displays() {
|
||||||
const obj = await si.graphics();
|
const obj = await systeminformation_1.graphics();
|
||||||
const arr = obj.displays;
|
const arr = obj.displays;
|
||||||
return arr.map(displayMap);
|
return arr.map(displayMap);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,12 @@ async function system() {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
let platform;
|
let platform;
|
||||||
try {
|
try {
|
||||||
obj.tmp = os.tmpdir();
|
obj.tmp = os_1.tmpdir();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
obj.tmp = '/tmp';
|
obj.tmp = '/tmp';
|
||||||
}
|
}
|
||||||
platform = os.type();
|
platform = os_1.type();
|
||||||
if (platform === 'Darwin') {
|
if (platform === 'Darwin') {
|
||||||
obj.platform = 'osx';
|
obj.platform = 'osx';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yBAA0B;AAC1B,wCAAyC;AACzC,SAAS;AACT,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B;;;;;;IAMI;AAEJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IAEnB,IAAI;QACH,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,4CAA4C;QAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KACrD;IACD,UAAU;IACV,IAAI,QAAQ,KAAK,KAAK,EAAE;QACvB,IAAI;YACH,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC;SAChB;QAAC,OAAO,GAAG,EAAE;YACb,yCAAyC;YACzC,OAAO,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SAClD;KACD;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAE,GAAS;IAC7B,MAAM,EAAE,GAAG;QACV,KAAK,EAAG,GAAG,CAAC,WAAW;QACvB,MAAM,EAAG,GAAG,CAAC,WAAW;KACxB,CAAC;IACF,OAAO,EAAE,CAAC;AACX,CAAC;AAED,KAAK,UAAU,QAAQ;IACtB,MAAM,GAAG,GAAS,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAA;IACrC,MAAM,GAAG,GAAW,GAAG,CAAC,QAAQ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,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@ -21,7 +21,7 @@ const settings = require('settings')
|
||||||
const system = require('system')
|
const system = require('system')
|
||||||
const Server = require('server')
|
const Server = require('server')
|
||||||
const Intval = require('intval')
|
const Intval = require('intval')
|
||||||
const delay = require('delay')
|
const { delay } = require('delay')
|
||||||
|
|
||||||
//Objects
|
//Objects
|
||||||
const mcopy = {}
|
const mcopy = {}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mcopy-app",
|
"name": "mcopy-app",
|
||||||
"version": "1.4.7",
|
"version": "1.4.10",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
|
|
||||||
const delay = require('delay')
|
const { delay } = require('delay')
|
||||||
|
|
||||||
describe('delay module', async () => {
|
describe('delay module', async () => {
|
||||||
it('should be a function', () =>{
|
it('should be a function', () =>{
|
||||||
|
|
|
@ -9,8 +9,8 @@ const ee = new events.EventEmitter()
|
||||||
const cfg = require('../app/data/cfg.json')
|
const cfg = require('../app/data/cfg.json')
|
||||||
const pkg = require('./package.json')
|
const pkg = require('./package.json')
|
||||||
|
|
||||||
const delay = require('delay')
|
const { delay } = require('delay')
|
||||||
const exit = require('exit')
|
const { exit } = require('exit')
|
||||||
const intval = require('intval')
|
const intval = require('intval')
|
||||||
const arduino = require('arduino')(cfg, ee)
|
const arduino = require('arduino')(cfg, ee)
|
||||||
const Mscript = require('mscript')
|
const Mscript = require('mscript')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
//import Log = require('log');
|
//import Log = require('log');
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const SerialPort = require('serialport');
|
const SerialPort = require('serialport');
|
||||||
const Readline = SerialPort.parsers.Readline;
|
const Readline = SerialPort.parsers.Readline;
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
|
@ -104,7 +104,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
this.timer = new Date().getTime();
|
this.timer = new Date().getTime();
|
||||||
this.locks[serial] = true;
|
this.locks[serial] = true;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
results = await this.sendAsync(device, cmd);
|
results = await this.sendAsync(device, cmd);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ class Arduino {
|
||||||
async string(serial, str) {
|
async string(serial, str) {
|
||||||
const device = this.alias[serial];
|
const device = this.alias[serial];
|
||||||
let writeSuccess;
|
let writeSuccess;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
if (typeof this.serial[device].fake !== 'undefined'
|
if (typeof this.serial[device].fake !== 'undefined'
|
||||||
&& this.serial[device].fake) {
|
&& this.serial[device].fake) {
|
||||||
return this.serial[device].string(str);
|
return this.serial[device].string(str);
|
||||||
|
@ -243,7 +243,7 @@ class Arduino {
|
||||||
return reject('Wrong data returned');
|
return reject('Wrong data returned');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
return resolve(type);
|
return resolve(type);
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ class Arduino {
|
||||||
if (typeof timeout === 'undefined')
|
if (typeof timeout === 'undefined')
|
||||||
timeout = 10;
|
timeout = 10;
|
||||||
arduino.timer = +new Date();
|
arduino.timer = +new Date();
|
||||||
await delay(timeout);
|
await delay_1.delay(timeout);
|
||||||
arduino.end(serial, cmd);
|
arduino.end(serial, cmd);
|
||||||
return cb();
|
return cb();
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
class Commands {
|
class Commands {
|
||||||
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
|
@ -20,10 +20,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -38,10 +38,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -59,14 +59,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -82,14 +82,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -107,14 +107,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -131,14 +131,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -156,14 +156,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -181,14 +181,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -207,16 +207,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -245,16 +245,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -278,16 +278,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -311,16 +311,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.proj2.move];
|
both = [await this.cam.move, await this.proj2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -346,10 +346,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -361,10 +361,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -377,14 +377,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
}
|
}
|
||||||
|
@ -405,14 +405,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -434,14 +434,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -463,14 +463,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,5 +11,5 @@ function delay(ms) {
|
||||||
return setTimeout(resolve, ms);
|
return setTimeout(resolve, ms);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
module.exports = delay;
|
module.exports.delay = delay;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
||||||
{"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,GAAG,KAAK,CAAC"}
|
{"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"}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
/**
|
/**
|
||||||
* class representing the device discovery features
|
* class representing the device discovery features
|
||||||
|
@ -55,7 +55,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.warn(err, 'SERIAL', false, true);
|
this.log.warn(err, 'SERIAL', false, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
return this.all([]);
|
return this.all([]);
|
||||||
}
|
}
|
||||||
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
||||||
|
@ -101,7 +101,7 @@ class Devices {
|
||||||
this.log.error('Error connecting', err);
|
this.log.error('Error connecting', err);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
await delay(2000);
|
await delay_1.delay(2000);
|
||||||
try {
|
try {
|
||||||
verifySuccess = await this.arduino.verify();
|
verifySuccess = await this.arduino.verify();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ class Devices {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
try {
|
try {
|
||||||
type = await this.arduino.distinguish();
|
type = await this.arduino.distinguish();
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Digital {
|
class Digital {
|
||||||
/**
|
/**
|
||||||
|
@ -78,13 +78,13 @@ class Digital {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
await this.display.show(this.state.frame);
|
await this.display.show(this.state.frame);
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
async end() {
|
async end() {
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
this.display.hide();
|
this.display.hide();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,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,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,I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G,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,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"}
|
|
@ -2,7 +2,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const spawn = require("spawn");
|
const spawn = require("spawn");
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const { BrowserWindow } = require('electron');
|
const { BrowserWindow } = require('electron');
|
||||||
let wv;
|
let wv;
|
||||||
let cp;
|
let cp;
|
||||||
|
@ -41,7 +41,7 @@ class WebView {
|
||||||
async start() {
|
async start() {
|
||||||
await this.open();
|
await this.open();
|
||||||
await this.fullScreen();
|
await this.fullScreen();
|
||||||
await delay(300);
|
await delay_1.delay(300);
|
||||||
}
|
}
|
||||||
async fullScreen() {
|
async fullScreen() {
|
||||||
//this.digitalWindow.setFullScreen(true);
|
//this.digitalWindow.setFullScreen(true);
|
||||||
|
@ -90,7 +90,7 @@ function padded_frame(i) {
|
||||||
async function display_eog(src) {
|
async function display_eog(src) {
|
||||||
//timeout 3 eog --fullscreen ${src}
|
//timeout 3 eog --fullscreen ${src}
|
||||||
cp = spawn('eog', ['--fullscreen', src]);
|
cp = spawn('eog', ['--fullscreen', src]);
|
||||||
await delay(200);
|
await delay_1.delay(200);
|
||||||
}
|
}
|
||||||
function display_wv(src) {
|
function display_wv(src) {
|
||||||
wv.setImage(src);
|
wv.setImage(src);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display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ACF;AACF,CAAC;AAED,KAAK,UAAU,KAAK;IACnB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,EAAE,CAAC,KAAK,EAAE,CAAA;KACV;SAAM;QACN,IAAI,EAAE;YAAE,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,OAAO;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;KACL,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,7 +1,5 @@
|
||||||
'use strict'
|
'use strict';
|
||||||
|
const execRaw = require('child_process').exec;
|
||||||
const execRaw = require('child_process').exec
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promisified child_process.exec
|
* Promisified child_process.exec
|
||||||
*
|
*
|
||||||
|
@ -14,26 +12,26 @@ const execRaw = require('child_process').exec
|
||||||
* @returns {Promise<{ stdout: string, stderr: stderr }>}
|
* @returns {Promise<{ stdout: string, stderr: stderr }>}
|
||||||
*/
|
*/
|
||||||
async function exec(...args) {
|
async function exec(...args) {
|
||||||
let cmd = args[0]
|
let cmd = args[0];
|
||||||
let argz = null
|
let argz = null;
|
||||||
let opts = null
|
let opts = null;
|
||||||
if (typeof args[1] === 'object' && Array.isArray(args[1])) {
|
if (typeof args[1] === 'object' && Array.isArray(args[1])) {
|
||||||
argz = args[1]
|
argz = args[1];
|
||||||
}
|
}
|
||||||
if (argz === null && typeof args[1] === 'object') {
|
if (argz === null && typeof args[1] === 'object') {
|
||||||
opts = args[1]
|
opts = args[1];
|
||||||
} else if (typeof args[2] === 'object') {
|
}
|
||||||
opts = args[2]
|
else if (typeof args[2] === 'object') {
|
||||||
}
|
opts = args[2];
|
||||||
if (opts === null) {
|
}
|
||||||
opts = { maxBuffer : 1024 * 1024 }
|
if (opts === null) {
|
||||||
}
|
opts = { maxBuffer: 1024 * 1024 };
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = execRaw(cmd, opts,
|
const child = execRaw(cmd, opts, (err, stdout, stderr) => err ? reject(err) : resolve({
|
||||||
(err, stdout, stderr) => err ? reject(err) : resolve({
|
stdout,
|
||||||
stdout: stdout,
|
stderr
|
||||||
stderr: stderr
|
}));
|
||||||
}));
|
|
||||||
if (opts.stdout) {
|
if (opts.stdout) {
|
||||||
child.stdout.pipe(opts.stdout);
|
child.stdout.pipe(opts.stdout);
|
||||||
}
|
}
|
||||||
|
@ -42,5 +40,5 @@ async function exec(...args) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
module.exports.exec = exec;
|
||||||
module.exports = exec
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"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"}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<a name="exit"></a>
|
||||||
|
|
||||||
|
## 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 | <code>string</code> | | Reason for exit |
|
||||||
|
| code | <code>integer</code> | <code>0</code> | process exit code, default 0 |
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
/**
|
||||||
const log = require('log')({quiet : false})
|
* Exit process with either a 0 code or other
|
||||||
|
* specified failure code. Print message to console first.
|
||||||
function exit (msg, code = 0) {
|
*
|
||||||
if (code === 0) {
|
* @param {string} msg Reason for exit
|
||||||
log.info(msg);
|
* @param {integer} code process exit code, default 0
|
||||||
process.exit();
|
**/
|
||||||
} else {
|
function exit(msg, code = 0) {
|
||||||
log.error(msg);
|
if (code === 0) {
|
||||||
process.exit(code);
|
console.log(msg);
|
||||||
}
|
process.exit();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.error(msg);
|
||||||
|
process.exit(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
module.exports.exit = exit;
|
||||||
module.exports = exit;
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"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"}
|
|
@ -0,0 +1,168 @@
|
||||||
|
'use strict';
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const path = __importStar(require("path"));
|
||||||
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
|
let system = {};
|
||||||
|
let TMPDIR;
|
||||||
|
function padded_frame(i) {
|
||||||
|
let len = (i + '').length;
|
||||||
|
let str = i + '';
|
||||||
|
for (let x = 0; x < 5 - len; x++) {
|
||||||
|
str = '0' + str;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
async function frame(state, light) {
|
||||||
|
let frame = state.frame;
|
||||||
|
let video = state.path;
|
||||||
|
let w = state.info.width;
|
||||||
|
let h = state.info.height;
|
||||||
|
let padded = padded_frame(frame);
|
||||||
|
let ext = 'tif';
|
||||||
|
let rgb = light.color;
|
||||||
|
let tmpoutput;
|
||||||
|
let cmd;
|
||||||
|
let output;
|
||||||
|
let cmd2;
|
||||||
|
let output2;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
rgb = rgb.map((e) => {
|
||||||
|
return parseInt(e);
|
||||||
|
});
|
||||||
|
tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
|
cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`;
|
||||||
|
cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`;
|
||||||
|
//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 {
|
||||||
|
console.log(cmd);
|
||||||
|
output = await exec_1.exec(cmd);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (output && output.stdout)
|
||||||
|
console.log(`"${output.stdout}"`);
|
||||||
|
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
||||||
|
try {
|
||||||
|
console.log(cmd2);
|
||||||
|
output2 = await exec_1.exec(cmd2);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (output2 && output2.stdout)
|
||||||
|
console.log(`"${output2.stdout}"`);
|
||||||
|
}
|
||||||
|
async function frames(video, obj) {
|
||||||
|
let tmppath = TMPDIR;
|
||||||
|
let ext = 'tif';
|
||||||
|
let tmpoutput;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
|
||||||
|
try {
|
||||||
|
await fs_extra_1.mkdir(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
|
||||||
|
}
|
||||||
|
async function clear(frame) {
|
||||||
|
let padded = padded_frame(frame);
|
||||||
|
let ext = 'tif';
|
||||||
|
let tmppath;
|
||||||
|
let tmpoutput;
|
||||||
|
let cmd;
|
||||||
|
let fileExists;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (!fs_extra_1.exists)
|
||||||
|
return false;
|
||||||
|
try {
|
||||||
|
await fs_extra_1.unlink(tmppath);
|
||||||
|
console.log(`Cleared frame ${tmppath}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
async function clearAll() {
|
||||||
|
let tmppath = TMPDIR;
|
||||||
|
let files;
|
||||||
|
try {
|
||||||
|
files = await fs_extra_1.readdir(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (files) {
|
||||||
|
files.forEach(async (file, index) => {
|
||||||
|
try {
|
||||||
|
await fs_extra_1.unlink(path.join(tmppath, file));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function checkDir() {
|
||||||
|
let fileExists;
|
||||||
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(TMPDIR);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Error checking for tmp dir', err);
|
||||||
|
}
|
||||||
|
if (!fs_extra_1.exists) {
|
||||||
|
try {
|
||||||
|
await fs_extra_1.mkdir(TMPDIR);
|
||||||
|
console.log(`Created tmpdir ${TMPDIR}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Error creating tmp dir', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await clearAll();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = (sys) => {
|
||||||
|
system = sys;
|
||||||
|
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||||
|
checkDir();
|
||||||
|
return {
|
||||||
|
frames,
|
||||||
|
frame,
|
||||||
|
clear,
|
||||||
|
clearAll
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,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MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,QAAQ,EAAE,CAAC;IAEX,OAAO;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,QAAQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "ffmpeg",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
|
//const spawn = require('spawn');
|
||||||
|
//const exit = require('exit');
|
||||||
|
let system = {};
|
||||||
|
async function info(video) {
|
||||||
|
let cmd = `ffprobe -v quiet -print_format json -show_format -show_streams "${video}"`;
|
||||||
|
let fileExists;
|
||||||
|
let raw;
|
||||||
|
let json;
|
||||||
|
let vid;
|
||||||
|
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 && json.streams) {
|
||||||
|
vid = json.streams.find((stream) => {
|
||||||
|
if (stream.width && stream.height)
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (vid) {
|
||||||
|
json.width = vid.width;
|
||||||
|
json.height = vid.height;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
async function frames(video) {
|
||||||
|
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
console.dir(obj);
|
||||||
|
}
|
||||||
|
module.exports = (sys) => {
|
||||||
|
system = sys;
|
||||||
|
return {
|
||||||
|
info,
|
||||||
|
frames
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ff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AE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "ffprobe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Light {
|
class Light {
|
||||||
/**
|
/**
|
||||||
|
@ -62,14 +62,14 @@ class Light {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light command', err);
|
this.log.error('Error sending light command', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
try {
|
try {
|
||||||
this.arduino.string(this.id, str);
|
this.arduino.string(this.id, str);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light string', err);
|
this.log.error('Error sending light string', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
await ms;
|
await ms;
|
||||||
return await this.end(rgb, id, ms);
|
return await this.end(rgb, id, ms);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/light/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,KAAK;IAYV;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ;QAd5C,UAAK,GAAS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C,CAAC;SAClC;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;SAClD;QACD,MAAM,aAAK,CAAC,CAAC,CAAC,CAAC;QACf,MAAM,EAAE,CAAC;QACT,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,GAAG,CAAE,GAAc,EAAE,EAAW,EAAE,EAAW;QAC1D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACpE,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,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"}
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const os = require("os");
|
const os_1 = require("os");
|
||||||
const si = require("systeminformation");
|
const systeminformation_1 = require("systeminformation");
|
||||||
//private
|
//private
|
||||||
const exec = require('exec');
|
const exec_1 = require("exec");
|
||||||
/**
|
/**
|
||||||
* Evaluates system dependencies for digital
|
* Evaluates system dependencies for digital
|
||||||
* projector features by executing processes with
|
* projector features by executing processes with
|
||||||
|
@ -14,7 +14,7 @@ const exec = require('exec');
|
||||||
async function dependencies(platform) {
|
async function dependencies(platform) {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
try {
|
try {
|
||||||
await exec('ffmpeg -h');
|
await exec_1.exec('ffmpeg -h');
|
||||||
obj.ffmpeg = 'ffmpeg';
|
obj.ffmpeg = 'ffmpeg';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -24,7 +24,7 @@ async function dependencies(platform) {
|
||||||
//if linux
|
//if linux
|
||||||
if (platform === 'nix') {
|
if (platform === 'nix') {
|
||||||
try {
|
try {
|
||||||
await exec('eog -h');
|
await exec_1.exec('eog -h');
|
||||||
obj.eog = 'eog';
|
obj.eog = 'eog';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -42,7 +42,7 @@ function displayMap(obj) {
|
||||||
return sm;
|
return sm;
|
||||||
}
|
}
|
||||||
async function displays() {
|
async function displays() {
|
||||||
const obj = await si.graphics();
|
const obj = await systeminformation_1.graphics();
|
||||||
const arr = obj.displays;
|
const arr = obj.displays;
|
||||||
return arr.map(displayMap);
|
return arr.map(displayMap);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,12 @@ async function system() {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
let platform;
|
let platform;
|
||||||
try {
|
try {
|
||||||
obj.tmp = os.tmpdir();
|
obj.tmp = os_1.tmpdir();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
obj.tmp = '/tmp';
|
obj.tmp = '/tmp';
|
||||||
}
|
}
|
||||||
platform = os.type();
|
platform = os_1.type();
|
||||||
if (platform === 'Darwin') {
|
if (platform === 'Darwin') {
|
||||||
obj.platform = 'osx';
|
obj.platform = 'osx';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yBAA0B;AAC1B,wCAAyC;AACzC,SAAS;AACT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
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
//import Log = require('log');
|
//import Log = require('log');
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const SerialPort = require('serialport');
|
const SerialPort = require('serialport');
|
||||||
const Readline = SerialPort.parsers.Readline;
|
const Readline = SerialPort.parsers.Readline;
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
|
@ -104,7 +104,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
this.timer = new Date().getTime();
|
this.timer = new Date().getTime();
|
||||||
this.locks[serial] = true;
|
this.locks[serial] = true;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
results = await this.sendAsync(device, cmd);
|
results = await this.sendAsync(device, cmd);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ class Arduino {
|
||||||
async string(serial, str) {
|
async string(serial, str) {
|
||||||
const device = this.alias[serial];
|
const device = this.alias[serial];
|
||||||
let writeSuccess;
|
let writeSuccess;
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
if (typeof this.serial[device].fake !== 'undefined'
|
if (typeof this.serial[device].fake !== 'undefined'
|
||||||
&& this.serial[device].fake) {
|
&& this.serial[device].fake) {
|
||||||
return this.serial[device].string(str);
|
return this.serial[device].string(str);
|
||||||
|
@ -243,7 +243,7 @@ class Arduino {
|
||||||
return reject('Wrong data returned');
|
return reject('Wrong data returned');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.connect);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ class Arduino {
|
||||||
}
|
}
|
||||||
return resolve(type);
|
return resolve(type);
|
||||||
};
|
};
|
||||||
await delay(cfg.arduino.serialDelay);
|
await delay_1.delay(cfg.arduino.serialDelay);
|
||||||
try {
|
try {
|
||||||
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
writeSuccess = await this.sendAsync(device, cfg.arduino.cmd.mcopy_identifier);
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ class Arduino {
|
||||||
if (typeof timeout === 'undefined')
|
if (typeof timeout === 'undefined')
|
||||||
timeout = 10;
|
timeout = 10;
|
||||||
arduino.timer = +new Date();
|
arduino.timer = +new Date();
|
||||||
await delay(timeout);
|
await delay_1.delay(timeout);
|
||||||
arduino.end(serial, cmd);
|
arduino.end(serial, cmd);
|
||||||
return cb();
|
return cb();
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
130
lib/cmd/index.js
130
lib/cmd/index.js
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
class Commands {
|
class Commands {
|
||||||
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
constructor(cfg, proj, cam, light, cam2 = null, proj2 = null) {
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
|
@ -20,10 +20,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -38,10 +38,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj.move();
|
ms = await this.proj.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -59,14 +59,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -82,14 +82,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -107,14 +107,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -131,14 +131,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off); //make sure set to off
|
await this.light.set(off); //make sure set to off
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam.move();
|
ms = await this.cam.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -156,14 +156,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -181,14 +181,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.cam2.move();
|
ms = await this.cam2.move();
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -207,16 +207,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -245,16 +245,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -278,16 +278,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.cam.state.dir) {
|
if (!this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(true);
|
await this.cam.set(true);
|
||||||
}
|
}
|
||||||
if (this.cam2.state.dir) {
|
if (this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(false);
|
await this.cam2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.cam2.move];
|
both = [await this.cam.move, await this.cam2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -311,16 +311,16 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.cam.state.dir) {
|
if (this.cam.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam.set(false);
|
await this.cam.set(false);
|
||||||
}
|
}
|
||||||
if (!this.cam2.state.dir) {
|
if (!this.cam2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.cam2.set(true);
|
await this.cam2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(rgb);
|
await this.light.set(rgb);
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
if (this.cam && this.cam2 && this.cam.arduino.alias.camera === this.cam.arduino.alias.camera_second) {
|
||||||
ms = await this.cam.both();
|
ms = await this.cam.both();
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ class Commands {
|
||||||
both = [await this.cam.move, await this.proj2.move];
|
both = [await this.cam.move, await this.proj2.move];
|
||||||
ms = Math.max(...both);
|
ms = Math.max(...both);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.light.set(off);
|
await this.light.set(off);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -346,10 +346,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -361,10 +361,10 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
ms = await this.proj2.move();
|
ms = await this.proj2.move();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -377,14 +377,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
}
|
}
|
||||||
|
@ -405,14 +405,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -434,14 +434,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (!this.proj.state.dir) {
|
if (!this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(true);
|
await this.proj.set(true);
|
||||||
}
|
}
|
||||||
if (this.proj2.state.dir) {
|
if (this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(false);
|
await this.proj2.set(false);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
@ -463,14 +463,14 @@ class Commands {
|
||||||
let ms;
|
let ms;
|
||||||
try {
|
try {
|
||||||
if (this.proj.state.dir) {
|
if (this.proj.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj.set(false);
|
await this.proj.set(false);
|
||||||
}
|
}
|
||||||
if (!this.proj2.state.dir) {
|
if (!this.proj2.state.dir) {
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
await this.proj2.set(true);
|
await this.proj2.set(true);
|
||||||
}
|
}
|
||||||
await delay(this.cfg.arduino.serialDelay);
|
await delay_1.delay(this.cfg.arduino.serialDelay);
|
||||||
//run one projector without await?
|
//run one projector without await?
|
||||||
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
if (this.proj && this.proj2 && this.proj.arduino.alias.projector === this.proj.arduino.alias.projector_second) {
|
||||||
ms = await this.proj.both();
|
ms = await this.proj.both();
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,5 +11,5 @@ function delay(ms) {
|
||||||
return setTimeout(resolve, ms);
|
return setTimeout(resolve, ms);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
module.exports = delay;
|
module.exports.delay = delay;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
||||||
{"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,GAAG,KAAK,CAAC"}
|
{"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"}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
/**
|
/**
|
||||||
* class representing the device discovery features
|
* class representing the device discovery features
|
||||||
|
@ -55,7 +55,7 @@ class Devices {
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.warn(err, 'SERIAL', false, true);
|
this.log.warn(err, 'SERIAL', false, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
return this.all([]);
|
return this.all([]);
|
||||||
}
|
}
|
||||||
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
this.log.info(`Found ${devices.length} USB devices`, 'SERIAL', true, true);
|
||||||
|
@ -101,7 +101,7 @@ class Devices {
|
||||||
this.log.error('Error connecting', err);
|
this.log.error('Error connecting', err);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
await delay(2000);
|
await delay_1.delay(2000);
|
||||||
try {
|
try {
|
||||||
verifySuccess = await this.arduino.verify();
|
verifySuccess = await this.arduino.verify();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ class Devices {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
this.log.info(`Verified ${device} as mcopy device`, 'SERIAL', true, true);
|
||||||
await delay(1000);
|
await delay_1.delay(1000);
|
||||||
try {
|
try {
|
||||||
type = await this.arduino.distinguish();
|
type = await this.arduino.distinguish();
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Digital {
|
class Digital {
|
||||||
/**
|
/**
|
||||||
|
@ -78,13 +78,13 @@ class Digital {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
await this.display.show(this.state.frame);
|
await this.display.show(this.state.frame);
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
async end() {
|
async end() {
|
||||||
await delay(20);
|
await delay_1.delay(20);
|
||||||
this.display.hide();
|
this.display.hide();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,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,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,GAAG,GAAG,MA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,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,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"}
|
|
@ -2,7 +2,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const spawn = require("spawn");
|
const spawn = require("spawn");
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const { BrowserWindow } = require('electron');
|
const { BrowserWindow } = require('electron');
|
||||||
let wv;
|
let wv;
|
||||||
let cp;
|
let cp;
|
||||||
|
@ -41,7 +41,7 @@ class WebView {
|
||||||
async start() {
|
async start() {
|
||||||
await this.open();
|
await this.open();
|
||||||
await this.fullScreen();
|
await this.fullScreen();
|
||||||
await delay(300);
|
await delay_1.delay(300);
|
||||||
}
|
}
|
||||||
async fullScreen() {
|
async fullScreen() {
|
||||||
//this.digitalWindow.setFullScreen(true);
|
//this.digitalWindow.setFullScreen(true);
|
||||||
|
@ -90,7 +90,7 @@ function padded_frame(i) {
|
||||||
async function display_eog(src) {
|
async function display_eog(src) {
|
||||||
//timeout 3 eog --fullscreen ${src}
|
//timeout 3 eog --fullscreen ${src}
|
||||||
cp = spawn('eog', ['--fullscreen', src]);
|
cp = spawn('eog', ['--fullscreen', src]);
|
||||||
await delay(200);
|
await delay_1.delay(200);
|
||||||
}
|
}
|
||||||
function display_wv(src) {
|
function display_wv(src) {
|
||||||
wv.setImage(src);
|
wv.setImage(src);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAA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UAAU,KAAK;IACnB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,EAAE,CAAC,KAAK,EAAE,CAAA;KACV;SAAM;QACN,IAAI,EAAE;YAAE,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,OAAO;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;KACL,CAAA;AACF,CAAC,CAAA"}
|
|
@ -0,0 +1,15 @@
|
||||||
|
<a name="exec"></a>
|
||||||
|
|
||||||
|
## exec(cmd, arg, opts) ⇒ <code>Promise.<{stdout: string, stderr: stderr}></code>
|
||||||
|
Promisified child_process.exec
|
||||||
|
|
||||||
|
**Kind**: global function
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| cmd | | |
|
||||||
|
| arg | | |
|
||||||
|
| opts | | See child_process.exec node docs |
|
||||||
|
| opts.stdout | <code>stream.Writable</code> | If defined, child process stdout will be piped to it. |
|
||||||
|
| opts.stderr | <code>stream.Writable</code> | If defined, child process stderr will be piped to it. |
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
'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
|
|
@ -0,0 +1 @@
|
||||||
|
{"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"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "exec",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "<a name=\"exec\"></a>",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<a name="exit"></a>
|
||||||
|
|
||||||
|
## 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 | <code>string</code> | | Reason for exit |
|
||||||
|
| code | <code>integer</code> | <code>0</code> | process exit code, default 0 |
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
'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
|
|
@ -0,0 +1 @@
|
||||||
|
{"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"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "exit",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -0,0 +1,168 @@
|
||||||
|
'use strict';
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const path = __importStar(require("path"));
|
||||||
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
|
let system = {};
|
||||||
|
let TMPDIR;
|
||||||
|
function padded_frame(i) {
|
||||||
|
let len = (i + '').length;
|
||||||
|
let str = i + '';
|
||||||
|
for (let x = 0; x < 5 - len; x++) {
|
||||||
|
str = '0' + str;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
async function frame(state, light) {
|
||||||
|
let frame = state.frame;
|
||||||
|
let video = state.path;
|
||||||
|
let w = state.info.width;
|
||||||
|
let h = state.info.height;
|
||||||
|
let padded = padded_frame(frame);
|
||||||
|
let ext = 'tif';
|
||||||
|
let rgb = light.color;
|
||||||
|
let tmpoutput;
|
||||||
|
let cmd;
|
||||||
|
let output;
|
||||||
|
let cmd2;
|
||||||
|
let output2;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
rgb = rgb.map((e) => {
|
||||||
|
return parseInt(e);
|
||||||
|
});
|
||||||
|
tmpoutput = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
|
cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frame})',scale=${w}:${h}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`;
|
||||||
|
cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`;
|
||||||
|
//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 {
|
||||||
|
console.log(cmd);
|
||||||
|
output = await exec_1.exec(cmd);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (output && output.stdout)
|
||||||
|
console.log(`"${output.stdout}"`);
|
||||||
|
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
||||||
|
try {
|
||||||
|
console.log(cmd2);
|
||||||
|
output2 = await exec_1.exec(cmd2);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (output2 && output2.stdout)
|
||||||
|
console.log(`"${output2.stdout}"`);
|
||||||
|
}
|
||||||
|
async function frames(video, obj) {
|
||||||
|
let tmppath = TMPDIR;
|
||||||
|
let ext = 'tif';
|
||||||
|
let tmpoutput;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
|
||||||
|
try {
|
||||||
|
await fs_extra_1.mkdir(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
|
||||||
|
}
|
||||||
|
async function clear(frame) {
|
||||||
|
let padded = padded_frame(frame);
|
||||||
|
let ext = 'tif';
|
||||||
|
let tmppath;
|
||||||
|
let tmpoutput;
|
||||||
|
let cmd;
|
||||||
|
let fileExists;
|
||||||
|
if (system.platform !== 'nix') {
|
||||||
|
ext = 'png';
|
||||||
|
}
|
||||||
|
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||||
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (!fs_extra_1.exists)
|
||||||
|
return false;
|
||||||
|
try {
|
||||||
|
await fs_extra_1.unlink(tmppath);
|
||||||
|
console.log(`Cleared frame ${tmppath}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
async function clearAll() {
|
||||||
|
let tmppath = TMPDIR;
|
||||||
|
let files;
|
||||||
|
try {
|
||||||
|
files = await fs_extra_1.readdir(tmppath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (files) {
|
||||||
|
files.forEach(async (file, index) => {
|
||||||
|
try {
|
||||||
|
await fs_extra_1.unlink(path.join(tmppath, file));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function checkDir() {
|
||||||
|
let fileExists;
|
||||||
|
try {
|
||||||
|
fileExists = await fs_extra_1.exists(TMPDIR);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Error checking for tmp dir', err);
|
||||||
|
}
|
||||||
|
if (!fs_extra_1.exists) {
|
||||||
|
try {
|
||||||
|
await fs_extra_1.mkdir(TMPDIR);
|
||||||
|
console.log(`Created tmpdir ${TMPDIR}`);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Error creating tmp dir', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await clearAll();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = (sys) => {
|
||||||
|
system = sys;
|
||||||
|
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||||
|
checkDir();
|
||||||
|
return {
|
||||||
|
frames,
|
||||||
|
frame,
|
||||||
|
clear,
|
||||||
|
clearAll
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAGb,2CAA6B;AAC7B,uCAA0D;AAC1D,+BAA4B;AAI5B,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,MAAe,CAAC;AAEpB,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KAChB;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,KAAK,CAAE,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACvB,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAA;IACtB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;IACxB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,IAAI,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CA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AAC;KACjD;IAED,IAAI,CAAC,iBAAM,EAAE;QACZ,IAAI;YACH,MAAM,gBAAK,CAAC,MAAM,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;SACxC;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;SAC7C;KACD;IACD,IAAI;QACH,MAAM,QAAQ,EAAE,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,QAAQ,EAAE,CAAC;IAEX,OAAO;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,QAAQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "ffmpeg",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
'use strict';
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs_extra_1 = require("fs-extra");
|
||||||
|
const exec_1 = require("exec");
|
||||||
|
//const spawn = require('spawn');
|
||||||
|
//const exit = require('exit');
|
||||||
|
let system = {};
|
||||||
|
async function info(video) {
|
||||||
|
let cmd = `ffprobe -v quiet -print_format json -show_format -show_streams "${video}"`;
|
||||||
|
let fileExists;
|
||||||
|
let raw;
|
||||||
|
let json;
|
||||||
|
let vid;
|
||||||
|
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 && json.streams) {
|
||||||
|
vid = json.streams.find((stream) => {
|
||||||
|
if (stream.width && stream.height)
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (vid) {
|
||||||
|
json.width = vid.width;
|
||||||
|
json.height = vid.height;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
async function frames(video) {
|
||||||
|
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
console.dir(obj);
|
||||||
|
}
|
||||||
|
module.exports = (sys) => {
|
||||||
|
system = sys;
|
||||||
|
return {
|
||||||
|
info,
|
||||||
|
frames
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,uCAAkC;AAClC,+BAA4B;AAC5B,iCAAiC;AACjC,+BAA+B;AAE/B,IAAI,MAAM,GAAG,EAAE,CAAC;AAEhB,KAAK,UAAU,IAAI,CAAE,KAAc;IAClC,IAAI,GAAG,GAAG,mEAAmE,KAAK,GAAG,CAAA;IACrF,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GAAG,CAAC;IAER,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpB;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAA;KACZ;IAED,IAAI;QACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAA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AAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,GAAG,CAAE,GAAS;IACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "ffprobe",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const delay = require("delay");
|
const delay_1 = require("delay");
|
||||||
const Log = require("log");
|
const Log = require("log");
|
||||||
class Light {
|
class Light {
|
||||||
/**
|
/**
|
||||||
|
@ -62,14 +62,14 @@ class Light {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light command', err);
|
this.log.error('Error sending light command', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
try {
|
try {
|
||||||
this.arduino.string(this.id, str);
|
this.arduino.string(this.id, str);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
this.log.error('Error sending light string', err);
|
this.log.error('Error sending light string', err);
|
||||||
}
|
}
|
||||||
await delay(1);
|
await delay_1.delay(1);
|
||||||
await ms;
|
await ms;
|
||||||
return await this.end(rgb, id, ms);
|
return await this.end(rgb, id, ms);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/light/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,KAAK;IAYV;;QAEI;IACJ,YAAa,OAAiB,EAAE,GAAS,EAAE,EAAQ;QAd5C,UAAK,GAAS,EAAE,KAAK,EAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;QAOlC,YAAO,GAAa,IAAI,CAAC;QAEzB,OAAE,GAAY,OAAO,CAAC;QAM7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,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,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IAED;;QAEI;IACI,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED;;QAEI;IACI,KAAK,CAAC,QAAQ,CAAE,KAAW,E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O,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAA"}
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const os = require("os");
|
const os_1 = require("os");
|
||||||
const si = require("systeminformation");
|
const systeminformation_1 = require("systeminformation");
|
||||||
//private
|
//private
|
||||||
const exec = require('exec');
|
const exec_1 = require("exec");
|
||||||
/**
|
/**
|
||||||
* Evaluates system dependencies for digital
|
* Evaluates system dependencies for digital
|
||||||
* projector features by executing processes with
|
* projector features by executing processes with
|
||||||
|
@ -14,7 +14,7 @@ const exec = require('exec');
|
||||||
async function dependencies(platform) {
|
async function dependencies(platform) {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
try {
|
try {
|
||||||
await exec('ffmpeg -h');
|
await exec_1.exec('ffmpeg -h');
|
||||||
obj.ffmpeg = 'ffmpeg';
|
obj.ffmpeg = 'ffmpeg';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -24,7 +24,7 @@ async function dependencies(platform) {
|
||||||
//if linux
|
//if linux
|
||||||
if (platform === 'nix') {
|
if (platform === 'nix') {
|
||||||
try {
|
try {
|
||||||
await exec('eog -h');
|
await exec_1.exec('eog -h');
|
||||||
obj.eog = 'eog';
|
obj.eog = 'eog';
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -42,7 +42,7 @@ function displayMap(obj) {
|
||||||
return sm;
|
return sm;
|
||||||
}
|
}
|
||||||
async function displays() {
|
async function displays() {
|
||||||
const obj = await si.graphics();
|
const obj = await systeminformation_1.graphics();
|
||||||
const arr = obj.displays;
|
const arr = obj.displays;
|
||||||
return arr.map(displayMap);
|
return arr.map(displayMap);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,12 @@ async function system() {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
let platform;
|
let platform;
|
||||||
try {
|
try {
|
||||||
obj.tmp = os.tmpdir();
|
obj.tmp = os_1.tmpdir();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
obj.tmp = '/tmp';
|
obj.tmp = '/tmp';
|
||||||
}
|
}
|
||||||
platform = os.type();
|
platform = os_1.type();
|
||||||
if (platform === 'Darwin') {
|
if (platform === 'Darwin') {
|
||||||
obj.platform = 'osx';
|
obj.platform = 'osx';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yBAA0B;AAC1B,wCAAyC;AACzC,SAAS;AACT,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B;;;;;;IAMI;AAEJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IAEnB,IAAI;QACH,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,4CAA4C;QAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KACrD;IACD,UAAU;IACV,IAAI,QAAQ,KAAK,KAAK,EAAE;QACvB,IAAI;YACH,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC;SAChB;QAAC,OAAO,GAAG,EAAE;YACb,yCAAyC;YACzC,OAAO,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SAClD;KACD;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAE,GAAS;IAC7B,MAAM,EAAE,GAAG;QACV,KAAK,EAAG,GAAG,CAAC,WAAW;QACvB,MAAM,EAAG,GAAG,C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K,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,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@ -13,6 +13,15 @@
|
||||||
"electron": "*"
|
"electron": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/fs-extra": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-ndoMMbGyuToTy4qB6Lex/inR98nPiNHacsgMPvy+zqMLgSxbt8VtWpDArpGp69h1fEDQHn1KB+9DWD++wgbwYA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "11.10.4",
|
"version": "11.10.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.10.4.tgz",
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
"homepage": "https://github.com/sixteenmillimeter/mcopy#readme",
|
"homepage": "https://github.com/sixteenmillimeter/mcopy#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/electron": "^1.6.10",
|
"@types/electron": "^1.6.10",
|
||||||
|
"@types/fs-extra": "^7.0.0",
|
||||||
"@types/node": "^11.10.4",
|
"@types/node": "^11.10.4",
|
||||||
"@types/uuid": "^3.4.4",
|
"@types/uuid": "^3.4.4",
|
||||||
"jsdoc-to-markdown": "^4.0.1",
|
"jsdoc-to-markdown": "^4.0.1",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
//import Log = require('log');
|
//import Log = require('log');
|
||||||
import delay = require('delay');
|
import { delay } from 'delay';
|
||||||
|
|
||||||
const SerialPort = require('serialport')
|
const SerialPort = require('serialport')
|
||||||
const Readline = SerialPort.parsers.Readline
|
const Readline = SerialPort.parsers.Readline
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import Intval = require('intval');
|
import Intval = require('intval');
|
||||||
import Log = require('log');
|
import Log = require('log');
|
||||||
import delay = require('delay');
|
import { delay } from 'delay';
|
||||||
|
|
||||||
/** class representing camera functions **/
|
/** class representing camera functions **/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import delay = require('delay');
|
import { delay } from 'delay';
|
||||||
|
|
||||||
class Commands {
|
class Commands {
|
||||||
private proj : any;
|
private proj : any;
|
||||||
|
|
|
@ -14,4 +14,4 @@ function delay (ms : number) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = delay;
|
module.exports.delay = delay;
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import delay = require('delay');
|
import { delay } from 'delay';
|
||||||
import Log = require('log');
|
import Log = require('log');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
|
||||||
* @module digital
|
|
||||||
* For rendering and displaying single frames for film-out features.
|
|
||||||
**/
|
|
||||||
|
|
||||||
import delay = require('delay');
|
|
||||||
import Log = require('log');
|
import Log = require('log');
|
||||||
|
|
||||||
class Digital {
|
class Digital {
|
||||||
|
@ -138,4 +133,4 @@ class Digital {
|
||||||
|
|
||||||
module.exports = (display : any, ffmpeg : any, ffprobe : any, ui : any, light : any) => {
|
module.exports = (display : any, ffmpeg : any, ffprobe : any, ui : any, light : any) => {
|
||||||
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,10 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
import exec = require('exec');
|
|
||||||
import spawn = require('spawn');
|
import spawn = require('spawn');
|
||||||
import delay = require('delay');
|
|
||||||
|
import { delay } from 'delay';
|
||||||
|
import { exec } from 'exec';
|
||||||
|
|
||||||
const { BrowserWindow } = require('electron');
|
const { BrowserWindow } = require('electron');
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
'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 : string[]) {
|
||||||
|
let cmd : string = args[0]
|
||||||
|
let argz : string = null
|
||||||
|
let opts : any = 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 : Error, stdout : string, stderr: string) => 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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue