Commit be243258 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][shift] Emit bool with signal

parent ee9daef4
...@@ -81,7 +81,7 @@ class ShiftCorrectionWidget(qt.QMainWindow): ...@@ -81,7 +81,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
""" """
A widget to apply shift correction to a stack of images A widget to apply shift correction to a stack of images
""" """
computingSignal = qt.Signal() computingSignal = qt.Signal(bool)
def __init__(self, parent=None): def __init__(self, parent=None):
qt.QMainWindow.__init__(self, parent) qt.QMainWindow.__init__(self, parent)
...@@ -158,7 +158,7 @@ class ShiftCorrectionWidget(qt.QMainWindow): ...@@ -158,7 +158,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self._inputDock.widget.correctionB.setEnabled(False) self._inputDock.widget.correctionB.setEnabled(False)
self._inputDock.widget.abortB.show() self._inputDock.widget.abortB.show()
self.thread_correction.start() self.thread_correction.start()
self.computingSignal.emit() self.computingSignal.emit(True)
def abort(self): def abort(self):
self._inputDock.widget.abortB.setEnabled(False) self._inputDock.widget.abortB.setEnabled(False)
...@@ -177,13 +177,13 @@ class ShiftCorrectionWidget(qt.QMainWindow): ...@@ -177,13 +177,13 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self.thread_detection.setArgs(self._dimension, indices=self.indices) self.thread_detection.setArgs(self._dimension, indices=self.indices)
self.thread_detection.finished.connect(self._updateShift) self.thread_detection.finished.connect(self._updateShift)
self.thread_detection.start() self.thread_detection.start()
self.computingSignal.emit() self.computingSignal.emit(True)
def _updateShift(self): def _updateShift(self):
self._inputDock.widget._findShiftB.setEnabled(True) self._inputDock.widget._findShiftB.setEnabled(True)
self.thread_detection.finished.disconnect(self._updateShift) self.thread_detection.finished.disconnect(self._updateShift)
self.shift = numpy.round(self.thread_detection.data[:, 1], 5) self.shift = numpy.round(self.thread_detection.data[:, 1], 5)
self.computingSignal.emit() self.computingSignal.emit(False)
def _updateData(self): def _updateData(self):
""" """
...@@ -193,7 +193,7 @@ class ShiftCorrectionWidget(qt.QMainWindow): ...@@ -193,7 +193,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self._inputDock.widget.abortB.hide() self._inputDock.widget.abortB.hide()
self._inputDock.widget.abortB.setEnabled(True) self._inputDock.widget.abortB.setEnabled(True)
self._inputDock.widget.correctionB.setEnabled(True) self._inputDock.widget.correctionB.setEnabled(True)
self.computingSignal.emit() self.computingSignal.emit(False)
if self.thread_correction.data: if self.thread_correction.data:
self._update_dataset = self.thread_correction.data self._update_dataset = self.thread_correction.data
assert self._update_dataset is not None assert self._update_dataset is not None
......
Supports Markdown
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