def test_cameraCurrentFps(self, qtbot): ccWidget = CameraControlWidget() ccWidget.show() qtbot.addWidget(ccWidget) cc = CameraController(ccWidget) cc.setupCamera("GaussianCamera") qtbot.mouseClick(ccWidget.startStopButton, Qt.LeftButton) #cc.startStopCamera(True) fps = cc.currentCameraFps() assert fps == 24 qtbot.mouseClick(ccWidget.acquireRoiCheckBox, Qt.LeftButton) fps = cc.currentCameraFps() assert fps == 40
def test_cameraAcquireRoiFrames(self, qtbot): ccWidget = CameraControlWidget() ccWidget.show() qtbot.addWidget(ccWidget) cc = CameraController(ccWidget) cc.setupCamera("GaussianCamera") qtbot.mouseClick(ccWidget.startStopButton, Qt.LeftButton) #cc.startStopCamera(True) qtbot.mouseClick(ccWidget.acquireFramesButton, Qt.LeftButton) qtbot.mouseClick(ccWidget.acquireRoiCheckBox, Qt.LeftButton) interval = int( (1 / cc.currentCameraFps()) * ONE_SECOND_IN_MILLISECONDS) assert cc.frameTimer.interval() == interval qtbot.mouseClick(ccWidget.acquireRoiCheckBox, Qt.LeftButton) interval = int( (1 / cc.currentCameraFps()) * ONE_SECOND_IN_MILLISECONDS) assert cc.frameTimer.interval() == interval qtbot.mouseClick(ccWidget.acquireFramesButton, Qt.LeftButton)
def test_autoRun(self, qtbot): ccWidget = CameraControlWidget() ccWidget.show() qtbot.addWidget(ccWidget) cc = CameraController(ccWidget) cc.setupCamera("GaussianCamera") cc.doAutoRun = True cc.autoRun() fps = cc.currentCameraFps() assert fps == 40
def test_stateAtAcquireFramesStop(self, qtbot): ccWidget = CameraControlWidget() ccWidget.show() qtbot.addWidget(ccWidget) cc = CameraController(ccWidget) cc.setupCamera("GaussianCamera") qtbot.mouseClick(ccWidget.startStopButton, Qt.LeftButton) #cc.startStopCamera(True) qtbot.mouseClick(ccWidget.acquireFramesButton, Qt.LeftButton) qtbot.mouseClick(ccWidget.acquireRoiCheckBox, Qt.LeftButton) assert cc.isRoiMode() is True qtbot.mouseClick(ccWidget.acquireFramesButton, Qt.LeftButton) assert cc.isRoiMode() is False assert cc.currentCameraFps() == 24 assert ccWidget.acquireFramesButton.isChecked() is False