moved some files & one bugfix

Sat, 26 Jan 2008 11:39:30 +0100

author
David Douard <david.douard@logilab.fr>
date
Sat, 26 Jan 2008 11:39:30 +0100
changeset 34
022e881b758e
parent 33
61809bb871bf
child 35
3b7a38af5c42

moved some files & one bugfix

gpib.py file | annotate | diff | comparison | revisions
icons/led_green.svg file | annotate | diff | comparison | revisions
icons/led_green_off.svg file | annotate | diff | comparison | revisions
icons/led_red.svg file | annotate | diff | comparison | revisions
icons/led_red_off.svg file | annotate | diff | comparison | revisions
plotter/gpib.py file | annotate | diff | comparison | revisions
plotter/hpgl_parser.py file | annotate | diff | comparison | revisions
plotter/hpgl_plotter_rc.py file | annotate | diff | comparison | revisions
plotter/icons/led_green.svg file | annotate | diff | comparison | revisions
plotter/icons/led_green_off.svg file | annotate | diff | comparison | revisions
plotter/icons/led_red.svg file | annotate | diff | comparison | revisions
plotter/icons/led_red_off.svg file | annotate | diff | comparison | revisions
plotter/qgpib_plotter.py file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gpib.py	Sat Jan 26 11:39:30 2008 +0100
@@ -0,0 +1,64 @@
+"""
+gpib: create serial connection to GPIB-USB device (ProLogix is the
+only supported device for now).
+"""
+import serial
+from serial.serialutil import SerialException
+import time
+
+class ConnectionError(Exception):
+    pass
+
+class Constants(object):
+    def __init__(self):
+        self.constants = {}
+        self.descriptions = {}
+        self.rev_constants = {}
+        for v, k, m in self._constants:
+            self.k = v
+            self.constants[v] = k
+            self.rev_constants[k] = v
+            self.descriptions[v] = m
+            
+    def __getitem__(self, k):
+        if isinstance(k, basestring):
+            return self.rev_constants[k]
+        else:
+            return self.constants[k]
+
+    def get_description(self, k):
+        if isinstance(k, basestring):
+            k = self.rev_constants[k]
+        return self.descriptions[k]
+    
+
+class MODE(Constants):    
+    _constants = [(1, "CONTROLLER", "Set device as Controller in Charge"),
+                  (0, "DEVICE", "Set device as simple listener"),
+                  ]
+# TODO
+# class STATUS_BYTE(Constants):
+#     # IEEE 488.2 Status Byte constants
+#     MAV = 0x10 # Message AVailable: bit 4 of the Status Byte
+#     ESB = 0x20 # Event Status Bit: bit 5 of the Status Byte
+#     MSS = 0x40 # Master Summary Status bit: bit 6 of the Status Byte (NOT
+#                # sent in response to a serial poll)
+#     RQS = 0x40 # Request Service: bit 6 of the Status Byte (when sent in
+#                # response to a serial poll)
+# class SESR(Constants):
+#     # SESR constants (Standard Event Status Register)
+#     PON = 0x80 # Power On: Power has been turned On since last register
+#                # read access
+#     URQ = 0x40 # User Request: the user has activated some device control
+#                # (whatever the Remote Local state is)
+#     CME = 0x20 # Command Error
+#     EXE = 0x10 # Execution Error
+#     DDE = 0x08 # Device Dependant Error
+#     QYE = 0x04 # QuerY Error (attempt to read data while Output Queue is
+#                # empty, or data in the OQ was lost)
+#     RQC = 0x02 # Request Control: tell the CiC that the device wants to
+#                # become the CiC
+#     OPC = 0x01 # Operation Complete: device has completed any pending
+#                # operation (ready to accept new commands). This bit is
+#                # generated in response to a OPC command.
+    
--- a/icons/led_green.svg	Fri Jan 25 21:01:30 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://web.resource.org/cc/"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="278.25241"
-   height="278.25241"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.45.1"
-   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
-   sodipodi:docname="led_green.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient4117">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop4119" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:0;"
-         offset="1"
-         id="stop4121" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3136">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop3138" />
-      <stop
-         style="stop-color:#00ff00;stop-opacity:0;"
-         offset="1"
-         id="stop3140" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3136"
-       id="radialGradient3142"
-       cx="327.41925"
-       cy="34.101982"
-       fx="327.41925"
-       fy="34.101982"
-       r="130.1324"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4123"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4129"
-       gradientUnits="userSpaceOnUse"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="0.48082306"
-     inkscape:cx="372.04724"
-     inkscape:cy="207.1213"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     inkscape:window-width="996"
-     inkscape:window-height="714"
-     inkscape:window-x="25"
-     inkscape:window-y="4" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Calque 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-175.95852,-171.79899)">
-    <rect
-       style="opacity:1;fill:#00ff00;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect2160"
-       width="259.97089"
-       height="259.97089"
-       x="185.09927"
-       y="180.93974" />
-    <rect
-       y="176.38744"
-       x="180.54697"
-       height="269.0755"
-       width="269.0755"
-       id="rect2162"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#00c40b;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-    <rect
-       y="180.93974"
-       x="185.09927"
-       height="259.97089"
-       width="259.97089"
-       id="rect3134"
-       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
-    <path
-       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
-       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
-       id="path3144" />
-    <path
-       sodipodi:type="arc"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="path3146"
-       sodipodi:cx="303.646"
-       sodipodi:cy="129.98544"
-       sodipodi:rx="0"
-       sodipodi:ry="7.2791853"
-       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
-  </g>
-</svg>
--- a/icons/led_green_off.svg	Fri Jan 25 21:01:30 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://web.resource.org/cc/"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="278.25241"
-   height="278.25241"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.45.1"
-   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
-   sodipodi:docname="led_green_off.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <linearGradient
-       id="linearGradient4117">
-      <stop
-         style="stop-color:#acacac;stop-opacity:0.68783069;"
-         offset="0"
-         id="stop4119" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:0;"
-         offset="1"
-         id="stop4121" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3136">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop3138" />
-      <stop
-         style="stop-color:#00ff00;stop-opacity:0;"
-         offset="1"
-         id="stop3140" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4129"
-       gradientUnits="userSpaceOnUse"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="0.48082306"
-     inkscape:cx="372.04724"
-     inkscape:cy="-64.793696"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     inkscape:window-width="996"
-     inkscape:window-height="714"
-     inkscape:window-x="22"
-     inkscape:window-y="21" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Calque 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-175.95852,-171.79899)">
-    <rect
-       style="opacity:1;fill:#009900;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect2160"
-       width="259.97089"
-       height="259.97089"
-       x="185.09927"
-       y="180.93974" />
-    <rect
-       y="176.38744"
-       x="180.54697"
-       height="269.0755"
-       width="269.0755"
-       id="rect2162"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#008304;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-    <path
-       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
-       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
-       id="path3144" />
-    <path
-       sodipodi:type="arc"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="path3146"
-       sodipodi:cx="303.646"
-       sodipodi:cy="129.98544"
-       sodipodi:rx="0"
-       sodipodi:ry="7.2791853"
-       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
-  </g>
-</svg>
--- a/icons/led_red.svg	Fri Jan 25 21:01:30 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://web.resource.org/cc/"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="278.25241"
-   height="278.25241"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.45.1"
-   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
-   sodipodi:docname="led_red.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient4117">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop4119" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:0;"
-         offset="1"
-         id="stop4121" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3136">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop3138" />
-      <stop
-         style="stop-color:#ff0000;stop-opacity:0;"
-         offset="1"
-         id="stop3140" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3136"
-       id="radialGradient3142"
-       cx="327.41925"
-       cy="34.101982"
-       fx="327.41925"
-       fy="34.101982"
-       r="130.1324"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4123"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4129"
-       gradientUnits="userSpaceOnUse"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="0.96164611"
-     inkscape:cx="326.38382"
-     inkscape:cy="89.862869"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     inkscape:window-width="996"
-     inkscape:window-height="714"
-     inkscape:window-x="11"
-     inkscape:window-y="13" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Calque 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-175.95852,-171.79899)">
-    <rect
-       style="opacity:1;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect2160"
-       width="259.97089"
-       height="259.97089"
-       x="185.09927"
-       y="180.93974" />
-    <rect
-       y="176.38744"
-       x="180.54697"
-       height="269.0755"
-       width="269.0755"
-       id="rect2162"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-    <path
-       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
-       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
-       id="path3144" />
-    <path
-       sodipodi:type="arc"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="path3146"
-       sodipodi:cx="303.646"
-       sodipodi:cy="129.98544"
-       sodipodi:rx="0"
-       sodipodi:ry="7.2791853"
-       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
-    <rect
-       y="180.93974"
-       x="185.09927"
-       height="259.97089"
-       width="259.97089"
-       id="rect3134"
-       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
-  </g>
-</svg>
--- a/icons/led_red_off.svg	Fri Jan 25 21:01:30 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://web.resource.org/cc/"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="278.2525"
-   height="278.2525"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.45.1"
-   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
-   sodipodi:docname="led_red_off.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient4117">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop4119" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:0;"
-         offset="1"
-         id="stop4121" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3136">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1;"
-         offset="0"
-         id="stop3138" />
-      <stop
-         style="stop-color:#aa0000;stop-opacity:0;"
-         offset="1"
-         id="stop3140" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3136"
-       id="radialGradient3142"
-       cx="327.41925"
-       cy="34.101982"
-       fx="327.41925"
-       fy="34.101982"
-       r="130.1324"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4123"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4117"
-       id="linearGradient4129"
-       gradientUnits="userSpaceOnUse"
-       x1="260.95242"
-       y1="121.18842"
-       x2="488.65955"
-       y2="351.48065"
-       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="0.96164611"
-     inkscape:cx="326.38382"
-     inkscape:cy="69.71549"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     inkscape:window-width="996"
-     inkscape:window-height="714"
-     inkscape:window-x="11"
-     inkscape:window-y="13" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Calque 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-175.95847,-171.79894)">
-    <rect
-       y="180.93974"
-       x="185.09927"
-       height="259.97089"
-       width="259.97089"
-       id="rect3134"
-       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
-    <rect
-       style="opacity:1;fill:#a20000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect2160"
-       width="259.97089"
-       height="259.97089"
-       x="185.09927"
-       y="180.93974" />
-    <rect
-       y="176.38744"
-       x="180.54697"
-       height="269.0755"
-       width="269.0755"
-       id="rect2162"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#950000;stroke-width:9.17700005;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-    <path
-       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
-       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
-       id="path3144" />
-    <path
-       sodipodi:type="arc"
-       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="path3146"
-       sodipodi:cx="303.646"
-       sodipodi:cy="129.98544"
-       sodipodi:rx="0"
-       sodipodi:ry="7.2791853"
-       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
-  </g>
-</svg>
--- a/plotter/gpib.py	Fri Jan 25 21:01:30 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-"""
-gpib: create serial connection to GPIB-USB device (ProLogix is the
-only supported device for now).
-"""
-import serial
-from serial.serialutil import SerialException
-import time
-
-class ConnectionError(Exception):
-    pass
-
-class Constants(object):
-    def __init__(self):
-        self.constants = {}
-        self.descriptions = {}
-        self.rev_constants = {}
-        for v, k, m in self._constants:
-            self.k = v
-            self.constants[v] = k
-            self.rev_constants[k] = v
-            self.descriptions[v] = m
-            
-    def __getitem__(self, k):
-        if isinstance(k, basestring):
-            return self.rev_constants[k]
-        else:
-            return self.constants[k]
-
-    def get_description(self, k):
-        if isinstance(k, basestring):
-            k = self.rev_constants[k]
-        return self.descriptions[k]
-    
-
-class MODE(Constants):    
-    _constants = [(1, "CONTROLLER", "Set device as Controller in Charge"),
-                  (0, "DEVICE", "Set device as simple listener"),
-                  ]
-# TODO
-# class STATUS_BYTE(Constants):
-#     # IEEE 488.2 Status Byte constants
-#     MAV = 0x10 # Message AVailable: bit 4 of the Status Byte
-#     ESB = 0x20 # Event Status Bit: bit 5 of the Status Byte
-#     MSS = 0x40 # Master Summary Status bit: bit 6 of the Status Byte (NOT
-#                # sent in response to a serial poll)
-#     RQS = 0x40 # Request Service: bit 6 of the Status Byte (when sent in
-#                # response to a serial poll)
-# class SESR(Constants):
-#     # SESR constants (Standard Event Status Register)
-#     PON = 0x80 # Power On: Power has been turned On since last register
-#                # read access
-#     URQ = 0x40 # User Request: the user has activated some device control
-#                # (whatever the Remote Local state is)
-#     CME = 0x20 # Command Error
-#     EXE = 0x10 # Execution Error
-#     DDE = 0x08 # Device Dependant Error
-#     QYE = 0x04 # QuerY Error (attempt to read data while Output Queue is
-#                # empty, or data in the OQ was lost)
-#     RQC = 0x02 # Request Control: tell the CiC that the device wants to
-#                # become the CiC
-#     OPC = 0x01 # Operation Complete: device has completed any pending
-#                # operation (ready to accept new commands). This bit is
-#                # generated in response to a OPC command.
-    
--- a/plotter/hpgl_parser.py	Fri Jan 25 21:01:30 2008 +0100
+++ b/plotter/hpgl_parser.py	Sat Jan 26 11:39:30 2008 +0100
@@ -23,7 +23,7 @@
             if data[self.idx] == chr(0x03):
                 self.ESC()
             else:
-                cmd = data[self.idx: self.idx+2]
+                cmd = data[self.idx: self.idx+2].upper()
                 self.idx += 2
                 getattr(self, cmd)()
             while self.idx<len(data) and data[self.idx] in [';','\n','\r', '\a', ' ']:
--- a/plotter/hpgl_plotter_rc.py	Fri Jan 25 21:01:30 2008 +0100
+++ b/plotter/hpgl_plotter_rc.py	Sat Jan 26 11:39:30 2008 +0100
@@ -2,7 +2,7 @@
 
 # Resource object code
 #
-# Created: ven. janv. 25 20:50:25 2008
+# Created: sam. janv. 26 11:14:20 2008
 #      by: The Resource Compiler for PyQt (Qt v4.3.2)
 #
 # WARNING! All changes made in this file will be lost!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotter/icons/led_green.svg	Sat Jan 26 11:39:30 2008 +0100
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="278.25241"
+   height="278.25241"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
+   sodipodi:docname="led_green.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient4117">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop4119" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop4121" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3136">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3138" />
+      <stop
+         style="stop-color:#00ff00;stop-opacity:0;"
+         offset="1"
+         id="stop3140" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3136"
+       id="radialGradient3142"
+       cx="327.41925"
+       cy="34.101982"
+       fx="327.41925"
+       fy="34.101982"
+       r="130.1324"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4123"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4129"
+       gradientUnits="userSpaceOnUse"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.48082306"
+     inkscape:cx="372.04724"
+     inkscape:cy="207.1213"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="996"
+     inkscape:window-height="714"
+     inkscape:window-x="25"
+     inkscape:window-y="4" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-175.95852,-171.79899)">
+    <rect
+       style="opacity:1;fill:#00ff00;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2160"
+       width="259.97089"
+       height="259.97089"
+       x="185.09927"
+       y="180.93974" />
+    <rect
+       y="176.38744"
+       x="180.54697"
+       height="269.0755"
+       width="269.0755"
+       id="rect2162"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#00c40b;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    <rect
+       y="180.93974"
+       x="185.09927"
+       height="259.97089"
+       width="259.97089"
+       id="rect3134"
+       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
+    <path
+       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
+       id="path3144" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path3146"
+       sodipodi:cx="303.646"
+       sodipodi:cy="129.98544"
+       sodipodi:rx="0"
+       sodipodi:ry="7.2791853"
+       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotter/icons/led_green_off.svg	Sat Jan 26 11:39:30 2008 +0100
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="278.25241"
+   height="278.25241"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
+   sodipodi:docname="led_green_off.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient4117">
+      <stop
+         style="stop-color:#acacac;stop-opacity:0.68783069;"
+         offset="0"
+         id="stop4119" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop4121" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3136">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3138" />
+      <stop
+         style="stop-color:#00ff00;stop-opacity:0;"
+         offset="1"
+         id="stop3140" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4129"
+       gradientUnits="userSpaceOnUse"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.48082306"
+     inkscape:cx="372.04724"
+     inkscape:cy="-64.793696"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="996"
+     inkscape:window-height="714"
+     inkscape:window-x="22"
+     inkscape:window-y="21" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-175.95852,-171.79899)">
+    <rect
+       style="opacity:1;fill:#009900;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2160"
+       width="259.97089"
+       height="259.97089"
+       x="185.09927"
+       y="180.93974" />
+    <rect
+       y="176.38744"
+       x="180.54697"
+       height="269.0755"
+       width="269.0755"
+       id="rect2162"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#008304;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    <path
+       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
+       id="path3144" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path3146"
+       sodipodi:cx="303.646"
+       sodipodi:cy="129.98544"
+       sodipodi:rx="0"
+       sodipodi:ry="7.2791853"
+       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotter/icons/led_red.svg	Sat Jan 26 11:39:30 2008 +0100
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="278.25241"
+   height="278.25241"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
+   sodipodi:docname="led_red.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient4117">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop4119" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop4121" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3136">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3138" />
+      <stop
+         style="stop-color:#ff0000;stop-opacity:0;"
+         offset="1"
+         id="stop3140" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3136"
+       id="radialGradient3142"
+       cx="327.41925"
+       cy="34.101982"
+       fx="327.41925"
+       fy="34.101982"
+       r="130.1324"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4123"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4129"
+       gradientUnits="userSpaceOnUse"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.96164611"
+     inkscape:cx="326.38382"
+     inkscape:cy="89.862869"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="996"
+     inkscape:window-height="714"
+     inkscape:window-x="11"
+     inkscape:window-y="13" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-175.95852,-171.79899)">
+    <rect
+       style="opacity:1;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2160"
+       width="259.97089"
+       height="259.97089"
+       x="185.09927"
+       y="180.93974" />
+    <rect
+       y="176.38744"
+       x="180.54697"
+       height="269.0755"
+       width="269.0755"
+       id="rect2162"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:9.17689896;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    <path
+       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
+       id="path3144" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path3146"
+       sodipodi:cx="303.646"
+       sodipodi:cy="129.98544"
+       sodipodi:rx="0"
+       sodipodi:ry="7.2791853"
+       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
+    <rect
+       y="180.93974"
+       x="185.09927"
+       height="259.97089"
+       width="259.97089"
+       id="rect3134"
+       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotter/icons/led_red_off.svg	Sat Jan 26 11:39:30 2008 +0100
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="278.2525"
+   height="278.2525"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/home/david/Electronic/HP3562/icons"
+   sodipodi:docname="led_red_off.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient4117">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop4119" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop4121" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3136">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3138" />
+      <stop
+         style="stop-color:#aa0000;stop-opacity:0;"
+         offset="1"
+         id="stop3140" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3136"
+       id="radialGradient3142"
+       cx="327.41925"
+       cy="34.101982"
+       fx="327.41925"
+       fy="34.101982"
+       r="130.1324"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(2.5695707e-7,-3.2469858,2.296245,6.8708969e-6,366.91049,1504.183)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4123"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4117"
+       id="linearGradient4129"
+       gradientUnits="userSpaceOnUse"
+       x1="260.95242"
+       y1="121.18842"
+       x2="488.65955"
+       y2="351.48065"
+       gradientTransform="matrix(1.2457226,0,0,1.2615854,-176.7768,-90.496508)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.96164611"
+     inkscape:cx="326.38382"
+     inkscape:cy="69.71549"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="996"
+     inkscape:window-height="714"
+     inkscape:window-x="11"
+     inkscape:window-y="13" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-175.95847,-171.79894)">
+    <rect
+       y="180.93974"
+       x="185.09927"
+       height="259.97089"
+       width="259.97089"
+       id="rect3134"
+       style="opacity:1;fill:url(#radialGradient3142);fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1" />
+    <rect
+       style="opacity:1;fill:#a20000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.29390666;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:0.29390666, 0.29390666;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2160"
+       width="259.97089"
+       height="259.97089"
+       x="185.09927"
+       y="180.93974" />
+    <rect
+       y="176.38744"
+       x="180.54697"
+       height="269.0755"
+       width="269.0755"
+       id="rect2162"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#950000;stroke-width:9.17700005;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+    <path
+       style="fill:url(#linearGradient4129);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 185.09375,180.9375 L 185.09375,352.5625 C 190.93752,352.79982 196.83856,352.9375 202.78125,352.9375 C 312.80014,352.9375 406.95049,311.61044 445.0625,253.25 L 445.0625,180.9375 L 185.09375,180.9375 z "
+       id="path3144" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="path3146"
+       sodipodi:cx="303.646"
+       sodipodi:cy="129.98544"
+       sodipodi:rx="0"
+       sodipodi:ry="7.2791853"
+       d="M 303.646 129.98544 A 0 7.2791853 0 1 1  303.646,129.98544 A 0 7.2791853 0 1 1  303.646 129.98544 z" />
+  </g>
+</svg>
--- a/plotter/qgpib_plotter.py	Fri Jan 25 21:01:30 2008 +0100
+++ b/plotter/qgpib_plotter.py	Sat Jan 26 11:39:30 2008 +0100
@@ -11,8 +11,11 @@
 else:
     from gpib_plotter import GPIBplotter
 from hpgl_qt import QHPGLPlotterWidget
+import hpgl_plotter_rc
 
-form_class, base_class = uic.loadUiType(os.path.join(os.path.dirname(__file__), "qhpgl_plotter.ui"))
+ldir = os.path.abspath(os.path.dirname(__file__))
+sys.path.append(ldir)
+form_class, base_class = uic.loadUiType(os.path.join(ldir, "qhpgl_plotter.ui"))
 
 from qpreferences import PreferenceItem, AbstractPreferences, PreferencesEditor
 
@@ -128,7 +131,13 @@
     def saveTriggered(self, checked=False):
         print "save"
     def saveAsTriggered(self, checked=False):
-        print "saveAs"
+        index = self.plotsView.selectionModel().currentIndex()
+        if index.isValid():
+            filename = QtGui.QFileDialog.getSaveFileName(self, "Selecte a file name to save HPGL file", '.', 'HPGL files (*.plt)\nAll files (*)')
+            n = index.row()
+            value = unicode(self.plotsView.model().data(index, Qt.DisplayRole).toString())
+            open(filename, 'w').write(self._plots[value])
+            
         
     def initializeGPIB(self):
         self._online = False

mercurial