From 474af9c5689f991746ab8ffbcf50c35f8488012d Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 21 Jun 2016 15:53:07 -0400 Subject: [PATCH] Capture and generate transfer report data --- app/js/app.js | 1 - app/lib/capture-report.js | 3 ++- app/lib/seq-ui.js | 3 +++ app/main.js | 8 ++++++-- app/src/index.js | 1 - 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/js/app.js b/app/js/app.js index 9b28fb6..22acc1f 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -3111,5 +3111,4 @@ var init = function () { proj.init(); cam.init(); - capture.init(); }; \ No newline at end of file diff --git a/app/lib/capture-report.js b/app/lib/capture-report.js index 91724af..f3c72c2 100644 --- a/app/lib/capture-report.js +++ b/app/lib/capture-report.js @@ -17,7 +17,7 @@ capture.start = function (first) { }; capture.end = function () { 'use strict'; - return capture.store; + return capture.save(); }; capture.proj_start = function () { 'use strict'; @@ -124,6 +124,7 @@ capture.save = function () { time = +new Date(), json = JSON.stringify(capture.store); fs.writeFileSync(file + time + '.json', json, 'utf8'); + return file + time + '.json'; }; //ffmpeg -f image2 -framerate 24 -start_number 090000 -i input_file_%06d.ext -c:v v210 -an output_file diff --git a/app/lib/seq-ui.js b/app/lib/seq-ui.js index 9adc24e..5253de7 100644 --- a/app/lib/seq-ui.js +++ b/app/lib/seq-ui.js @@ -64,6 +64,8 @@ seq.run = function () { } else { log.info('Sequence completed in ' + humanizeDuration(timeEnd), 'SEQUENCE', true); } + + alert(ipcRenderer.sendSync('transfer', { action: 'end'})); gui.notify('Sequence done!', (mcopy.state.sequence.arr.length * mcopy.loop) + ' actions completed in ' + humanizeDuration(timeEnd)); //clear gui $('.row input').removeClass('h'); @@ -89,6 +91,7 @@ seq.init = function (start) { } seq.stop(false); seq.i = start; + ipcRenderer.sendSync('transfer', { action: 'start'}); seq.run(); }; seq.stats = function () { diff --git a/app/main.js b/app/main.js index af66427..83450ab 100644 --- a/app/main.js +++ b/app/main.js @@ -466,8 +466,12 @@ transfer.listen = function () { 'use strict'; ipcMain.on('transfer', function (event, arg) { var res = ''; - console.dir(event); - console.dir(arg); + //also turn on and off + if (arg.action === 'start') { + capture.start(); + } else if (arg.action === 'end') { + res = capture.end(); + } event.returnValue = res; }); }; diff --git a/app/src/index.js b/app/src/index.js index 386b6c5..623d88e 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -72,5 +72,4 @@ var init = function () { proj.init(); cam.init(); - capture.init(); }; \ No newline at end of file