From 23d663c3e70ce98969d51021c55ccd09618b90da Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Tue, 18 Jun 2019 15:19:57 -0400 Subject: [PATCH] Create digital.ts and devices.ts. Begin rewriting devices as-is and then refactor the existing digital features into digital.ts. Gonna rename, screw it. --- app/lib/ui/digital.js | 3 + app/src/index.js | 1 + app/src/lib/ui/devices.ts | 265 ++++++++++++++++++++++++++++++++++++++ app/src/lib/ui/digital.ts | 17 +++ 4 files changed, 286 insertions(+) create mode 100644 app/lib/ui/digital.js create mode 100644 app/src/lib/ui/devices.ts create mode 100644 app/src/lib/ui/digital.ts diff --git a/app/lib/ui/digital.js b/app/lib/ui/digital.js new file mode 100644 index 0000000..aedbb2a --- /dev/null +++ b/app/lib/ui/digital.js @@ -0,0 +1,3 @@ +'use strict'; +let digital; +module.exports = digital; diff --git a/app/src/index.js b/app/src/index.js index 3bddf93..9105c22 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -18,6 +18,7 @@ const nav = require('./lib/ui/nav.js'); const seq = require('./lib/ui/seq.js'); const cmd = require('./lib/ui/cmd.js'); const devices = require('./lib/ui/devices.js'); +const digital = require('./lib/ui/digital.js'); const mse = require('./lib/ui/mscript.js'); const Mscript = require('./lib/mscript'); let log; diff --git a/app/src/lib/ui/devices.ts b/app/src/lib/ui/devices.ts new file mode 100644 index 0000000..feba637 --- /dev/null +++ b/app/src/lib/ui/devices.ts @@ -0,0 +1,265 @@ +'use strict'; + +/// + +declare var gui : any; +declare var seq : any; +declare var light : any; +declare var cfg : any; +declare var log : any; +declare var w2popup : any; +declare var cam : any; +declare var proj : any; + +const devices = {}; + +devices.init = function () { + 'use strict'; + devices.listen(); + devices.profiles(); + gui.overlay(true); + gui.spinner(true, 'Checking for connected devices...'); +}; +devices.profiles = function () { + 'use strict'; + const keys = Object.keys(cfg.profiles); + const elem = $('#profile') + let opt; + elem.empty(); + for (let key of keys) { + opt = $('