示例#1
0
    def test_noneForRoiFramePassedValues(self, qtbot):
        cdw = CameraDataWidget()
        cdw.show()
        qtbot.addWidget(cdw)

        rfi = None
        cdw.updateRoiFrameData(rfi)

        assert cdw.bufferUpdatedValueLabel.text() == NO_DATA_VALUE
        assert cdw.accumPeriodValueLabel.text() == NO_DATA_VALUE
        assert cdw.fluxValueLabel.text() == NO_DATA_VALUE
        assert cdw.maxAdcValueLabel.text() == NO_DATA_VALUE
        assert cdw.fwhmValueLabel.text() == NO_DATA_VALUE
        assert cdw.centroidXLabel.text() == NO_DATA_VALUE
        assert cdw.centroidYLabel.text() == NO_DATA_VALUE
        assert cdw.rmsXLabel.text() == NO_DATA_VALUE
        assert cdw.rmsYLabel.text() == NO_DATA_VALUE
示例#2
0
    def test_roiFramePassedValues(self, qtbot, mocker):
        cdw = CameraDataWidget()
        cdw.show()
        qtbot.addWidget(cdw)

        rfi = RoiFrameInformation(243.23, 354.97, 2763.58328, 103.53245,
                                  14.2542, 1.4335, 1.97533, (1000, 25.0))
        cdw.updateRoiFrameData(rfi)

        assert cdw.bufferUpdatedValueLabel.text() != NO_DATA_VALUE
        assert cdw.accumPeriodValueLabel.text() == self.formatFloatText(
            rfi.validFrames[1])
        assert cdw.centroidXLabel.text() == self.formatFloatText(rfi.centerX)
        assert cdw.centroidYLabel.text() == self.formatFloatText(rfi.centerY)
        assert cdw.fluxValueLabel.text() == self.formatFloatText(rfi.flux)
        assert cdw.maxAdcValueLabel.text() == self.formatFloatText(rfi.maxAdc)
        assert cdw.fwhmValueLabel.text() == self.formatFloatText(rfi.fwhm)
        assert cdw.rmsXLabel.text() == self.formatFloatText(rfi.rmsX)
        assert cdw.rmsYLabel.text() == self.formatFloatText(rfi.rmsY)