summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wüst <sebi@timewaster.de>2014-03-02 20:27:16 +0000
committerSebastian Wüst <sebi@timewaster.de>2014-03-02 20:27:16 +0000
commit3174646c68a76a61bf130d76dd6fc11976074f31 (patch)
tree49d579ad453a46a282a05566bb940c6b8fddb529
parentAvoid crashing when the document is set to NULL (upon cleanup, window closing... (diff)
downloadinkscape-3174646c68a76a61bf130d76dd6fc11976074f31.tar.gz
inkscape-3174646c68a76a61bf130d76dd6fc11976074f31.zip
cleanup
(bzr r13093)
-rw-r--r--share/extensions/hpgl_output.inx4
-rwxr-xr-xshare/extensions/hpgl_output.py4
-rw-r--r--share/extensions/plotter.inx8
-rw-r--r--share/extensions/plotter.py23
4 files changed, 20 insertions, 19 deletions
diff --git a/share/extensions/hpgl_output.inx b/share/extensions/hpgl_output.inx
index 5f197b5ae..d16cc55e5 100644
--- a/share/extensions/hpgl_output.inx
+++ b/share/extensions/hpgl_output.inx
@@ -8,7 +8,7 @@
<dependency type="executable" location="extensions">inkex.py</dependency>
<_param name="introduction" type="description">Please make sure that all objects you want to save are converted to paths. Please use the plotter extension (Extensions menu) to plot directly over a serial connection.</_param>
<param name="tab" type="notebook">
- <page name="plotter" _gui-text="Plotter ">
+ <page name="plotter" _gui-text="Plotter Settings ">
<param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis. (Default: 1016.0)">1016.0</param>
<param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis. (Default: 1016.0)">1016.0</param>
<param name="pen" type="int" min="0" max="99" _gui-text="Pen number" _gui-description="The number of the pen (tool) to use. (Standard: '1')">1</param>
@@ -24,7 +24,7 @@
<param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis. (Default: Unchecked)">false</param>
<param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point. (Default: Unchecked)">false</param>
</page>
- <page name="overcutToolOffset" _gui-text="Features ">
+ <page name="overcutToolOffset" _gui-text="Plot Features ">
<param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm)" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command. (Default: 1.00)">1.00</param>
<param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm)" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command. (Default: 0.25)">0.25</param>
<param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py
index d8f082da5..5b5521926 100755
--- a/share/extensions/hpgl_output.py
+++ b/share/extensions/hpgl_output.py
@@ -26,7 +26,7 @@ import inkex
inkex.localize()
-class MyEffect(inkex.Effect):
+class HpglOutput(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
@@ -69,7 +69,7 @@ class MyEffect(inkex.Effect):
if __name__ == '__main__':
# start extension
- e = MyEffect()
+ e = HpglOutput()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 \ No newline at end of file
diff --git a/share/extensions/plotter.inx b/share/extensions/plotter.inx
index c4b3e2b25..fc620f8a3 100644
--- a/share/extensions/plotter.inx
+++ b/share/extensions/plotter.inx
@@ -8,7 +8,7 @@
<dependency type="executable" location="extensions">inkex.py</dependency>
<_param name="introduction" type="description">Please make sure that all objects you want to plot are converted to paths.</_param>
<param name="tab" type="notebook">
- <page name="misc" _gui-text="Connection ">
+ <page name="misc" _gui-text="Connection Settings ">
<param name="serialPort" type="string" _gui-text="Serial port" _gui-description="The port of your serial connection, on Windows something like 'COM1', on Linux something like: '/dev/ttyUSB0'. (Default: COM1)">COM1</param>
<param name="serialBaudRate" type="optiongroup" appearance="minimal" _gui-text="Serial baud rate" _gui-description="The Baud rate of your serial connection. (Default: 9600)">
<option value="9600">9600</option>
@@ -43,7 +43,7 @@
<_param name="serialHelp" type="description">This can be a physical serial connection or a USB-to-Serial bridge. Ask your plotter manufacturer for drivers if needed.</_param>
<_param name="parallelHelp" type="description">Parallel (LPT) connections are not supported.</_param>
</page>
- <page name="plotter" _gui-text="Plotter ">
+ <page name="plotter" _gui-text="Plotter Settings ">
<param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis. (Default: 1016.0)">1016.0</param>
<param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis. (Default: 1016.0)">1016.0</param>
<param name="pen" type="int" min="0" max="99" _gui-text="Pen number" _gui-description="The number of the pen (tool) to use. (Standard: '1')">1</param>
@@ -59,7 +59,7 @@
<param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis. (Default: Unchecked)">false</param>
<param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point. (Default: Unchecked)">false</param>
</page>
- <page name="misc" _gui-text="Features ">
+ <page name="misc" _gui-text="Plot Features ">
<param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm)" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command. (Default: 1.00)">1.00</param>
<param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm)" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command. (Default: 0.25)">0.25</param>
<param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
@@ -70,7 +70,7 @@
</page>
</param>
<_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter.</_param>
- <effect needs-live-preview="false">
+ <effect needs-live-preview="false" needs-document="true">
<object-type>path</object-type>
<effects-menu>
<submenu _name="Export"/>
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py
index 056a90fe3..be59f604b 100644
--- a/share/extensions/plotter.py
+++ b/share/extensions/plotter.py
@@ -30,7 +30,7 @@ import inkex
inkex.localize()
-class MyEffect(inkex.Effect):
+class Plot(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
@@ -70,16 +70,17 @@ class MyEffect(inkex.Effect):
raise ValueError, ('', type, value), traceback
# TODO: Get preview to work. This requires some work on the C++ side to be able to determine if it is
# a preview or a final run. (Remember to set <effect needs-live-preview='false'> to true)
- # This outcommented code has a user unit issue (getSvg produces px, docWidth could be mm or something else)
'''
- # reparse data for preview
- self.options.showMovements = True
- self.options.docWidth = float(self.unittouu(self.document.getroot().get('width')))
- self.options.docHeight = float(self.unittouu(self.document.getroot().get('height')))
- myHpglDecoder = hpgl_decoder.hpglDecoder(self.hpgl, self.options)
- doc, warnings = myHpglDecoder.getSvg()
- # deliver document to inkscape
- self.document = doc
+ if MAGIC:
+ # reparse data for preview
+ self.options.showMovements = True
+ self.options.docWidth = self.uutounit(self.unittouu(self.document.getroot().get('width')), "px")
+ self.options.docHeight = self.uutounit(self.unittouu(self.document.getroot().get('height')), "px")
+ myHpglDecoder = hpgl_decoder.hpglDecoder(self.hpgl, self.options)
+ doc, warnings = myHpglDecoder.getSvg()
+ # deliver document to inkscape
+ self.document = doc
+ else:
'''
# convert to other formats
if self.options.commandLanguage == 'DMPL':
@@ -207,7 +208,7 @@ class MyEffect(inkex.Effect):
if __name__ == '__main__':
# start extension
- e = MyEffect()
+ e = Plot()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 \ No newline at end of file