Update delay, exec and exit usage and require statments.

This commit is contained in:
mmcwilliams 2019-06-08 21:43:14 -04:00
parent a7c7715207
commit 6442d99817
90 changed files with 449 additions and 460 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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"}

View File

@ -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

View File

@ -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();
} }
/** /**

View File

@ -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,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACD;;QAEI;IACK,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAA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AAK,CAAC,CAAC;AACzD,CAAC,CAAA"}

View File

@ -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);

View File

@ -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;Y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L=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +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,IAA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tC,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"}

View File

@ -16,5 +16,5 @@ function exit(msg, code = 0) {
process.exit(code); process.exit(code);
} }
} }
module.exports = exit; module.exports.exit = exit;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +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,GAAG,IAAI,CAAC"} {"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"}

View File

@ -8,8 +8,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path")); const path = __importStar(require("path"));
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = require("exec");
let system = {}; let system = {};
let TMPDIR; let TMPDIR;
function padded_frame(i) { function padded_frame(i) {
@ -47,7 +47,7 @@ async function frame(state, light) {
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png" //-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
try { try {
console.log(cmd); console.log(cmd);
output = await exec(cmd); output = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -57,7 +57,7 @@ async function frame(state, light) {
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) { if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
try { try {
console.log(cmd2); console.log(cmd2);
output2 = await exec(cmd2); output2 = await exec_1.exec(cmd2);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -75,7 +75,7 @@ async function frames(video, obj) {
} }
tmpoutput = path.join(tmppath, `export-%05d.${ext}`); tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
try { try {
await fs.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -88,21 +88,21 @@ async function clear(frame) {
let tmppath; let tmppath;
let tmpoutput; let tmpoutput;
let cmd; let cmd;
let exists; let fileExists;
if (system.platform !== 'nix') { if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
} }
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`); tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
try { try {
exists = await fs.exists(tmppath); fileExists = await fs_extra_1.exists(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
} }
if (!exists) if (!fs_extra_1.exists)
return false; return false;
try { try {
await fs.unlink(tmppath); await fs_extra_1.unlink(tmppath);
console.log(`Cleared frame ${tmppath}`); console.log(`Cleared frame ${tmppath}`);
} }
catch (err) { catch (err) {
@ -114,7 +114,7 @@ async function clearAll() {
let tmppath = TMPDIR; let tmppath = TMPDIR;
let files; let files;
try { try {
files = await fs.readdir(tmppath); files = await fs_extra_1.readdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -122,7 +122,7 @@ async function clearAll() {
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) { catch (err) {
console.error(err); console.error(err);
@ -131,16 +131,16 @@ async function clearAll() {
} }
} }
async function checkDir() { async function checkDir() {
let exists; let fileExists;
try { try {
exists = await fs.exists(TMPDIR); fileExists = await fs_extra_1.exists(TMPDIR);
} }
catch (err) { catch (err) {
console.error('Error checking for tmp dir', err); console.error('Error checking for tmp dir', err);
} }
if (!exists) { if (!fs_extra_1.exists) {
try { try {
await fs.mkdir(TMPDIR); await fs_extra_1.mkdir(TMPDIR);
console.log(`Created tmpdir ${TMPDIR}`); console.log(`Created tmpdir ${TMPDIR}`);
} }
catch (err) { catch (err) {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["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;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"}

View File

@ -1,37 +1,30 @@
'use strict'; '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 }); Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = 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 exists; let fileExists;
let raw; let raw;
let json; let json;
let vid; let vid;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.exists(video);
} }
catch (err) { catch (err) {
return exit(err, 5); return exit(err, 5);
} }
if (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
//return exit(err, 7); //return exit(err, 7);
@ -58,25 +51,25 @@ async function info(video) {
} }
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 exists; let fileExists;
let raw; let raw;
let frames; let frames;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.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 (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAEb,6CAA+B;AAC/B,2CAA4B;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,MAAM,CAAC;IACX,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GA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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);
} }

View File

@ -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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E,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"}

View File

@ -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';
} }

View File

@ -1 +1 @@
{"version":3,"file":"index.js","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GAAG,MAAM,CAAC"}

View File

@ -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 = {}

View File

@ -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', () =>{

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"}

View File

@ -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

View File

@ -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();
} }
/** /**

View File

@ -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,MAA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I,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"}

View File

@ -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);

View File

@ -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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,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"}

View File

@ -40,5 +40,5 @@ async function exec(...args) {
} }
}); });
} }
module.exports = exec; module.exports.exec = exec;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +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,MAA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AQ,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"}

View File

@ -16,5 +16,5 @@ function exit(msg, code = 0) {
process.exit(code); process.exit(code);
} }
} }
module.exports = exit; module.exports.exit = exit;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +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,GAAG,IAAI,CAAC"} {"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"}

View File

@ -8,8 +8,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path")); const path = __importStar(require("path"));
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = require("exec");
let system = {}; let system = {};
let TMPDIR; let TMPDIR;
function padded_frame(i) { function padded_frame(i) {
@ -47,7 +47,7 @@ async function frame(state, light) {
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png" //-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
try { try {
console.log(cmd); console.log(cmd);
output = await exec(cmd); output = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -57,7 +57,7 @@ async function frame(state, light) {
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) { if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
try { try {
console.log(cmd2); console.log(cmd2);
output2 = await exec(cmd2); output2 = await exec_1.exec(cmd2);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -75,7 +75,7 @@ async function frames(video, obj) {
} }
tmpoutput = path.join(tmppath, `export-%05d.${ext}`); tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
try { try {
await fs.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -88,21 +88,21 @@ async function clear(frame) {
let tmppath; let tmppath;
let tmpoutput; let tmpoutput;
let cmd; let cmd;
let exists; let fileExists;
if (system.platform !== 'nix') { if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
} }
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`); tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
try { try {
exists = await fs.exists(tmppath); fileExists = await fs_extra_1.exists(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
} }
if (!exists) if (!fs_extra_1.exists)
return false; return false;
try { try {
await fs.unlink(tmppath); await fs_extra_1.unlink(tmppath);
console.log(`Cleared frame ${tmppath}`); console.log(`Cleared frame ${tmppath}`);
} }
catch (err) { catch (err) {
@ -114,7 +114,7 @@ async function clearAll() {
let tmppath = TMPDIR; let tmppath = TMPDIR;
let files; let files;
try { try {
files = await fs.readdir(tmppath); files = await fs_extra_1.readdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -122,7 +122,7 @@ async function clearAll() {
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) { catch (err) {
console.error(err); console.error(err);
@ -131,16 +131,16 @@ async function clearAll() {
} }
} }
async function checkDir() { async function checkDir() {
let exists; let fileExists;
try { try {
exists = await fs.exists(TMPDIR); fileExists = await fs_extra_1.exists(TMPDIR);
} }
catch (err) { catch (err) {
console.error('Error checking for tmp dir', err); console.error('Error checking for tmp dir', err);
} }
if (!exists) { if (!fs_extra_1.exists) {
try { try {
await fs.mkdir(TMPDIR); await fs_extra_1.mkdir(TMPDIR);
console.log(`Created tmpdir ${TMPDIR}`); console.log(`Created tmpdir ${TMPDIR}`);
} }
catch (err) { catch (err) {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAGb,2CAA6B;AAC7B,6CAA+B;AAC/B,2CAA6B;AAI7B,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,CAAA;IAChC,IAAI,GAAG,GAAG,KAAK,CAAA;IACf,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;IACtB,IAAI,SAAS,CAAC;IACd,IAAI,GAAG,CAAC;IACR,IAAI,MAAM,CAAC;IACX,IAAI,IAAI,CAAC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AU,QAAQ;IACtB,IAAI,UAAU,CAAC;IACf,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,MAAM,CAAC,CAAC;KAClC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;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"}

View File

@ -1,37 +1,30 @@
'use strict'; '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 }); Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = 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 exists; let fileExists;
let raw; let raw;
let json; let json;
let vid; let vid;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.exists(video);
} }
catch (err) { catch (err) {
return exit(err, 5); return exit(err, 5);
} }
if (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
//return exit(err, 7); //return exit(err, 7);
@ -58,25 +51,25 @@ async function info(video) {
} }
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 exists; let fileExists;
let raw; let raw;
let frames; let frames;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.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 (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAEb,6CAA+B;AAC/B,2CAA4B;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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"}

View File

@ -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);
} }

View File

@ -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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AAgB,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"}

View File

@ -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';
} }

View File

@ -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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AAG,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"}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"}

View File

@ -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

View File

@ -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();
} }
/** /**

View File

@ -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,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACD;;QAEI;IACK,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,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(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);

View File

@ -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,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I,OAAgB,CAAC;IAErB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,GAAG,GAAG,KAAK,CAAC;KACZ;IAED,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;IAEvD,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,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"}

View File

@ -40,5 +40,5 @@ async function exec(...args) {
} }
}); });
} }
module.exports = exec; module.exports.exec = exec;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRo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,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"}

View File

@ -16,5 +16,5 @@ function exit(msg, code = 0) {
process.exit(code); process.exit(code);
} }
} }
module.exports = exit; module.exports.exit = exit;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +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,GAAG,IAAI,CAAC"} {"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"}

View File

@ -8,8 +8,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path")); const path = __importStar(require("path"));
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = require("exec");
let system = {}; let system = {};
let TMPDIR; let TMPDIR;
function padded_frame(i) { function padded_frame(i) {
@ -47,7 +47,7 @@ async function frame(state, light) {
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png" //-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
try { try {
console.log(cmd); console.log(cmd);
output = await exec(cmd); output = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -57,7 +57,7 @@ async function frame(state, light) {
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) { if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
try { try {
console.log(cmd2); console.log(cmd2);
output2 = await exec(cmd2); output2 = await exec_1.exec(cmd2);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -75,7 +75,7 @@ async function frames(video, obj) {
} }
tmpoutput = path.join(tmppath, `export-%05d.${ext}`); tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
try { try {
await fs.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -88,21 +88,21 @@ async function clear(frame) {
let tmppath; let tmppath;
let tmpoutput; let tmpoutput;
let cmd; let cmd;
let exists; let fileExists;
if (system.platform !== 'nix') { if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
} }
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`); tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
try { try {
exists = await fs.exists(tmppath); fileExists = await fs_extra_1.exists(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
} }
if (!exists) if (!fs_extra_1.exists)
return false; return false;
try { try {
await fs.unlink(tmppath); await fs_extra_1.unlink(tmppath);
console.log(`Cleared frame ${tmppath}`); console.log(`Cleared frame ${tmppath}`);
} }
catch (err) { catch (err) {
@ -114,7 +114,7 @@ async function clearAll() {
let tmppath = TMPDIR; let tmppath = TMPDIR;
let files; let files;
try { try {
files = await fs.readdir(tmppath); files = await fs_extra_1.readdir(tmppath);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);
@ -122,7 +122,7 @@ async function clearAll() {
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) { catch (err) {
console.error(err); console.error(err);
@ -131,16 +131,16 @@ async function clearAll() {
} }
} }
async function checkDir() { async function checkDir() {
let exists; let fileExists;
try { try {
exists = await fs.exists(TMPDIR); fileExists = await fs_extra_1.exists(TMPDIR);
} }
catch (err) { catch (err) {
console.error('Error checking for tmp dir', err); console.error('Error checking for tmp dir', err);
} }
if (!exists) { if (!fs_extra_1.exists) {
try { try {
await fs.mkdir(TMPDIR); await fs_extra_1.mkdir(TMPDIR);
console.log(`Created tmpdir ${TMPDIR}`); console.log(`Created tmpdir ${TMPDIR}`);
} }
catch (err) { catch (err) {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAGb,2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AAC,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"}

View File

@ -1,37 +1,30 @@
'use strict'; '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 }); Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs-extra")); const fs_extra_1 = require("fs-extra");
const exec = __importStar(require("exec")); const exec_1 = 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 exists; let fileExists;
let raw; let raw;
let json; let json;
let vid; let vid;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.exists(video);
} }
catch (err) { catch (err) {
return exit(err, 5); return exit(err, 5);
} }
if (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
//return exit(err, 7); //return exit(err, 7);
@ -58,25 +51,25 @@ async function info(video) {
} }
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 exists; let fileExists;
let raw; let raw;
let frames; let frames;
try { try {
exists = await fs.exists(video); fileExists = await fs_extra_1.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 (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;
} }
try { try {
console.log(cmd); console.log(cmd);
raw = await exec(cmd); raw = await exec_1.exec(cmd);
} }
catch (err) { catch (err) {
console.error(err); console.error(err);

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAEb,6CAA+B;AAC/B,2CAA4B;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,MAAM,CAAC;IACX,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GAAG,CAAC;IAER,IAAI;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,K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E,KAAc;IACpC,IAAI,GAAG,GAAG,kIAAkI,KAAK,GAAG,CAAC;IACrJ,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,MAAM,CAAC;IAEX,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,sBAAsB;QACtB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAA;KACZ;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,OAAO,CAAC,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"}

View File

@ -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);
} }

View File

@ -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,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AG,UAAU,OAAiB,EAAE,GAAS,EAAE,EAAQ;IAChE,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAA"}

View File

@ -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';
} }

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,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"*"
} }
}, },
"@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",

View File

@ -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

View File

@ -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 **/

View File

@ -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;

View File

@ -14,4 +14,4 @@ function delay (ms : number) {
}); });
} }
module.exports = delay; module.exports.delay = delay;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import delay = require('delay'); import { delay } from 'delay';
import Log = require('log'); import Log = require('log');
/** /**

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import delay = require('delay'); import { delay } from 'delay';
import Log = require('log'); import Log = require('log');
class Digital { class Digital {

View File

@ -1,9 +1,10 @@
'use strict'; 'use strict';
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');

View File

@ -44,4 +44,4 @@ async function exec(...args : string[]) {
}); });
} }
module.exports = exec module.exports.exec = exec

View File

@ -18,4 +18,4 @@ function exit (msg : string, code : number = 0) {
} }
} }
module.exports = exit; module.exports.exit = exit;

View File

@ -2,10 +2,10 @@
import uuid from 'uuid/v4'; import uuid from 'uuid/v4';
import * as path from 'path'; import * as path from 'path';
import * as fs from 'fs-extra'; import { exists, mkdir, readdir, unlink } from 'fs-extra';
import * as exec from 'exec'; import { exec } from 'exec';
//const spawn = require('spawn'); //const spawn = require('spawn');
import * as exit from 'exit'; import { exit } from 'exit';
let system : any = {}; let system : any = {};
let TMPDIR : string; let TMPDIR : string;
@ -81,7 +81,7 @@ async function frames (video : string, obj : any) {
tmpoutput = path.join(tmppath, `export-%05d.${ext}`); tmpoutput = path.join(tmppath, `export-%05d.${ext}`);
try { try {
await fs.mkdir(tmppath); await mkdir(tmppath);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -95,7 +95,7 @@ async function clear (frame : number) {
let tmppath; let tmppath;
let tmpoutput; let tmpoutput;
let cmd; let cmd;
let exists; let fileExists;
if (system.platform !== 'nix') { if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
@ -104,7 +104,7 @@ async function clear (frame : number) {
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`); tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
try { try {
exists = await fs.exists(tmppath); fileExists = await exists(tmppath);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -112,7 +112,7 @@ async function clear (frame : number) {
if (!exists) return false; if (!exists) return false;
try { try {
await fs.unlink(tmppath); await unlink(tmppath);
console.log(`Cleared frame ${tmppath}`); console.log(`Cleared frame ${tmppath}`);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
@ -125,14 +125,14 @@ async function clearAll () {
let tmppath = TMPDIR; let tmppath = TMPDIR;
let files; let files;
try { try {
files = await fs.readdir(tmppath); files = await readdir(tmppath);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
if (files) { if (files) {
files.forEach(async (file : string, index : any) => { files.forEach(async (file : string, index : any) => {
try { try {
await fs.unlink(path.join(tmppath, file)); await unlink(path.join(tmppath, file));
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -141,16 +141,16 @@ async function clearAll () {
} }
async function checkDir () { async function checkDir () {
let exists; let fileExists;
try { try {
exists = await fs.exists(TMPDIR); fileExists = await exists(TMPDIR);
} catch (err) { } catch (err) {
console.error('Error checking for tmp dir', err); console.error('Error checking for tmp dir', err);
} }
if (!exists) { if (!exists) {
try { try {
await fs.mkdir(TMPDIR); await 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);

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import * as fs from 'fs-extra'; import { exists } from 'fs-extra';
import * as exec from'exec'; import { exec } from 'exec';
//const spawn = require('spawn'); //const spawn = require('spawn');
//const exit = require('exit'); //const exit = require('exit');
@ -9,17 +9,17 @@ let system = {};
async function info (video : string) { async function info (video : string) {
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 exists; let fileExists;
let raw; let raw;
let json; let json;
let vid; let vid;
try { try {
exists = await fs.exists(video); fileExists = await exists(video);
} catch (err) { } catch (err) {
return exit(err, 5); return exit(err, 5);
} }
if (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false return false
@ -56,18 +56,18 @@ async function info (video : string) {
async function frames (video : string) { async function frames (video : string) {
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 exists; let fileExists;
let raw; let raw;
let frames; let frames;
try { try {
exists = await fs.exists(video); fileExists = await 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 (!exists) { if (!fileExists) {
//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(new Error(`File ${video} does not exist`));
return false; return false;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import delay = require('delay'); import { delay } from 'delay';
import Log = require('log'); import Log = require('log');
class Light { class Light {

View File

@ -1,9 +1,9 @@
'use strict'; 'use strict';
import os = require('os'); import { tmpdir, type } from 'os';
import si = require('systeminformation'); import { graphics } from 'systeminformation';
//private //private
const exec = require('exec'); import { exec } from 'exec';
/** /**
* Evaluates system dependencies for digital * Evaluates system dependencies for digital
* projector features by executing processes with * projector features by executing processes with
@ -45,7 +45,7 @@ function displayMap (obj : any) {
} }
async function displays () { async function displays () {
const obj : any = await si.graphics() const obj : any = await graphics()
const arr : any[] = obj.displays; const arr : any[] = obj.displays;
return arr.map(displayMap); return arr.map(displayMap);
} }
@ -62,12 +62,12 @@ async function system () {
let platform : string; let platform : string;
try { try {
obj.tmp = os.tmpdir(); obj.tmp = tmpdir();
} catch (err) { } catch (err) {
obj.tmp = '/tmp' obj.tmp = '/tmp'
} }
platform = os.type(); platform = type();
if (platform === 'Darwin') { if (platform === 'Darwin') {
obj.platform = 'osx'; obj.platform = 'osx';