|
1 # |
|
2 |
|
3 from PyQt4 import QtGui, QtCore |
|
4 from PyQt4.QtCore import SIGNAL, Qt |
|
5 |
|
6 from gppib_plotter import GPIBplotter |
|
7 from hpgl_qt import QHPGLPlotterWidget |
|
8 |
|
9 ORGANISATION="Logilab" |
|
10 APPLICATION="qgpib_plotter" |
|
11 def variant(v): |
|
12 _cvrts = {1: lambda x:x.toInt(), |
|
13 10: lambda x:unicode(x.toString()), |
|
14 } |
|
15 t = v.userType() |
|
16 |
|
17 class Preferences(object): |
|
18 _defaults = {'device': '/dev/ttyUSB0', |
|
19 'address': 0, |
|
20 } |
|
21 def __init__(self): |
|
22 self._settings = qc.QSettings(qc.QSettings.UserScope, |
|
23 ORGANISATION, APPLICATION) |
|
24 |
|
25 def getPref(self, key): |
|
26 val = self._settings.value(key, QtCore.QVariant(self._defaults[key])) |
|
27 |
|
28 |
|
29 class QtHPGLPlotter(QtGui.QMainWindow): |
|
30 def __init__(self, parent=None): |
|
31 QtGui.QMainWindow.__init__(self, parent) |
|
32 self.gpib_plotter = GPIBplotter( |
|
33 |
|
34 |