Begin of a HPGL plotter application (PyQt4)

Fri, 11 Jan 2008 18:50:46 +0100

author
David Douard <david.douard@logilab.fr>
date
Fri, 11 Jan 2008 18:50:46 +0100
changeset 22
b2f4646161be
parent 21
66b7cd43bac1
child 23
cb97962a1ae9

Begin of a HPGL plotter application (PyQt4)

qgpib_plotter.py file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qgpib_plotter.py	Fri Jan 11 18:50:46 2008 +0100
@@ -0,0 +1,34 @@
+#
+
+from PyQt4 import QtGui, QtCore
+from PyQt4.QtCore import SIGNAL, Qt
+
+from gppib_plotter import GPIBplotter
+from hpgl_qt import QHPGLPlotterWidget
+
+ORGANISATION="Logilab"
+APPLICATION="qgpib_plotter"
+def variant(v):
+    _cvrts = {1: lambda x:x.toInt(),
+              10: lambda x:unicode(x.toString()),
+              }
+    t = v.userType()
+
+class Preferences(object):
+    _defaults = {'device': '/dev/ttyUSB0',
+                 'address': 0,
+                 }
+    def __init__(self):
+        self._settings = qc.QSettings(qc.QSettings.UserScope,
+                                      ORGANISATION, APPLICATION)
+
+    def getPref(self, key):
+        val = self._settings.value(key, QtCore.QVariant(self._defaults[key])) 
+
+            
+class QtHPGLPlotter(QtGui.QMainWindow):
+    def __init__(self, parent=None):
+        QtGui.QMainWindow.__init__(self, parent)
+        self.gpib_plotter = GPIBplotter(
+
+        

mercurial