From 76cd62449e07499171ec55595749e01e0d72e1e5 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 29 Jun 2016 12:01:17 -0400 Subject: [PATCH] Remove automatic transfer reporting --- app/lib/capture-report.js | 14 ++++++++++---- app/lib/seq-ui.js | 16 ++++++++++++---- app/main.js | 8 +++++++- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/app/lib/capture-report.js b/app/lib/capture-report.js index f3c72c2..6ab9ffd 100644 --- a/app/lib/capture-report.js +++ b/app/lib/capture-report.js @@ -3,7 +3,7 @@ var capture = {}, fs = require('fs'), exec = require('child_process').exec; -capture.active = true; +capture.active = false; capture.store = { events : [], start : 0 @@ -12,12 +12,18 @@ capture.store = { capture.start = function (first) { 'use strict'; //reset storage - capture.store.events = []; - capture.store.start = +new Date(); + if (capture.active) { + capture.store.events = []; + capture.store.start = +new Date(); + } }; capture.end = function () { 'use strict'; - return capture.save(); + if (capture.active) { + return capture.save(); + } else { + return ''; + } }; capture.proj_start = function () { 'use strict'; diff --git a/app/lib/seq-ui.js b/app/lib/seq-ui.js index 5253de7..e999363 100644 --- a/app/lib/seq-ui.js +++ b/app/lib/seq-ui.js @@ -1,13 +1,18 @@ -var seq = {}; +var seq = {}, + capture = {}; /****** Sequence Object *******/ seq.i = 0; -mcopy.loop = 1; -mcopy.loopCount = 0; seq.time = 0; seq.stopState = false; + +mcopy.loop = 1; +mcopy.loopCount = 0; +capture.active = false; +capture.report = ''; + seq.run = function () { 'use strict'; var c = mcopy.state.sequence.arr[seq.i], @@ -65,7 +70,10 @@ seq.run = function () { log.info('Sequence completed in ' + humanizeDuration(timeEnd), 'SEQUENCE', true); } - alert(ipcRenderer.sendSync('transfer', { action: 'end'})); + capture.report = ipcRenderer.sendSync('transfer', { action: 'end'}); + if (capture.active) { + alert(capture.report); + } gui.notify('Sequence done!', (mcopy.state.sequence.arr.length * mcopy.loop) + ' actions completed in ' + humanizeDuration(timeEnd)); //clear gui $('.row input').removeClass('h'); diff --git a/app/main.js b/app/main.js index 83450ab..073081c 100644 --- a/app/main.js +++ b/app/main.js @@ -467,7 +467,13 @@ transfer.listen = function () { ipcMain.on('transfer', function (event, arg) { var res = ''; //also turn on and off - if (arg.action === 'start') { + if (arg.action === 'enable') { + capture.active = true; + res = capture.active; + } else if (arg.action === 'disable') { + capture.active = false; + res = capture.active; + } else if (arg.action === 'start') { capture.start(); } else if (arg.action === 'end') { res = capture.end();