Took a tiny detour on the film out feature, or "digital projector". This now avoids showing a browser window fullscreen on mac, which is having performance issues when opening and then running sequences. There is a major source of lag, seemingly coming from the camera? Need to test with fake projector to see if there's a problem with the arduino lib.
This commit is contained in:
parent
97f1464106
commit
742adccf34
|
@ -96,6 +96,7 @@ class Camera {
|
|||
}
|
||||
}
|
||||
if (this.dig.state.enabled) {
|
||||
//await delay(100 * 1000);
|
||||
await this.dig.end();
|
||||
}
|
||||
this.log.info('Camera move time', { ms });
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -77,7 +77,7 @@ class Digital {
|
|||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
this.display.start(this.state.frame);
|
||||
await this.display.show(this.state.frame);
|
||||
await delay(20);
|
||||
}
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ class Digital {
|
|||
**/
|
||||
async end() {
|
||||
await delay(20);
|
||||
this.display.end();
|
||||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,I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IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"}
|
|
@ -7,13 +7,11 @@ const { BrowserWindow } = require('electron');
|
|||
let wv;
|
||||
let cp;
|
||||
let system = {};
|
||||
let digitalWindow;
|
||||
let TMPDIR;
|
||||
class WebView {
|
||||
constructor() {
|
||||
}
|
||||
async open() {
|
||||
digitalWindow = new BrowserWindow({
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: false,
|
||||
|
@ -25,30 +23,58 @@ class WebView {
|
|||
minHeight: 600 //,
|
||||
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
||||
});
|
||||
digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
this.digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
if (process.argv.indexOf('-d') !== -1 || process.argv.indexOf('--dev') !== -1) {
|
||||
digitalWindow.webContents.openDevTools();
|
||||
this.digitalWindow.webContents.openDevTools();
|
||||
}
|
||||
digitalWindow.on('closed', () => {
|
||||
digitalWindow = null;
|
||||
this.digitalWindow.on('closed', () => {
|
||||
this.digitalWindow = null;
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
this.showing = true;
|
||||
this.opened = true;
|
||||
}
|
||||
async start() {
|
||||
await this.open();
|
||||
await this.fullScreen();
|
||||
await delay(300);
|
||||
}
|
||||
async fullScreen() {
|
||||
return digitalWindow.setFullScreen(true);
|
||||
//this.digitalWindow.setFullScreen(true);
|
||||
await this.digitalWindow.maximize();
|
||||
}
|
||||
async setImage(src) {
|
||||
return digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
async setMeter() {
|
||||
return digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
async setGrid() {
|
||||
return digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
async close() {
|
||||
if (digitalWindow) {
|
||||
digitalWindow.close();
|
||||
setImage(src) {
|
||||
console.log(src);
|
||||
//console.dir(digitalWindow)
|
||||
try {
|
||||
this.digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
setMeter() {
|
||||
this.digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
setGrid() {
|
||||
this.digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
hide() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
this.showing = false;
|
||||
}
|
||||
close() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.close();
|
||||
this.digitalWindow = null;
|
||||
}
|
||||
this.showing = false;
|
||||
this.opened = false;
|
||||
return true;
|
||||
}
|
||||
async move() {
|
||||
|
@ -65,23 +91,21 @@ function padded_frame(i) {
|
|||
async function display_eog(src) {
|
||||
//timeout 3 eog --fullscreen ${src}
|
||||
cp = spawn('eog', ['--fullscreen', src]);
|
||||
}
|
||||
async function display_wv(src) {
|
||||
await wv.open();
|
||||
await wv.fullScreen();
|
||||
await delay(200);
|
||||
await wv.setImage(src);
|
||||
}
|
||||
async function end() {
|
||||
function display_wv(src) {
|
||||
wv.setImage(src);
|
||||
}
|
||||
async function hide() {
|
||||
if (system.platform !== 'nix') {
|
||||
await wv.close();
|
||||
//wv.hide();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
async function start(frame) {
|
||||
async function show(frame) {
|
||||
let padded = padded_frame(frame);
|
||||
let ext = 'tif';
|
||||
let tmppath;
|
||||
|
@ -90,24 +114,41 @@ async function start(frame) {
|
|||
}
|
||||
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||
if (system.platform !== 'nix') {
|
||||
await open();
|
||||
display_wv(tmppath);
|
||||
}
|
||||
else {
|
||||
display_eog(tmppath);
|
||||
await display_eog(tmppath);
|
||||
}
|
||||
}
|
||||
async function open() {
|
||||
if (system.platform !== 'nix') {
|
||||
if (!wv || !wv.opened) {
|
||||
wv = new WebView();
|
||||
await wv.start();
|
||||
}
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
}
|
||||
async function close() {
|
||||
if (system.platform !== 'nix') {
|
||||
wv.close();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
module.exports = function (sys) {
|
||||
system = sys;
|
||||
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||
if (system.platform !== 'nix') {
|
||||
wv = new WebView();
|
||||
}
|
||||
else {
|
||||
//child process
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end
|
||||
open,
|
||||
show,
|
||||
hide,
|
||||
close
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,6BAA8B;AAE9B,+BAAgC;AAChC,+BAAgC;AAEhC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,IAAI,EAAQ,CAAC;AACb,IAAI,EAAQ,CAAC;AACb,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,aAAmB,CAAC;AAExB,IAAI,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AC,KAAK,EAAE,CAAA;KACV;SAAM;QACN,IAAI,EAAE;YAAE,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,OAAO;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;KACL,CAAA;AACF,CAAC,CAAA"}
|
|
@ -235,6 +235,7 @@ seq.exec = function (arr) {
|
|||
gui.overlay(true);
|
||||
gui.spinner(true, `Running sequence of ${arr.length} frame${(arr.length === 1 ? '' : 's')}`, 0, true);
|
||||
log.info(`Sequence started`, 'SEQUENCE', true);
|
||||
ipcRenderer.send('seq', { action : 'start' });
|
||||
seq.step();
|
||||
};
|
||||
|
||||
|
|
|
@ -75,7 +75,9 @@ seq.init = function () {
|
|||
seq.listen = function () {
|
||||
ipcMain.on('seq', async (evt, arg) => {
|
||||
if (arg.action === 'stop' && proj.digital) {
|
||||
display.end()
|
||||
display.close()
|
||||
} else if (arg.action === 'start' && proj.digital) {
|
||||
display.open()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ class Camera {
|
|||
}
|
||||
}
|
||||
if (this.dig.state.enabled) {
|
||||
//await delay(100 * 1000);
|
||||
await this.dig.end();
|
||||
}
|
||||
this.log.info('Camera move time', { ms });
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -77,7 +77,7 @@ class Digital {
|
|||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
this.display.start(this.state.frame);
|
||||
await this.display.show(this.state.frame);
|
||||
await delay(20);
|
||||
}
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ class Digital {
|
|||
**/
|
||||
async end() {
|
||||
await delay(20);
|
||||
this.display.end();
|
||||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACD;;QAEI;IACK,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;IACF;;QAEI;IACG,GAAG,CAAE,GAAa;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IACtB,CAAC;IACD;;QAEI;IACG,K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KAAK,EAAE,CAAC,CAAC;YACjD,OAAO,KAAK,CAAC;SACb;QAED,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"}
|
|
@ -7,13 +7,11 @@ const { BrowserWindow } = require('electron');
|
|||
let wv;
|
||||
let cp;
|
||||
let system = {};
|
||||
let digitalWindow;
|
||||
let TMPDIR;
|
||||
class WebView {
|
||||
constructor() {
|
||||
}
|
||||
async open() {
|
||||
digitalWindow = new BrowserWindow({
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: false,
|
||||
|
@ -25,30 +23,58 @@ class WebView {
|
|||
minHeight: 600 //,
|
||||
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
||||
});
|
||||
digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
this.digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
if (process.argv.indexOf('-d') !== -1 || process.argv.indexOf('--dev') !== -1) {
|
||||
digitalWindow.webContents.openDevTools();
|
||||
this.digitalWindow.webContents.openDevTools();
|
||||
}
|
||||
digitalWindow.on('closed', () => {
|
||||
digitalWindow = null;
|
||||
this.digitalWindow.on('closed', () => {
|
||||
this.digitalWindow = null;
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
this.showing = true;
|
||||
this.opened = true;
|
||||
}
|
||||
async start() {
|
||||
await this.open();
|
||||
await this.fullScreen();
|
||||
await delay(300);
|
||||
}
|
||||
async fullScreen() {
|
||||
return digitalWindow.setFullScreen(true);
|
||||
//this.digitalWindow.setFullScreen(true);
|
||||
await this.digitalWindow.maximize();
|
||||
}
|
||||
async setImage(src) {
|
||||
return digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
async setMeter() {
|
||||
return digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
async setGrid() {
|
||||
return digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
async close() {
|
||||
if (digitalWindow) {
|
||||
digitalWindow.close();
|
||||
setImage(src) {
|
||||
console.log(src);
|
||||
//console.dir(digitalWindow)
|
||||
try {
|
||||
this.digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
setMeter() {
|
||||
this.digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
setGrid() {
|
||||
this.digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
hide() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
this.showing = false;
|
||||
}
|
||||
close() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.close();
|
||||
this.digitalWindow = null;
|
||||
}
|
||||
this.showing = false;
|
||||
this.opened = false;
|
||||
return true;
|
||||
}
|
||||
async move() {
|
||||
|
@ -65,23 +91,21 @@ function padded_frame(i) {
|
|||
async function display_eog(src) {
|
||||
//timeout 3 eog --fullscreen ${src}
|
||||
cp = spawn('eog', ['--fullscreen', src]);
|
||||
}
|
||||
async function display_wv(src) {
|
||||
await wv.open();
|
||||
await wv.fullScreen();
|
||||
await delay(200);
|
||||
await wv.setImage(src);
|
||||
}
|
||||
async function end() {
|
||||
function display_wv(src) {
|
||||
wv.setImage(src);
|
||||
}
|
||||
async function hide() {
|
||||
if (system.platform !== 'nix') {
|
||||
await wv.close();
|
||||
//wv.hide();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
async function start(frame) {
|
||||
async function show(frame) {
|
||||
let padded = padded_frame(frame);
|
||||
let ext = 'tif';
|
||||
let tmppath;
|
||||
|
@ -90,24 +114,41 @@ async function start(frame) {
|
|||
}
|
||||
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||
if (system.platform !== 'nix') {
|
||||
await open();
|
||||
display_wv(tmppath);
|
||||
}
|
||||
else {
|
||||
display_eog(tmppath);
|
||||
await display_eog(tmppath);
|
||||
}
|
||||
}
|
||||
async function open() {
|
||||
if (system.platform !== 'nix') {
|
||||
if (!wv || !wv.opened) {
|
||||
wv = new WebView();
|
||||
await wv.start();
|
||||
}
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
}
|
||||
async function close() {
|
||||
if (system.platform !== 'nix') {
|
||||
wv.close();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
module.exports = function (sys) {
|
||||
system = sys;
|
||||
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||
if (system.platform !== 'nix') {
|
||||
wv = new WebView();
|
||||
}
|
||||
else {
|
||||
//child process
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end
|
||||
open,
|
||||
show,
|
||||
hide,
|
||||
close
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,6BAA8B;AAE9B,+BAAgC;AAChC,+BAAgC;AAEhC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,IAAI,EAAQ,CAAC;AACb,IAAI,EAAQ,CAAC;AACb,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,aAAmB,CAAC;AAExB,IAAI,MAAY,CAAC;AAEjB,MAAM,OAAO;IACZ;IAEA,CAAC;IACD,KAAK,CAAC,IAAI;QACT,aAAa,GAAG,IAAI,aAAa,CAAC;YACjC,cAAc,EAAE;gBACV,eAAe,EAAE,IAAI;gBACrB,2BAA2B,EAAE,KAAK;gBAClC,aAAa,EAAG,KAAK;aACvB;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,QAAQ,EAAG,GAAG;YACd,SAAS,EAAG,GAAG,CAAA,GAAG;YAClB,2DAA2D;SAC3D,CAAC,CAAC;QACH,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,uBAAuB,CAAC,CAAC;QACvE,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9E,aAAa,CAA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Z;IAED,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;IAEvD,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,MAAM,IAAI,EAAE,CAAA;QACZ,UAAU,CAAC,OAAO,CAAC,CAAC;KACpB;SAAM;QACN,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3B;AACF,CAAC;AAED,KAAK,UAAU,IAAI;IAClB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;YACnB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;SACnB;KACJ;SAAM;QACN,EAAE;KACF;AACF,CAAC;AAED,KAAK,UAAU,KAAK;IACnB,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9B,EAAE,CAAC,KAAK,EAAE,CAAA;KACV;SAAM;QACN,IAAI,EAAE;YAAE,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEhD,OAAO;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;KACL,CAAA;AACF,CAAC,CAAA"}
|
|
@ -96,6 +96,7 @@ class Camera {
|
|||
}
|
||||
}
|
||||
if (this.dig.state.enabled) {
|
||||
//await delay(100 * 1000);
|
||||
await this.dig.end();
|
||||
}
|
||||
this.log.info('Camera move time', { ms });
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -77,7 +77,7 @@ class Digital {
|
|||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
this.display.start(this.state.frame);
|
||||
await this.display.show(this.state.frame);
|
||||
await delay(20);
|
||||
}
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ class Digital {
|
|||
**/
|
||||
async end() {
|
||||
await delay(20);
|
||||
this.display.end();
|
||||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+BAAgC;AAChC,2BAA4B;AAE5B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACD;;QAEI;IACK,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,I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AACzD,CAAC,CAAA"}
|
|
@ -7,13 +7,11 @@ const { BrowserWindow } = require('electron');
|
|||
let wv;
|
||||
let cp;
|
||||
let system = {};
|
||||
let digitalWindow;
|
||||
let TMPDIR;
|
||||
class WebView {
|
||||
constructor() {
|
||||
}
|
||||
async open() {
|
||||
digitalWindow = new BrowserWindow({
|
||||
this.showing = false;
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: false,
|
||||
|
@ -25,30 +23,58 @@ class WebView {
|
|||
minHeight: 600 //,
|
||||
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
||||
});
|
||||
digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
this.digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
if (process.argv.indexOf('-d') !== -1 || process.argv.indexOf('--dev') !== -1) {
|
||||
digitalWindow.webContents.openDevTools();
|
||||
this.digitalWindow.webContents.openDevTools();
|
||||
}
|
||||
digitalWindow.on('closed', () => {
|
||||
digitalWindow = null;
|
||||
this.digitalWindow.on('closed', () => {
|
||||
this.digitalWindow = null;
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
async open() {
|
||||
this.digitalWindow.show();
|
||||
this.showing = true;
|
||||
this.opened = true;
|
||||
}
|
||||
async start() {
|
||||
await this.open();
|
||||
await this.fullScreen();
|
||||
await delay(300);
|
||||
}
|
||||
async fullScreen() {
|
||||
return digitalWindow.setFullScreen(true);
|
||||
//this.digitalWindow.setFullScreen(true);
|
||||
await this.digitalWindow.maximize();
|
||||
}
|
||||
async setImage(src) {
|
||||
return digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
async setMeter() {
|
||||
return digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
async setGrid() {
|
||||
return digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
async close() {
|
||||
if (digitalWindow) {
|
||||
digitalWindow.close();
|
||||
setImage(src) {
|
||||
console.log(src);
|
||||
//console.dir(digitalWindow)
|
||||
try {
|
||||
this.digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
setMeter() {
|
||||
this.digitalWindow.webContents.send('display', { meter: true });
|
||||
}
|
||||
setGrid() {
|
||||
this.digitalWindow.webContents.send('display', { grid: true });
|
||||
}
|
||||
hide() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
this.showing = false;
|
||||
}
|
||||
close() {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.close();
|
||||
this.digitalWindow = null;
|
||||
}
|
||||
this.showing = false;
|
||||
this.opened = false;
|
||||
return true;
|
||||
}
|
||||
async move() {
|
||||
|
@ -65,23 +91,21 @@ function padded_frame(i) {
|
|||
async function display_eog(src) {
|
||||
//timeout 3 eog --fullscreen ${src}
|
||||
cp = spawn('eog', ['--fullscreen', src]);
|
||||
}
|
||||
async function display_wv(src) {
|
||||
await wv.open();
|
||||
await wv.fullScreen();
|
||||
await delay(200);
|
||||
await wv.setImage(src);
|
||||
}
|
||||
async function end() {
|
||||
function display_wv(src) {
|
||||
wv.setImage(src);
|
||||
}
|
||||
async function hide() {
|
||||
if (system.platform !== 'nix') {
|
||||
await wv.close();
|
||||
//wv.hide();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
async function start(frame) {
|
||||
async function show(frame) {
|
||||
let padded = padded_frame(frame);
|
||||
let ext = 'tif';
|
||||
let tmppath;
|
||||
|
@ -90,24 +114,41 @@ async function start(frame) {
|
|||
}
|
||||
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||
if (system.platform !== 'nix') {
|
||||
await open();
|
||||
display_wv(tmppath);
|
||||
}
|
||||
else {
|
||||
display_eog(tmppath);
|
||||
await display_eog(tmppath);
|
||||
}
|
||||
}
|
||||
async function open() {
|
||||
if (system.platform !== 'nix') {
|
||||
if (!wv || !wv.opened) {
|
||||
wv = new WebView();
|
||||
await wv.start();
|
||||
}
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
}
|
||||
async function close() {
|
||||
if (system.platform !== 'nix') {
|
||||
wv.close();
|
||||
}
|
||||
else {
|
||||
if (cp)
|
||||
cp.kill();
|
||||
}
|
||||
}
|
||||
module.exports = function (sys) {
|
||||
system = sys;
|
||||
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||
if (system.platform !== 'nix') {
|
||||
wv = new WebView();
|
||||
}
|
||||
else {
|
||||
//child process
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end
|
||||
open,
|
||||
show,
|
||||
hide,
|
||||
close
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,6BAA8B;AAE9B,+BAAgC;AAChC,+BAAgC;AAEhC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,IAAI,EAAQ,CAAC;AACb,IAAI,EAAQ,CAAC;AACb,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,aAAmB,CAAC;AAExB,IAAI,MAAY,CAAC;AAEjB,MAAM,OAAO;IACZ;IAEA,CAAC;IACD,KAAK,CAAC,IAAI;QACT,aAAa,GAAG,IAAI,aAAa,CAAC;YACjC,cAAc,EAAE;gBACV,eAAe,EAAE,IAAI;gBACrB,2BAA2B,EAAE,KAAK;gBAClC,aAAa,EAAG,KAAK;aACvB;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,QAAQ,EAAG,GAAG;YACd,SAAS,EAAG,GAAG,CAAA,GAAG;YAClB,2DAA2D;SAC3D,CAAC,CAAC;QACH,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,uBA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dig.state.enabled) {
|
||||
await this.dig.end()
|
||||
//await delay(100 * 1000);
|
||||
await this.dig.end();
|
||||
}
|
||||
this.log.info('Camera move time', { ms });
|
||||
return this.end(cmd, id, ms);
|
||||
|
|
|
@ -83,8 +83,7 @@ class Digital {
|
|||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
this.display.start(this.state.frame);
|
||||
await this.display.show(this.state.frame);
|
||||
await delay(20);
|
||||
}
|
||||
/**
|
||||
|
@ -92,7 +91,7 @@ class Digital {
|
|||
**/
|
||||
private async end () {
|
||||
await delay(20);
|
||||
this.display.end();
|
||||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
|
|
|
@ -10,16 +10,15 @@ const { BrowserWindow } = require('electron');
|
|||
let wv : any;
|
||||
let cp : any;
|
||||
let system : any = {};
|
||||
let digitalWindow : any;
|
||||
|
||||
let TMPDIR : any;
|
||||
|
||||
class WebView {
|
||||
private digitalWindow : any;
|
||||
public opened : boolean : false;
|
||||
public showing : boolean = false;
|
||||
constructor() {
|
||||
|
||||
}
|
||||
async open () {
|
||||
digitalWindow = new BrowserWindow({
|
||||
this.digitalWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: false,
|
||||
|
@ -31,30 +30,56 @@ class WebView {
|
|||
minHeight : 600//,
|
||||
//icon: path.join(__dirname, '../../assets/icons/icon.png')
|
||||
});
|
||||
digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
this.digitalWindow.loadURL('file://' + __dirname + '../../../display.html');
|
||||
if (process.argv.indexOf('-d') !== -1 || process.argv.indexOf('--dev') !== -1) {
|
||||
digitalWindow.webContents.openDevTools();
|
||||
this.digitalWindow.webContents.openDevTools();
|
||||
}
|
||||
digitalWindow.on('closed', () => {
|
||||
digitalWindow = null
|
||||
this.digitalWindow.on('closed', () => {
|
||||
this.digitalWindow = null
|
||||
});
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
async open () {
|
||||
this.digitalWindow.show();
|
||||
this.showing = true;
|
||||
this.opened = true;
|
||||
}
|
||||
async start () {
|
||||
await this.open();
|
||||
await this.fullScreen();
|
||||
await delay(300);
|
||||
}
|
||||
async fullScreen () {
|
||||
return digitalWindow.setFullScreen(true);
|
||||
//this.digitalWindow.setFullScreen(true);
|
||||
await this.digitalWindow.maximize();
|
||||
}
|
||||
async setImage (src : string) {
|
||||
return digitalWindow.webContents.send('display', { src });
|
||||
}
|
||||
async setMeter () {
|
||||
return digitalWindow.webContents.send('display', { meter : true });
|
||||
}
|
||||
async setGrid () {
|
||||
return digitalWindow.webContents.send('display', { grid : true });
|
||||
}
|
||||
async close () {
|
||||
if (digitalWindow) {
|
||||
digitalWindow.close();
|
||||
setImage (src : string) {
|
||||
try {
|
||||
this.digitalWindow.webContents.send('display', { src });
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
setMeter () {
|
||||
this.digitalWindow.webContents.send('display', { meter : true });
|
||||
}
|
||||
setGrid () {
|
||||
this.digitalWindow.webContents.send('display', { grid : true });
|
||||
}
|
||||
hide () {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.hide();
|
||||
}
|
||||
this.showing = false;
|
||||
}
|
||||
close () {
|
||||
if (this.digitalWindow) {
|
||||
this.digitalWindow.close();
|
||||
this.digitalWindow = null;
|
||||
|
||||
}
|
||||
this.showing = false;
|
||||
this.opened = false;
|
||||
return true
|
||||
}
|
||||
async move () {
|
||||
|
@ -74,28 +99,26 @@ function padded_frame (i : number) {
|
|||
async function display_eog (src : string) {
|
||||
//timeout 3 eog --fullscreen ${src}
|
||||
cp = spawn('eog', ['--fullscreen', src]);
|
||||
await delay(200)
|
||||
}
|
||||
|
||||
|
||||
async function display_wv (src : string) {
|
||||
await wv.open();
|
||||
await wv.fullScreen();
|
||||
await delay(200);
|
||||
await wv.setImage(src);
|
||||
function display_wv (src : string) {
|
||||
wv.setImage(src);
|
||||
}
|
||||
|
||||
async function end () {
|
||||
async function hide () {
|
||||
if (system.platform !== 'nix') {
|
||||
await wv.close();
|
||||
//wv.hide();
|
||||
} else {
|
||||
if (cp) cp.kill();
|
||||
}
|
||||
}
|
||||
|
||||
async function start (frame : number) {
|
||||
let padded = padded_frame(frame);
|
||||
let ext = 'tif';
|
||||
let tmppath;
|
||||
async function show (frame : number) {
|
||||
let padded : string = padded_frame(frame);
|
||||
let ext : string = 'tif';
|
||||
let tmppath : string;
|
||||
|
||||
if (system.platform !== 'nix') {
|
||||
ext = 'png';
|
||||
|
@ -104,9 +127,29 @@ async function start (frame : number) {
|
|||
tmppath = path.join(TMPDIR, `export-${padded}.${ext}`);
|
||||
|
||||
if (system.platform !== 'nix') {
|
||||
await open()
|
||||
display_wv(tmppath);
|
||||
} else {
|
||||
display_eog(tmppath);
|
||||
await display_eog(tmppath);
|
||||
}
|
||||
}
|
||||
|
||||
async function open () {
|
||||
if (system.platform !== 'nix') {
|
||||
if (!wv || !wv.opened) {
|
||||
wv = new WebView();
|
||||
await wv.start()
|
||||
}
|
||||
} else {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
async function close () {
|
||||
if (system.platform !== 'nix') {
|
||||
wv.close()
|
||||
} else {
|
||||
if (cp) cp.kill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,14 +157,10 @@ module.exports = function (sys : any) {
|
|||
system = sys;
|
||||
TMPDIR = path.join(system.tmp, 'mcopy_digital');
|
||||
|
||||
if (system.platform !== 'nix') {
|
||||
wv = new WebView();
|
||||
} else {
|
||||
//child process
|
||||
}
|
||||
|
||||
return {
|
||||
start,
|
||||
end
|
||||
open,
|
||||
show,
|
||||
hide,
|
||||
close
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue