mcopy/app/src/index.js

100 lines
2.0 KiB
JavaScript
Raw Normal View History

const mcopy = {};
mcopy.cfg = require('./data/cfg.json');
const { remote, ipcRenderer } = require('electron');
const dialog = require('electron').remote.dialog;
const notifier = require('node-notifier');
const fs = require('fs');
const uuid = require('uuid');
const moment = require('moment');
const humanizeDuration = require('humanize-duration');
const cfg = require('./data/cfg.json');
const gui = require('./lib/ui');
const light = require('./lib/ui/light.js');
const proj = require('./lib/ui/proj.js');
const cam = require('./lib/ui/cam.js');
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 mse = require('./lib/ui/mscript.js');
2018-06-17 03:19:58 +00:00
const Mscript = require('./lib/mscript');
let log;
2017-12-20 03:54:39 +00:00
2016-04-14 04:17:42 +00:00
/******
State shared by ALL interfaces
*******/
mcopy.state = {
version : '2.0.0', //use for file compatibility check
2016-04-14 04:17:42 +00:00
camera : {
pos : 0,
direction: true
},
projector : {
pos : 0,
direction: true
},
2019-03-20 22:37:00 +00:00
camera_second : {
pos : 0,
direction : true
},
projector_second : {
pos : 0,
direction : true
2019-03-21 19:13:48 +00:00
},
2016-04-14 04:17:42 +00:00
sequence : {
size : 24,
arr : ['CF', 'PF'],
light : ['255,255,255', ''],
2016-04-14 04:17:42 +00:00
pads: {
cam_forward: 'CF',
proj_forward : 'PF',
black_forward : 'BF',
cam_backward: 'CB',
proj_backward : 'PB',
black_backward : 'BB',
light_set : 'L'//,
/*
cam2_forward : 'C2F',
cam2_backward : 'C2B',
cams_forward : 'CCF',
cams_forward : 'CCB',
cam_forward_cam2_backward : 'CFCB',
cam_backward_cam2_forward : 'CBCF',
proj2_forward : 'P2F',
proj2_backward : 'P2B',
projs_forward : 'PPF',
projs_backward : 'PPB',
proj_forward_proj2_backward : 'PFPB',
proj_backward_proj2_forward : 'PBPF'
*/
2016-04-14 04:17:42 +00:00
}
}
};
//
2016-04-14 04:17:42 +00:00
async function init () {
'use strict';
log = await require('log')({})
nav.init();
gui.grid.init();
mse.mscript.init();
mse.console.init();
devices.init();
2016-04-13 04:06:19 +00:00
light.init();
proj.init();
2016-04-18 03:02:22 +00:00
cam.init();
2016-04-13 01:04:13 +00:00
};