'use strict';
let devices;
class Devices {
constructor() {
this.id = 'devices';
this.init();
}
init() {
this.listen();
this.profiles();
gui.overlay(true);
gui.spinner(true, 'Checking for connected devices...');
}
listen() {
ipcRenderer.on('ready', this.ready.bind(this));
ipcRenderer.on('intval', this.intvalCb.bind(this));
ipcRenderer.on('digital', this.digitalCb.bind(this));
}
ready(event, arg) {
//console.dir(arg)
let opt;
let devs = [];
let notify = 'Connected to ';
let p;
gui.spinner(false);
gui.overlay(false);
for (let i in arg) {
devs.push(arg[i].arduino);
if (arg[i].arduino && arg[i].arduino !== '/dev/fake') {
if (notify === 'Connected to ') {
notify += arg[i].arduino + ' ';
}
else {
notify += `& ${arg[i].arduino}`;
}
}
opt = $('