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

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
Loading
Loading
Loading
Loading
+9 −3
Changes for myToolbar.py: 9 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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
+2 −1
Changes for myWidgets.py: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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')
+1 −1
Changes for webcamROI.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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)