Device UI

This commit is contained in:
mmcwilliams 2019-02-08 14:28:57 -05:00
parent 0e618430ff
commit 30a070dca0
4 changed files with 50 additions and 10 deletions

View File

@ -260,6 +260,10 @@
<option>Not Set</option> <option>Not Set</option>
</select> </select>
</div> </div>
<div class="spacer">
<input type="text" id="digital" name="digital" placeholder="Digital file" onclick="devices.digitalSelect();" readonly />
<input type="radio" id="digital_type" name="digital_type" value="video" onclick="devices.digital();" />
</div>
<div> <div>
<h4>Camera</h4> <h4>Camera</h4>
<select id="camera_device"> <select id="camera_device">

View File

@ -5,7 +5,7 @@ const electron = require('electron');
const exec = require('exec'); const exec = require('exec');
//const spawn = require('spawn'); //const spawn = require('spawn');
const exit = require('exit'); //const exit = require('exit');
async function dependencies (platform) { async function dependencies (platform) {
let obj = {}; let obj = {};
@ -14,7 +14,8 @@ async function dependencies (platform) {
await exec('ffmpeg -h'); await exec('ffmpeg -h');
obj.ffmpeg = 'ffmpeg'; obj.ffmpeg = 'ffmpeg';
} catch (err) { } catch (err) {
return exit('ffmpeg is not installed', 3); //return exit('ffmpeg is not installed', 3);
return console.error('ffmpeg is not installed', err);
} }
//if linux //if linux
if (platform === 'nix') { if (platform === 'nix') {
@ -22,7 +23,8 @@ async function dependencies (platform) {
await exec('eog -h'); await exec('eog -h');
obj.eog = 'eog'; obj.eog = 'eog';
} catch (err) { } catch (err) {
return exit('eog is not installed', 4); //return exit('eog is not installed', 4);
return console.error('eog is not installed', err);
} }
} }

View File

@ -82,22 +82,56 @@ devices.ready = function (event, arg) {
devices.intval = function () { devices.intval = function () {
'use strict'; 'use strict';
const url = $('#intval').val() const url = $('#intval').val();
let proceed = false let proceed = false;
let obj = { let obj = {
connect: true, connect: true,
url : url url : url
} };
if ( url !== '' && typeof url !== 'undefined') { if ( url !== '' && typeof url !== 'undefined') {
proceed = confirm(`Are you sure you want to connect to INTVAL3 @ ${url}?`) proceed = confirm(`Are you sure you want to connect to INTVAL3 @ ${url}?`);
} else { } else {
alert('Cannot connect to INTVAL3 url as entered.') alert('Cannot connect to INTVAL3 url as entered.');
} }
if (proceed) { if (proceed) {
gui.overlay(true); gui.overlay(true);
gui.spinner(true, `Connecting to INTVAL3 @ ${url}`); gui.spinner(true, `Connecting to INTVAL3 @ ${url}`);
ipcRenderer.send('intval', obj) ipcRenderer.send('intval', obj);
} else {
$('#camera_type_arduino').prop('checked', 'checked');
$('#intval').removeClass('active');
}
};
devices.digitalSelect = function () {
const elem = $('#digital');
dialog.showOpenDialog({
properties: [
'openFile',
'openDirectory'
]
});
}
devices.digital = function () {
'use strict';
const elem = $('#digital');
let proceed = false;
let obj = {
connect: true,
url : url
};
if ( url !== '' && typeof url !== 'undefined') {
proceed = confirm(`Are you sure you want to`);
} else {
alert('Cannot connect')
}
if (proceed) {
//gui.overlay(true);
//gui.spinner(true, `Connecting to`);
ipcRenderer.send('video', obj)
} else { } else {
$('#camera_type_arduino').prop('checked', 'checked'); $('#camera_type_arduino').prop('checked', 'checked');
$('#intval').removeClass('active'); $('#intval').removeClass('active');

View File

@ -18,7 +18,7 @@ const ee = new events.EventEmitter()
//const digital = require('./lib/digital') //const digital = require('./lib/digital')
//const capture = require('./lib/capture')(ee) //const capture = require('./lib/capture')(ee)
const settings = require('settings') const settings = require('settings')
const system = require('system')
const Server = require('server') const Server = require('server')
const Intval = require('intval') const Intval = require('intval')