Example #1
0
    def __init__(self, parameters, control_thread, ir_laser, parent):
        LockDisplay.__init__(self, parameters, control_thread, ir_laser,
                             parent)

        # offset display widget setup
        # +-500nm display range hard coded (if qpd is properly calibrated).
        self.offset_min = -500
        self.offset_max = 500
        status_x = self.ui.offsetFrame.width() - 4
        status_y = self.ui.offsetFrame.height() - 4
        self.offsetDisplay = lockDisplayWidgets.QOffsetDisplay(
            status_x,
            status_y,
            self.offset_min,
            self.offset_max,
            self.offset_min + 100,
            self.offset_max - 100,
            has_center_bar=1,
            parent=self.ui.offsetFrame)
        self.offsetDisplay.setGeometry(2, 2, status_x, status_y)

        # sum display widget setup
        self.sum_min = 100
        status_x = self.ui.sumFrame.width() - 4
        status_y = self.ui.sumFrame.height() - 4
        self.sumDisplay = lockDisplayWidgets.QSumDisplay(
            status_x,
            status_y,
            0,
            parameters.get("qpd_sum_max"),
            self.sum_min,
            False,
            parent=self.ui.sumFrame)
        self.sumDisplay.setGeometry(2, 2, status_x, status_y)

        # stage display widget setup
        stage_max = int(2.0 * parameters.get("qpd_zcenter"))
        status_x = self.ui.zFrame.width() - 4
        status_y = self.ui.zFrame.height() - 4
        self.zDisplay = lockDisplayWidgets.QStageDisplay(status_x,
                                                         status_y,
                                                         0,
                                                         stage_max,
                                                         int(0.1 * stage_max),
                                                         int(0.9 * stage_max),
                                                         parent=self.ui.zFrame)
        self.zDisplay.setGeometry(2, 2, status_x, status_y)

        # qpd
        status_x = self.ui.qpdFrame.width() - 4
        status_y = self.ui.qpdFrame.height() - 4
        self.qpdDisplay = lockDisplayWidgets.QQPDDisplay(
            status_x, status_y, 200, parent=self.ui.qpdFrame)
        self.qpdDisplay.setGeometry(2, 2, status_x, status_y)
Example #2
0
    def __init__(self, parameters, control_thread, ir_laser, parent):
        LockDisplay.__init__(self, parameters, control_thread, ir_laser,
                             parent)

        self.filename = ""
        self.save_image = False
        self.show_dot = False
        self.x_offset = 0
        self.y_offset = 0

        self.ui.qpdLabel.setText("Camera")
        self.ui.qpdXText.hide()
        self.ui.qpdYText.hide()

        # offset display widget setup
        # +-500nm display range hard coded (if qpd is properly calibrated).
        self.offset_min = -500
        self.offset_max = 500
        status_x = self.ui.offsetFrame.width() - 4
        status_y = self.ui.offsetFrame.height() - 4
        self.offsetDisplay = lockDisplayWidgets.QOffsetDisplay(
            status_x,
            status_y,
            self.offset_min,
            self.offset_max,
            self.offset_min + 100,
            self.offset_max - 100,
            has_center_bar=1,
            parent=self.ui.offsetFrame)
        self.offsetDisplay.setGeometry(2, 2, status_x, status_y)

        # sum display widget setup
        self.sum_min = 50
        status_x = self.ui.sumFrame.width() - 4
        status_y = self.ui.sumFrame.height() - 4
        self.sumDisplay = lockDisplayWidgets.QSumDisplay(
            status_x,
            status_y,
            0,
            parameters.get("qpd_sum_max"),
            self.sum_min,
            255,
            parent=self.ui.sumFrame)
        self.sumDisplay.setGeometry(2, 2, status_x, status_y)

        # stage display widget setup
        stage_max = int(2.0 * parameters.get("qpd_zcenter"))
        status_x = self.ui.zFrame.width() - 4
        status_y = self.ui.zFrame.height() - 4
        self.zDisplay = lockDisplayWidgets.QStageDisplay(status_x,
                                                         status_y,
                                                         0,
                                                         stage_max,
                                                         int(0.1 * stage_max),
                                                         int(0.9 * stage_max),
                                                         parent=self.ui.zFrame)
        self.zDisplay.setGeometry(2, 2, status_x, status_y)
        self.zDisplay.adjustStage.connect(self.handleAdjustStage)

        # camera display
        status_x = self.ui.qpdFrame.width() - 4
        status_y = self.ui.qpdFrame.height() - 4
        self.camDisplay = lockDisplayWidgets.QCamDisplay(
            parent=self.ui.qpdFrame)
        self.camDisplay.setGeometry(2, 2, status_x, status_y)
        self.camDisplay.adjustCamera.connect(self.handleAdjustAOI)
        self.camDisplay.adjustOffset.connect(self.handleAdjustOffset)
        self.camDisplay.changeFitMode.connect(self.handleChangeFitMode)

        # timer for updating the display of snapshots captured by the camera.
        self.cam_timer = QtCore.QTimer()
        self.cam_timer.setInterval(100)
        self.cam_timer.start()

        self.cam_timer.timeout.connect(self.updateCamera)