From 75704ff29fce07305b647cf7475f007888d2fd49 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 17 Apr 2011 02:31:10 +0200 Subject: [PATCH] add handlers for AMPs/PWMs --- software/modules/ModuleDebug.py | 63 ++++++++++++++++++++++++++++++++- software/modules/ModuleDebug.ui | 18 +++++----- 2 files changed, 71 insertions(+), 10 deletions(-) diff --git a/software/modules/ModuleDebug.py b/software/modules/ModuleDebug.py index db8fa5d..db53549 100644 --- a/software/modules/ModuleDebug.py +++ b/software/modules/ModuleDebug.py @@ -1,7 +1,7 @@ from PyQt4.QtGui import QWidget from PyQt4.QtCore import pyqtSlot -from PyQt4.QtCore import QObject from ModuleDebugUi import Ui_ModuleDebug +#from device import Device class ModuleDebugWidget(QWidget): @@ -9,6 +9,67 @@ class ModuleDebugWidget(QWidget): QWidget.__init__(self) self.ui = Ui_ModuleDebug() self.ui.setupUi(self) +# self.dev = Device() + + @pyqtSlot(int) + def on_dialPWM1_valueChanged(self, val): +# self.dev.pwm(1, val) + print 'pwm1:', val + + @pyqtSlot(int) + def on_dialPWM2_valueChanged(self, val): +# self.dev.pwm(2, val) + print 'pwm2:', val + + @pyqtSlot(int) + def on_dialAMP1_valueChanged(self, val): +# self.dev.opamp(1, val) + print 'amp1:', val + + @pyqtSlot(int) + def on_dialAMP2_valueChanged(self, val): +# self.dev.opamp(2, val) + print 'amp2:', val + + @pyqtSlot(int) + def on_checkOut0_stateChanged(self, state): +# state and self.dev.setout(1<<0) or self.dev.clrout(1<<0) + print 'out0:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut1_stateChanged(self, state): +# state and self.dev.setout(1<<1) or self.dev.clrout(1<<1) + print 'out1:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut2_stateChanged(self, state): +# state and self.dev.setout(1<<2) or self.dev.clrout(1<<2) + print 'out2:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut3_stateChanged(self, state): +# state and self.dev.setout(1<<3) or self.dev.clrout(1<<3) + print 'out3:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut4_stateChanged(self, state): +# state and self.dev.setout(1<<4) or self.dev.clrout(1<<4) + print 'out4:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut5_stateChanged(self, state): +# state and self.dev.setout(1<<5) or self.dev.clrout(1<<5) + print 'out5:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut6_stateChanged(self, state): +# state and self.dev.setout(1<<6) or self.dev.clrout(1<<6) + print 'out6:', state and '1' or '0' + + @pyqtSlot(int) + def on_checkOut7_stateChanged(self, state): +# state and self.dev.setout(1<<7) or self.dev.clrout(1<<7) + print 'out7:', state and '1' or '0' class ModuleDebug(): diff --git a/software/modules/ModuleDebug.ui b/software/modules/ModuleDebug.ui index f8b078a..d93d7c1 100644 --- a/software/modules/ModuleDebug.ui +++ b/software/modules/ModuleDebug.ui @@ -330,7 +330,7 @@ Outputs - + 10 @@ -343,7 +343,7 @@ - + 30 @@ -356,7 +356,7 @@ - + 50 @@ -369,7 +369,7 @@ - + 70 @@ -382,7 +382,7 @@ - + 90 @@ -395,7 +395,7 @@ - + 110 @@ -408,7 +408,7 @@ - + 130 @@ -421,7 +421,7 @@ - + 150 @@ -445,7 +445,7 @@ - 8 7 6 5 4 3 2 1 + 7 6 5 4 3 2 1 0