Resolves #34. Added delay lib to renderer and added a magic delay before ending devices.ready(). Just works. Move on and don't question it.
This commit is contained in:
parent
4c0aa4220c
commit
fc2593c6ee
|
@ -2496,6 +2496,7 @@ const devices = require('./lib/ui/devices.js');
|
||||||
const filmout = require('./lib/ui/filmout.js');
|
const filmout = require('./lib/ui/filmout.js');
|
||||||
const mse = require('./lib/ui/mscript.js');
|
const mse = require('./lib/ui/mscript.js');
|
||||||
const Mscript = require('./lib/mscript');
|
const Mscript = require('./lib/mscript');
|
||||||
|
const { delay } = require('./lib/delay');
|
||||||
let log;
|
let log;
|
||||||
|
|
||||||
/******
|
/******
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
let devices;
|
let devices;
|
||||||
class Devices {
|
class Devices {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -15,18 +24,20 @@ class Devices {
|
||||||
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
||||||
}
|
}
|
||||||
ready(event, arg) {
|
ready(event, arg) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
//console.dir(arg)
|
//console.dir(arg)
|
||||||
let opt;
|
let opt;
|
||||||
let devs = [];
|
let devs = [];
|
||||||
let notify = 'Connected to ';
|
let notify = 'Connected to ';
|
||||||
let p;
|
let p;
|
||||||
|
//@ts-ignore
|
||||||
|
yield delay(1000);
|
||||||
try {
|
try {
|
||||||
gui.spinner(false);
|
gui.spinner(false);
|
||||||
gui.overlay(false);
|
gui.overlay(false);
|
||||||
console.log('got here');
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
log.error(err);
|
||||||
}
|
}
|
||||||
for (let i in arg) {
|
for (let i in arg) {
|
||||||
devs.push(arg[i].arduino);
|
devs.push(arg[i].arduino);
|
||||||
|
@ -85,6 +96,7 @@ class Devices {
|
||||||
cam.second.enable();
|
cam.second.enable();
|
||||||
}
|
}
|
||||||
return event.returnValue = true;
|
return event.returnValue = true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
profiles() {
|
profiles() {
|
||||||
const keys = Object.keys(cfg.profiles);
|
const keys = Object.keys(cfg.profiles);
|
||||||
|
|
|
@ -22,6 +22,7 @@ const devices = require('./lib/ui/devices.js');
|
||||||
const filmout = require('./lib/ui/filmout.js');
|
const filmout = require('./lib/ui/filmout.js');
|
||||||
const mse = require('./lib/ui/mscript.js');
|
const mse = require('./lib/ui/mscript.js');
|
||||||
const Mscript = require('./lib/mscript');
|
const Mscript = require('./lib/mscript');
|
||||||
|
const { delay } = require('./lib/delay');
|
||||||
let log;
|
let log;
|
||||||
|
|
||||||
/******
|
/******
|
||||||
|
|
|
@ -33,19 +33,20 @@ class Devices {
|
||||||
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
ready (event : any, arg : any) {
|
async ready (event : any, arg : any) {
|
||||||
//console.dir(arg)
|
//console.dir(arg)
|
||||||
let opt : any;
|
let opt : any;
|
||||||
let devs : any[] = [];
|
let devs : any[] = [];
|
||||||
let notify : string = 'Connected to ';
|
let notify : string = 'Connected to ';
|
||||||
let p : any;
|
let p : any;
|
||||||
|
//@ts-ignore
|
||||||
|
await delay(1000);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gui.spinner(false);
|
gui.spinner(false);
|
||||||
gui.overlay(false);
|
gui.overlay(false);
|
||||||
console.log('got here');
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
log.error(err);
|
||||||
}
|
}
|
||||||
for (let i in arg) {
|
for (let i in arg) {
|
||||||
devs.push(arg[i].arduino);
|
devs.push(arg[i].arduino);
|
||||||
|
|
Loading…
Reference in New Issue