From de26819d617f6d54f3e075ab7fd5535425d51f58 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 9 Nov 2020 08:50:03 -0500 Subject: [PATCH] fix gcode api return path --- notes.md | 3 ++- src/kiri/export.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/notes.md b/notes.md index 71bccd95..67eee60f 100644 --- a/notes.md +++ b/notes.md @@ -2,7 +2,8 @@ ## `C` cosmetic, `F` functional, `P` performance, `B` bug fix -* `F` implement an in-app bug reporting system +* `F` gcode generation progress bar +* `F` implement an in-app bug reporting system. add workspace to export option. * `F` extend mesh object to store raw + annotations (rot,scale,pos) * share raw data w/ dups, encode/decode * `F` gcode color to speed visualization bar diff --git a/src/kiri/export.js b/src/kiri/export.js index 49765bd7..03b67adf 100644 --- a/src/kiri/export.js +++ b/src/kiri/export.js @@ -40,12 +40,16 @@ } } - function callExport(options, mode) { + function callExport(callback, mode) { const gcode = []; KIRI.client.export(API.conf.get(), (line) => { gcode.push(line); }, (output) => { - exportGCodeDialog(gcode.join('\n'), output); + if (callback) { + callback(gcode.join('\n'), output); + } else { + exportGCodeDialog(gcode.join('\n'), output); + } }); }