From e8f966d3f79bc0f8079ea81c74d07b628cee0477 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 17 Nov 2017 13:11:13 -0500 Subject: [PATCH] remove remote as option --- js/kiri-print.js | 12 ++++++++++++ js/kiri-widget.js | 2 ++ js/kiri.js | 10 ++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/js/kiri-print.js b/js/kiri-print.js index a4c360e5..f6af1850 100644 --- a/js/kiri-print.js +++ b/js/kiri-print.js @@ -144,6 +144,8 @@ var gs_kiri_print = exports; mode = settings.mode; if (remote) { + + // executed from kiri.js KIRI.work.printSetup(settings, function(reply) { if (reply.done) { scope.output = reply.output; @@ -152,11 +154,15 @@ var gs_kiri_print = exports; onupdate(reply.update, reply.updateStatus) } }); + } else { + + // executed from kiri-worker.js var driver = KIRI.driver[mode]; if (driver) driver.printSetup(scope, onupdate); else console.log({missing_print_driver: mode}); ondone(); + } }; @@ -166,6 +172,8 @@ var gs_kiri_print = exports; mode = settings.mode; if (remote) { + + // executed from kiri.js KIRI.work.printGCode(function(reply) { scope.lines = reply.lines; scope.bytes = reply.bytes; @@ -175,7 +183,10 @@ var gs_kiri_print = exports; ondone(reply.gcode); }); return; + } else { + + // executed from kiri-worker.js var driver = KIRI.driver[mode]; if (driver && driver.printExport) { ondone(driver.printExport(scope, online)); @@ -183,6 +194,7 @@ var gs_kiri_print = exports; console.log({missing_export_driver: mode}); ondone(null); } + } }; diff --git a/js/kiri-widget.js b/js/kiri-widget.js index 551a43a5..dd108fcd 100644 --- a/js/kiri-widget.js +++ b/js/kiri-widget.js @@ -536,6 +536,7 @@ var gs_kiri_widget = exports; if (remote) { + // executed from kiri.js KIRI.work.slice(settings, this, function (reply) { if (reply.update) { onupdate(reply.update, reply.updateStatus); @@ -554,6 +555,7 @@ var gs_kiri_widget = exports; } else { + // executed from kiri-worker.js widget.clearSlices(); var catchdone = function() { diff --git a/js/kiri.js b/js/kiri.js index 07f0d36e..b6b8778e 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -455,8 +455,6 @@ self.kiri.license = exports.LICENSE; layoutOnAdd = true, deviceLock = false, local = SETUP.local, - sliceRemote = !local, - printRemote = !local, mouseMoved = false, camStock = null, camTopZ = 0; @@ -842,7 +840,7 @@ self.kiri.license = exports.LICENSE; } currentPrint = kiri.newPrint(settings, WIDGETS); - currentPrint.setup(printRemote, function(update, status) { + currentPrint.setup(true, function(update, status) { // on update setProgress(update, status); }, function() { @@ -880,7 +878,7 @@ self.kiri.license = exports.LICENSE; preparePrint(exportPrint); return; } - currentPrint.exportGCode(printRemote, function(gcode) { + currentPrint.exportGCode(true, function(gcode) { exportGCode(gcode); }); } @@ -1164,7 +1162,7 @@ self.kiri.license = exports.LICENSE; track = {}; // require topo be sent back from worker for local printing - settings.synth.sendTopo = !printRemote; + settings.synth.sendTopo = false; setOpacity(slicing_opacity); @@ -1224,7 +1222,7 @@ self.kiri.license = exports.LICENSE; totalProgress += (track[w.id] || 0); }); setProgress(totalProgress / WIDGETS.length, msg); - }, sliceRemote); + }, true); }); }