Commit 25631830 authored by Martin Drechsler's avatar Martin Drechsler

some indenation fixing

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