When devices are discovered, represent that in the UI.

This commit is contained in:
mmcw-dev 2018-01-04 23:52:06 -05:00
parent 2301f0aa43
commit a84b1019f1
4 changed files with 14 additions and 9 deletions

View File

@ -202,21 +202,21 @@
</div>
<div id="settings" class="screen">
<h4>Devices</h4>
<select>
<select id="devices">
</select>
<button title="Refresh devices"><i class="fa fa-refresh"></i></button>
<h4>Projector</h4>
<select>
<select id="projector_device">
</select>
<h4>Camera</h4>
<select>
<select id="camera_device">
</select>
<input type="text" id="intval" name="intval" placeholder="INTVAL3 URL"/>
<h4>Light</h4>
<select>
<select id="light_device">
</select>
</div>

View File

@ -3059,7 +3059,7 @@ var { remote, ipcRenderer } = require('electron'),
mscript = require('./lib/mscript.js');
mcopy.cfg = JSON.parse(fs.readFileSync('./data/cfg.json'), 'utf8');
mcopy.cfg = require('./data/cfg.json')
/******
State shared by ALL interfaces

View File

@ -8,9 +8,14 @@ devices.init = function () {
};
devices.listen = function () {
'use strict';
let opt
ipcRenderer.on('ready', function (event, arg) {
//console.log(arg.camera);
//console.log(arg.projector);
opt = $('<option>')
opt.value = arg.camera
opt.text = arg.camera
$('#camera_device').empty()
$('#camera_device').append(opt)
console.dir(arg)
devices.ready();
return event.returnValue = true;
});

View File

@ -178,7 +178,7 @@ var distinguishDevices = function (devices) {
})
};
var devicesReady = function (camera, projector, light) {
var devicesReady = function (projector, camera, light) {
mainWindow.webContents.send('ready', {camera: camera, projector: projector, light: light })
settings.update('camera', { arduino : camera })
settings.update('projector', { arduino : projector })
@ -414,7 +414,7 @@ var init = function () {
settings.restore()
createWindow()
createMenu()
//createMenu()
log.init()
light.init()
proj.init()