Commit 5695a92f authored by Martin Drechsler's avatar Martin Drechsler

Two small bugs solved: spinbox blocked only if scan starts, and when canceling...

Two small bugs solved: spinbox blocked only if scan starts, and when canceling the roi window gui doesn't crash.
parent 97463a55
......@@ -147,9 +147,14 @@ class myToolbarMenu(QWidget):
def openRoi(self):
print('opening roi window')
ao = self.getChoiceForRoi()
self.startRoiThread(ao)
items = self.aosDicc.keys()
item, okPressed = QInputDialog.getItem(self, "Get item","Color:", items, 0, False)
if okPressed and item:
ao = self.aosDicc[item]
self.roiW = roiWindow(ao)
self.roiW.w.show()
else:
print('Roi canceled')
def startRoiThread(self, ao):
self.roiW = roiWindow(ao)
......@@ -159,5 +164,6 @@ class myToolbarMenu(QWidget):
items = self.aosDicc.keys()
item, okPressed = QInputDialog.getItem(self, "Get item","Color:", items, 0, False)
if okPressed and item:
self.startRoiThread(item)
return self.aosDicc[item]
\ No newline at end of file
......@@ -137,11 +137,12 @@ class anal_control_signal(QWidget):
self.scan_direction = -abs(b-a)/n # this is the size in voltage of each step
self.scan_step = float(self.sb.val) # from here it beggins
self.sb.setEnabled(False)
if self.scan_step > b or self.scan_step < a:
print('scan can not start outside scan range and scan start should be lower than scan stop')
else:
self.sb.setEnabled(False)
self.scan_button.setStyleSheet("background-color: green")
self.ScanTimer.start(dt*1e3)
self.scan_button.setText('Scanning')
......
......@@ -24,7 +24,7 @@ class roiWindow(QMainWindow):
super().__init__()
self.aoScan = aoScan
print(self.aoScan.name, self.aoScan.sb.val)
print( 'Analog output selected for roi analysis: %s' % (self.aoScan.name) )
self.cap = cv2.VideoCapture(0)
......
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