Commit c3350f58 authored by Martin Drechsler's avatar Martin Drechsler

blink function

parent e364e2b5
......@@ -173,6 +173,8 @@ class GuiMainWindow(QMainWindow):
self.layout866.addWidget(QtGui.QLabel(self.piezoA866.name), 1, 0), self.layout866.addWidget(self.piezoA866.sb, 1, 1)
self.layout866.addWidget(QtGui.QLabel(self.piezoB866.name), 2, 0), self.layout866.addWidget(self.piezoB866.sb, 2, 1)
self.layout866.addWidget(QtGui.QLabel(self.shutter866.name), 3, 0), self.layout866.addWidget(self.shutter866.cb, 3, 1)
self.layout866.addWidget(QtGui.QLabel("Blink"), 3, 2), self.layout866.addWidget(self.shutter866.blink_cb, 3, 3)
self.layout866_scan.addWidget(QtGui.QLabel('866 Scan piezo B'), 0, 0)
self.layout866_scan.addWidget(QtGui.QLabel('start'), 1, 0), self.layout866_scan.addWidget(self.piezoB866.scan_sb_start, 1, 1)
......
......@@ -193,6 +193,13 @@ class digital_control_signal(QWidget):
self.cb = QtGui.QCheckBox()
self.cb.stateChanged.connect(self.whenChangeDigital)
self.blink_cb = QtGui.QCheckBox()
self.blink_cb.stateChanged.connect(self.blink)
self.blink_timer = QTimer()
self.blink_timer.timeout.connect(self._blinkEvent)
self.blink_variable = True
def set_name(self, name):
self.name = name
......@@ -202,6 +209,23 @@ class digital_control_signal(QWidget):
def whenChangeDigital(self):
self.DO.set_out(not self.cb.isChecked())
def blink(self):
if self.blink_cb.isChecked():
self.blink_variable = self.cb.isChecked()
self.blink_timer.start(1000)
print("starting blinkin")
else:
self.blink_timer.stop()
self.DO.set_out( self.cb.isChecked() )
print("finishing blink")
def _blinkEvent(self):
self.blink_variable = not self.blink_variable
self.DO.set_out(self.blink_variable)
class activation_button(QWidget):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment