From 3ffdceb5af4865c68e42f16f0a819cb1abc29b8a Mon Sep 17 00:00:00 2001 From: clemniem Date: Thu, 23 Jun 2016 14:09:39 +0200 Subject: [PATCH] fixed conversion dialog, added second checkbox for text_fills, no real functionality added yet --- src/octoprint/plugins/svgtogcode/__init__.py | 4 +++- src/octoprint/plugins/svgtogcode/profile.py | 10 ++++++---- src/octoprint/plugins/svgtogcode/static/js/convert.js | 7 ++++++- .../plugins/svgtogcode/templates/svgtogcode.jinja2 | 6 +++++- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/octoprint/plugins/svgtogcode/__init__.py b/src/octoprint/plugins/svgtogcode/__init__.py index 123e8630..e8235eee 100644 --- a/src/octoprint/plugins/svgtogcode/__init__.py +++ b/src/octoprint/plugins/svgtogcode/__init__.py @@ -344,7 +344,7 @@ class SvgToGcodePlugin(octoprint.plugin.SlicerPlugin, if not machinecode_path: path, _ = os.path.splitext(model_path) machinecode_path = path + ".gco" - + self._svgtogcode_logger.info("### Slicing %s to %s using profile stored at %s" % (model_path, machinecode_path, profile_path)) ## direct call @@ -357,6 +357,8 @@ class SvgToGcodePlugin(octoprint.plugin.SlicerPlugin, converter_path = '/home/teja/workspace/mrbeam-inkscape-ext' elif("denkbrett" in hostname): converter_path = '/home/flo/mrbeam/git/mrbeam-inkscape-ext' + elif ("clems-Air" in hostname): + converter_path = '/Users/clem/Dropbox/mrBeam/mrbeam-inkscape-ext' import sys sys.path.append(converter_path) diff --git a/src/octoprint/plugins/svgtogcode/profile.py b/src/octoprint/plugins/svgtogcode/profile.py index ce79e9af..9c5499d5 100644 --- a/src/octoprint/plugins/svgtogcode/profile.py +++ b/src/octoprint/plugins/svgtogcode/profile.py @@ -16,15 +16,16 @@ defaults = dict( # general settings svgDPI = 90, pierce_time = 0, - + # vector settings speed = 300, intensity = 500, fill_areas = False, + fill_text = False, cross_fill = False, fill_angle = 0, fill_spacing = 0.25, - + # pixel settings beam_diameter = 0.25, intensity_white = 0, @@ -251,8 +252,8 @@ class Profile(object): } return settings - - + + def convert_to_engine2(self): settings = { @@ -268,6 +269,7 @@ class Profile(object): "sharpening": self.get_float("img_sharpening"), "dithering": self.get_boolean("img_dithering"), "fill_areas": self.get_boolean("fill_areas"), + "fill_text": self.get_boolean("fill_text"), "cross_fill": self.get_boolean("cross_fill"), "fill_angle": self.get_float("fill_angle"), "fill_spacing": self.get_float("fill_spacing"), diff --git a/src/octoprint/plugins/svgtogcode/static/js/convert.js b/src/octoprint/plugins/svgtogcode/static/js/convert.js index fe37227f..70a769f5 100644 --- a/src/octoprint/plugins/svgtogcode/static/js/convert.js +++ b/src/octoprint/plugins/svgtogcode/static/js/convert.js @@ -36,13 +36,17 @@ $(function(){ self.maxSpeed = ko.observable(3000); self.minSpeed = ko.observable(20); self.fill_areas = ko.observable(false); + self.fill_text = ko.observable(false); self.show_fill_areas_checkbox = ko.observable(false); + self.show_fill_text_checkbox = ko.observable(false); // image engraving stuff // preset values are a good start for wood engraving self.images_placed = ko.observable(false); self.show_image_parameters = ko.computed(function(){ - return self.images_placed() || (self.fill_areas() && self.show_vector_parameters()); + return self.images_placed() + || (self.fill_areas() && self.show_vector_parameters()) + || self.fill_text(); }); self.imgIntensityWhite = ko.observable(0); self.imgIntensityBlack = ko.observable(500); @@ -257,6 +261,7 @@ $(function(){ "profile.speed": self.laserSpeed(), "profile.intensity": self.laserIntensity(), "profile.fill_areas": self.fill_areas(), + "profile.fill_text": self.fill_text(), "profile.pierce_time": self.pierceTime(), "profile.intensity_black" : self.imgIntensityBlack(), "profile.intensity_white" : self.imgIntensityWhite(), diff --git a/src/octoprint/plugins/svgtogcode/templates/svgtogcode.jinja2 b/src/octoprint/plugins/svgtogcode/templates/svgtogcode.jinja2 index 78d0636e..8792dbee 100644 --- a/src/octoprint/plugins/svgtogcode/templates/svgtogcode.jinja2 +++ b/src/octoprint/plugins/svgtogcode/templates/svgtogcode.jinja2 @@ -41,9 +41,13 @@
+
+
+