mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-07 20:34:00 +02:00
power on/off
This commit is contained in:
parent
19bd37a530
commit
6eed75a81b
2 changed files with 15 additions and 37 deletions
|
@ -51,29 +51,20 @@ class ModuleCWidget(QWidget):
|
|||
self.mode[1] = 'LC'
|
||||
self.setup_hw()
|
||||
|
||||
@pyqtSlot()
|
||||
def on_btnStart_clicked(self):
|
||||
self.ui.btnStart.setEnabled(False)
|
||||
self.ui.btnStop.setEnabled(True)
|
||||
self.current = 3.3
|
||||
@pyqtSlot(bool)
|
||||
def on_btnPower_clicked(self, checked):
|
||||
if checked:
|
||||
self.current = 3.3
|
||||
self.ui.btnPower.setText('ON')
|
||||
else:
|
||||
self.current = 0.0
|
||||
self.ui.btnPower.setText('OFF')
|
||||
if self.mode == ['DC', 'L']:
|
||||
self.dev.setout(1, 1)
|
||||
self.dev.setout(1, checked and 1 or 0)
|
||||
if self.mode == ['DC', 'C']:
|
||||
self.dev.setout(2, 1)
|
||||
self.dev.setout(2, checked and 1 or 0)
|
||||
if self.mode == ['DC', 'LC']:
|
||||
self.dev.setout(3, 1)
|
||||
|
||||
@pyqtSlot()
|
||||
def on_btnStop_clicked(self):
|
||||
self.ui.btnStart.setEnabled(True)
|
||||
self.ui.btnStop.setEnabled(False)
|
||||
self.current = 0.0
|
||||
if self.mode == ['DC', 'L']:
|
||||
self.dev.setout(1, 0)
|
||||
if self.mode == ['DC', 'C']:
|
||||
self.dev.setout(2, 0)
|
||||
if self.mode == ['DC', 'LC']:
|
||||
self.dev.setout(3, 0)
|
||||
self.dev.setout(3, checked and 1 or 1)
|
||||
|
||||
def setup_hw(self):
|
||||
if self.mode == ['DC', 'L']: # AD6
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btnStart">
|
||||
<widget class="QPushButton" name="btnPower">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
|
@ -146,23 +146,10 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btnStop">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>280</y>
|
||||
<width>81</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue