diff -r 66b7cd43bac1 -r b2f4646161be qgpib_plotter.py --- /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( + +