Display the time of the completed sequence when passed from main process.

This commit is contained in:
mmcwilliams 2019-05-28 17:46:53 -04:00
parent 7907ba9533
commit f015a6f2c5
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,8 @@ class Sequence {
ipcRenderer.on(this.id, this.listener.bind(this)); ipcRenderer.on(this.id, this.listener.bind(this));
} }
listener(event, arg) { listener(event, arg) {
//console.log(JSON.stringify(arg)) let timeStr;
console.log(JSON.stringify(arg));
if (arg.start) { if (arg.start) {
if (typeof arg.loop !== 'undefined' && typeof arg.step !== 'undefined') { if (typeof arg.loop !== 'undefined' && typeof arg.step !== 'undefined') {
this.activeStep(arg.step); this.activeStep(arg.step);
@ -44,6 +45,9 @@ class Sequence {
gui.overlay(false); gui.overlay(false);
gui.spinner(false); gui.spinner(false);
log.info('Sequence stopped', 'SERIAL', true); log.info('Sequence stopped', 'SERIAL', true);
log.info(typeof arg.ms);
timeStr = (arg.ms < 2000) ? `${arg.ms}ms` : humanizeDuration(arg.ms);
gui.notify(`SEQUENCE`, `Sequence finished in ${timeStr}`);
} }
} }
return event.returnValue = true; return event.returnValue = true;