When devices are discovered, represent that in the UI.
This commit is contained in:
parent
2301f0aa43
commit
a84b1019f1
|
@ -202,21 +202,21 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="settings" class="screen">
|
<div id="settings" class="screen">
|
||||||
<h4>Devices</h4>
|
<h4>Devices</h4>
|
||||||
<select>
|
<select id="devices">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<button title="Refresh devices"><i class="fa fa-refresh"></i></button>
|
<button title="Refresh devices"><i class="fa fa-refresh"></i></button>
|
||||||
<h4>Projector</h4>
|
<h4>Projector</h4>
|
||||||
<select>
|
<select id="projector_device">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<h4>Camera</h4>
|
<h4>Camera</h4>
|
||||||
<select>
|
<select id="camera_device">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="intval" name="intval" placeholder="INTVAL3 URL"/>
|
<input type="text" id="intval" name="intval" placeholder="INTVAL3 URL"/>
|
||||||
<h4>Light</h4>
|
<h4>Light</h4>
|
||||||
<select>
|
<select id="light_device">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3059,7 +3059,7 @@ var { remote, ipcRenderer } = require('electron'),
|
||||||
mscript = require('./lib/mscript.js');
|
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
|
State shared by ALL interfaces
|
||||||
|
|
|
@ -8,9 +8,14 @@ devices.init = function () {
|
||||||
};
|
};
|
||||||
devices.listen = function () {
|
devices.listen = function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
let opt
|
||||||
ipcRenderer.on('ready', function (event, arg) {
|
ipcRenderer.on('ready', function (event, arg) {
|
||||||
//console.log(arg.camera);
|
opt = $('<option>')
|
||||||
//console.log(arg.projector);
|
opt.value = arg.camera
|
||||||
|
opt.text = arg.camera
|
||||||
|
$('#camera_device').empty()
|
||||||
|
$('#camera_device').append(opt)
|
||||||
|
console.dir(arg)
|
||||||
devices.ready();
|
devices.ready();
|
||||||
return event.returnValue = true;
|
return event.returnValue = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 })
|
mainWindow.webContents.send('ready', {camera: camera, projector: projector, light: light })
|
||||||
settings.update('camera', { arduino : camera })
|
settings.update('camera', { arduino : camera })
|
||||||
settings.update('projector', { arduino : projector })
|
settings.update('projector', { arduino : projector })
|
||||||
|
@ -414,7 +414,7 @@ var init = function () {
|
||||||
settings.restore()
|
settings.restore()
|
||||||
|
|
||||||
createWindow()
|
createWindow()
|
||||||
createMenu()
|
//createMenu()
|
||||||
log.init()
|
log.init()
|
||||||
light.init()
|
light.init()
|
||||||
proj.init()
|
proj.init()
|
||||||
|
|
Loading…
Reference in New Issue