During the film out mode, the webview now correctly handles "closed" events when the user manually closes the window. The window also now closes at the end of a sequence (caught a typo) and correctly removed the webview from the WebView object when it does not exist. Resolves #15

This commit is contained in:
mmcwilliams 2019-06-18 13:35:50 -04:00
parent 7740dc39ec
commit 32f02d42ce
14 changed files with 59 additions and 23 deletions

View File

@ -38,6 +38,7 @@ class WebView {
}
this.digitalWindow.on('closed', () => {
this.digitalWindow = null;
this.close();
});
this.digitalWindow.hide();
}
@ -49,6 +50,10 @@ class WebView {
await delay_1.delay(300);
}
async show(src) {
if (!this.digitalWindow) {
console.warn(`Cannot show "${src}" because window does not exist`);
return false;
}
try {
this.digitalWindow.webContents.send('display', { src });
}
@ -56,12 +61,15 @@ class WebView {
console.error(err);
}
this.showing = true;
await delay_1.delay(100);
return true;
}
hide() {
if (this.digitalWindow) {
this.digitalWindow.hide();
}
this.showing = false;
return true;
}
close() {
this.hide();
@ -70,6 +78,7 @@ class WebView {
this.digitalWindow = null;
}
this.opened = false;
this.showing = false;
return true;
}
}
@ -83,8 +92,9 @@ class EOG {
//timeout 3 eog --fullscreen ${src}
this.cp = spawn('eog', ['--fullscreen', src]);
await delay_1.delay(200);
return true;
}
async hide() {
hide() {
if (this.cp) {
this.cp.kill();
this.cp = null;

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;IAGI;AAEJ,+BAAgC;AAChC,+BAAwC;AACxC,iCAA8B;AAG9B,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,E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,KAAK,EAAE;YAC5B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;SACf;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;SAChB;IACF,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA"}

View File

@ -121,8 +121,8 @@ class Sequencer {
this.log.info(`Ended loop ${x + 1}`);
this.ui.send(this.id, { loop: x, stop: true });
}
if (this.cmd.proj.dig.enabled === true) {
await this.cmd.proj.dig.close();
if (this.cmd.proj.dig.state.enabled === true) {
await this.cmd.proj.dig.display.close();
}
ms = (+new Date()) - startTime;
//end sequence

File diff suppressed because one or more lines are too long

View File

@ -38,6 +38,7 @@ class WebView {
}
this.digitalWindow.on('closed', () => {
this.digitalWindow = null;
this.close();
});
this.digitalWindow.hide();
}
@ -49,6 +50,10 @@ class WebView {
await delay_1.delay(300);
}
async show(src) {
if (!this.digitalWindow) {
console.warn(`Cannot show "${src}" because window does not exist`);
return false;
}
try {
this.digitalWindow.webContents.send('display', { src });
}
@ -56,12 +61,15 @@ class WebView {
console.error(err);
}
this.showing = true;
await delay_1.delay(100);
return true;
}
hide() {
if (this.digitalWindow) {
this.digitalWindow.hide();
}
this.showing = false;
return true;
}
close() {
this.hide();
@ -70,6 +78,7 @@ class WebView {
this.digitalWindow = null;
}
this.opened = false;
this.showing = false;
return true;
}
}
@ -83,8 +92,9 @@ class EOG {
//timeout 3 eog --fullscreen ${src}
this.cp = spawn('eog', ['--fullscreen', src]);
await delay_1.delay(200);
return true;
}
async hide() {
hide() {
if (this.cp) {
this.cp.kill();
this.cp = null;

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;IAGI;AAEJ,+BAAgC;AAChC,+BAAwC;AACxC,iCAA8B;AAG9B,MA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;YACN,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC7B;IACF,CAAC;IACM,IAAI;QACV,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,2BAA2B;YAC3B,iBAAiB;SACjB;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SAChB;IACF,CAAC;IACM,KAAK;QACX,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;SACf;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;SAChB;IACF,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA"}

View File

@ -121,8 +121,8 @@ class Sequencer {
this.log.info(`Ended loop ${x + 1}`);
this.ui.send(this.id, { loop: x, stop: true });
}
if (this.cmd.proj.dig.enabled === true) {
await this.cmd.proj.dig.close();
if (this.cmd.proj.dig.state.enabled === true) {
await this.cmd.proj.dig.display.close();
}
ms = (+new Date()) - startTime;
//end sequence

File diff suppressed because one or more lines are too long

View File

@ -38,6 +38,7 @@ class WebView {
}
this.digitalWindow.on('closed', () => {
this.digitalWindow = null;
this.close();
});
this.digitalWindow.hide();
}
@ -49,6 +50,10 @@ class WebView {
await delay_1.delay(300);
}
async show(src) {
if (!this.digitalWindow) {
console.warn(`Cannot show "${src}" because window does not exist`);
return false;
}
try {
this.digitalWindow.webContents.send('display', { src });
}
@ -56,12 +61,15 @@ class WebView {
console.error(err);
}
this.showing = true;
await delay_1.delay(100);
return true;
}
hide() {
if (this.digitalWindow) {
this.digitalWindow.hide();
}
this.showing = false;
return true;
}
close() {
this.hide();
@ -70,6 +78,7 @@ class WebView {
this.digitalWindow = null;
}
this.opened = false;
this.showing = false;
return true;
}
}
@ -83,8 +92,9 @@ class EOG {
//timeout 3 eog --fullscreen ${src}
this.cp = spawn('eog', ['--fullscreen', src]);
await delay_1.delay(200);
return true;
}
async hide() {
hide() {
if (this.cp) {
this.cp.kill();
this.cp = null;

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;IAGI;AAEJ,+BAAgC;AAChC,+BAAwC;AACxC,iCAA8B;AAG9B,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KAChB;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,OAAO;IAIZ;QAFO,WAAM,GAAa,KAAK,CAAC;QACzB,YAAO,GAAa,KAAK,CAAC;QAEhC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC;YACtC,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,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,uBAAuB,CAAC,CAAC;QAC5E,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,O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,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,GAAG,GAAG,KAAK,CAAC;SACZ;QAED,OAAO,GAAG,WAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;QAE3D,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC5B;aAAM;YACN,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC7B;IACF,CAAC;IACM,IAAI;QACV,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,2BAA2B;YAC3B,iBAAiB;SACjB;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SAChB;IACF,CAAC;IACM,KAAK;QACX,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC5B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;SACf;aAAM;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;SAChB;IACF,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,GAAS;IACnC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA"}

View File

@ -121,8 +121,8 @@ class Sequencer {
this.log.info(`Ended loop ${x + 1}`);
this.ui.send(this.id, { loop: x, stop: true });
}
if (this.cmd.proj.dig.enabled === true) {
await this.cmd.proj.dig.close();
if (this.cmd.proj.dig.state.enabled === true) {
await this.cmd.proj.dig.display.close();
}
ms = (+new Date()) - startTime;
//end sequence

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,8 @@ class WebView {
this.digitalWindow.webContents.openDevTools();
}
this.digitalWindow.on('closed', () => {
this.digitalWindow = null
this.digitalWindow = null;
this.close();
});
this.digitalWindow.hide();
}
@ -55,21 +56,25 @@ class WebView {
await delay(300);
}
async show (src : string) {
if (!this.digitalWindow) {
console.warn(`Cannot show "${src}" because window does not exist`);
return false;
}
try {
this.digitalWindow.webContents.send('display', { src });
} catch (err) {
console.error(err)
console.error(err);
}
this.showing = true;
await delay(100)
return true
await delay(100);
return true;
}
hide () {
if (this.digitalWindow) {
this.digitalWindow.hide();
}
this.showing = false;
return true
return true;
}
close () {
this.hide();
@ -78,6 +83,7 @@ class WebView {
this.digitalWindow = null;
}
this.opened = false;
this.showing = false;
return true
}
}

View File

@ -147,8 +147,8 @@ class Sequencer {
this.ui.send(this.id, { loop : x, stop : true });
}
if (this.cmd.proj.dig.enabled === true) {
await this.cmd.proj.dig.close()
if (this.cmd.proj.dig.state.enabled === true) {
await this.cmd.proj.dig.display.close();
}
ms = ( +new Date() ) - startTime;
@ -167,7 +167,7 @@ class Sequencer {
**/
public stop () {
if (this.cmd.proj.dig.state.enabled === true) {
this.cmd.proj.dig.display.close()
this.cmd.proj.dig.display.close();
}
this.running = false;
//clear?