Commit 25631830 authored by Martin Drechsler's avatar Martin Drechsler

some indenation fixing

parent 8ba0a33b
...@@ -19,8 +19,7 @@ import numpy as np ...@@ -19,8 +19,7 @@ import numpy as np
class GuiMainWindow(QMainWindow): class GuiMainWindow(QMainWindow):
def __init__(self):
def __init__(self):
super().__init__() super().__init__()
...@@ -31,7 +30,7 @@ class GuiMainWindow(QMainWindow): ...@@ -31,7 +30,7 @@ class GuiMainWindow(QMainWindow):
self.initUI() self.initUI()
def initUI(self): def initUI(self):
self.win = QtGui.QMainWindow() self.win = QtGui.QMainWindow()
self.win.setWindowTitle('Toy GUI') self.win.setWindowTitle('Toy GUI')
...@@ -91,24 +90,24 @@ class GuiMainWindow(QMainWindow): ...@@ -91,24 +90,24 @@ class GuiMainWindow(QMainWindow):
def make_connections(self, backend): def make_connections(self, backend):
##backend connections ##backend connections
backend.imageReadySignal.connect(self.updateImage) backend.imageReadySignal.connect(self.updateImage)
##internal connections ##internal connections
self.frames_checker_timer.timeout.connect(self.frame_counter) self.frames_checker_timer.timeout.connect(self.frame_counter)
self.cameraButton.clicked.connect(lambda x = backend.isCameraAcquiring: self.camera_button_pressed(x)) self.cameraButton.clicked.connect(lambda x = backend.isCameraAcquiring: self.camera_button_pressed(x))
def camera_button_pressed(self, isCameraAcquiring): def camera_button_pressed(self, isCameraAcquiring):
if isCameraAcquiring: if isCameraAcquiring:
self.frames_checker_timer.stop() self.frames_checker_timer.stop()
else: else:
self.frame_index = 0 self.frame_index = 0
self.previous_frame_index = 0 self.previous_frame_index = 0
self.frames_checker_timer.start(1000) self.frames_checker_timer.start(1000)
def _initialize_image(self): def _initialize_image(self):
## lock the aspect ratio so pixels are always square ## lock the aspect ratio so pixels are always square
self.view.setAspectLocked(True) self.view.setAspectLocked(True)
self.view.addItem(self.img) self.view.addItem(self.img)
...@@ -117,7 +116,7 @@ class GuiMainWindow(QMainWindow): ...@@ -117,7 +116,7 @@ class GuiMainWindow(QMainWindow):
self.previous_frame_index = 0 self.previous_frame_index = 0
self.frames_checker_timer.start(1000) self.frames_checker_timer.start(1000)
def updateRois(self): def updateRois(self):
for roi in self.rois: for roi in self.rois:
...@@ -129,8 +128,8 @@ class GuiMainWindow(QMainWindow): ...@@ -129,8 +128,8 @@ class GuiMainWindow(QMainWindow):
self.curve.setData(self.ROIdata) self.curve.setData(self.ROIdata)
@QtCore.pyqtSlot(np.ndarray, int) @QtCore.pyqtSlot(np.ndarray, int)
def updateImage(self, image, acq_index): def updateImage(self, image, acq_index):
if self.frame_index is not 0 and not self.frame_index == acq_index: if self.frame_index is not 0 and not self.frame_index == acq_index:
print('Dephasing in camera gui has occured: while frame index is %i, the acq index is %i' % (self.frame_index, acq_index)) print('Dephasing in camera gui has occured: while frame index is %i, the acq index is %i' % (self.frame_index, acq_index))
...@@ -142,14 +141,14 @@ class GuiMainWindow(QMainWindow): ...@@ -142,14 +141,14 @@ class GuiMainWindow(QMainWindow):
def frame_counter(self): def frame_counter(self):
self.counter = self.counter + 1 self.counter = self.counter + 1
self.label.setText('Frames in last second: ' + str(self.frame_index-self.previous_frame_index) + ' ' + 'Seconds since start: ' + str(self.counter)) self.label.setText('Frames in last second: ' + str(self.frame_index-self.previous_frame_index) + ' ' + 'Seconds since start: ' + str(self.counter))
self.previous_frame_index = self.frame_index self.previous_frame_index = self.frame_index
def __del__(self): def __del__(self):
print('chau gui') print('chau gui')
############################################################################### ###############################################################################
......
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