From de3cd4c192b87660d348ca146b3a7409d8d05108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20W=C3=BCst?= Date: Sat, 27 Jul 2013 17:18:36 +0200 Subject: small changes + fixes (bzr r12417.1.13) --- share/extensions/hpgl_encoder.py | 7 ++++--- share/extensions/hpgl_output.inx | 14 ++++++++++---- share/extensions/hpgl_output.py | 5 +---- share/extensions/plotter.py | 1 - 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/share/extensions/hpgl_encoder.py b/share/extensions/hpgl_encoder.py index 27d1bf755..026b839f4 100644 --- a/share/extensions/hpgl_encoder.py +++ b/share/extensions/hpgl_encoder.py @@ -45,7 +45,7 @@ class hpglEncoder: ''' self.doc = doc self.options = options - self.divergenceX = 'False' # dirty hack: i need to know if this was set before, but since False is evaluated to 0 it can not be determined, therefore the string. + self.divergenceX = 'False' # dirty hack: i need to know if this was set to a number before, but since False is evaluated to 0 it can not be determined, therefore the string. self.divergenceY = 'False' self.sizeX = 'False' self.sizeY = 'False' @@ -97,7 +97,7 @@ class hpglEncoder: # add precut if self.options.useToolOffset and self.options.precut: self.calcOffset('PU', 0, 0) - self.calcOffset('PD', 0, self.options.toolOffset * self.options.toolOffsetReturn * 2) + self.calcOffset('PD', 0, self.options.toolOffset * 8) # start conversion self.process_group(self.doc, self.groupmat) # shift an empty node in in order to process last node in cache @@ -122,7 +122,8 @@ class hpglEncoder: self.process_path(node, groupmat[-1]) if node.tag == inkex.addNS('g', 'svg'): self.process_group(node, groupmat) - groupmat.pop() + if trans: + groupmat.pop() def process_path(self, node, mat): # process path diff --git a/share/extensions/hpgl_output.inx b/share/extensions/hpgl_output.inx index a008c59e4..ac93ffe36 100644 --- a/share/extensions/hpgl_output.inx +++ b/share/extensions/hpgl_output.inx @@ -10,8 +10,10 @@ 1 +   1016.0 1016.0 +   false false @@ -30,16 +32,20 @@ true 0.25 2.50 +   true - <_param name="offsetNote" type="description">Please note that using the tool offset correction will move your drawing away from the zero point by the tool offset specified on both axes. +   + <_param name="offsetNote" type="description">Please note that using the tool offset correction will shift your drawing away from the zero point by the length of the tool offset on both axes. 1.2 - 0.00 - 0.00 +   + 0.00 + 0.00 - + <_param name="plottingNote" type="description">Please use the plotter extension from the extension menu to plot directly out of Inkscape. + .hpgl image/hpgl <_filetypename>HP Graphics Language file (*.hpgl) diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index b72996315..4c3217d63 100755 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -19,8 +19,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -# TODO:2013-07-15:Sebastian Wüst:make text to guide the user to the extension when he wants to plot - # standard library import sys # local library @@ -64,8 +62,7 @@ class MyEffect(inkex.Effect): def output(self): # print to file - if self.hpgl != 1: - print self.hpgl + print self.hpgl if __name__ == '__main__': # Raise recursion limit to avoid exceptions on big documents diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 42e348742..4556e9058 100644 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -87,7 +87,6 @@ class MyEffect(inkex.Effect): raise Exception(inst) ''' # send data to plotter - # TODO:2013-07-13:Sebastian Wüst:Somehow slow down sending to avoid buffer overruns in the plotter on very large drawings. mySerial = serial.Serial(port=self.options.serialPort, baudrate=self.options.serialBaudRate, timeout=0.1, writeTimeout=None) mySerial.write(self.hpgl) # Read back 2 chars to avoid plotter not plotting last command (I have no idea why this is necessary) -- cgit v1.2.3