From f015a6f2c523de78394d235090e92f38c195838c Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Tue, 28 May 2019 17:46:53 -0400 Subject: [PATCH] Display the time of the completed sequence when passed from main process. --- app/lib/ui/seq.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/ui/seq.js b/app/lib/ui/seq.js index 138b0f6..388f09b 100644 --- a/app/lib/ui/seq.js +++ b/app/lib/ui/seq.js @@ -18,7 +18,8 @@ class Sequence { ipcRenderer.on(this.id, this.listener.bind(this)); } listener(event, arg) { - //console.log(JSON.stringify(arg)) + let timeStr; + console.log(JSON.stringify(arg)); if (arg.start) { if (typeof arg.loop !== 'undefined' && typeof arg.step !== 'undefined') { this.activeStep(arg.step); @@ -44,6 +45,9 @@ class Sequence { gui.overlay(false); gui.spinner(false); 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;