Exemplo n.º 1
0
    def test_reset(self, qtbot):
        cdw = CameraDataWidget()
        cdw.show()
        qtbot.addWidget(cdw)

        cdw.bufferUpdatedValueLabel.setText(str(datetime.now()))
        cdw.accumPeriodValueLabel.setText('25.0')
        cdw.centroidXLabel.setText('300.24')
        cdw.centroidYLabel.setText('242.53')
        cdw.fluxValueLabel.setText('2532.42')
        cdw.fwhmValueLabel.setText('14.53')
        cdw.maxAdcValueLabel.setText('453.525')
        cdw.rmsXLabel.setText('0.353')
        cdw.rmsYLabel.setText('1.533')

        cdw.reset()

        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
Exemplo n.º 2
0
    def test_defaulTextValues(self, qtbot):
        cdw = CameraDataWidget()
        cdw.show()
        qtbot.addWidget(cdw)

        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
Exemplo n.º 3
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
Exemplo n.º 4
0
    def test_fullFramePassedValues(self, qtbot):
        cdw = CameraDataWidget()
        cdw.show()
        qtbot.addWidget(cdw)

        ffi = FullFrameInformation(200, 342, 4032.428492, 170.482945, 12.7264)
        cdw.updateFullFrameData(ffi)

        assert cdw.bufferUpdatedValueLabel.text() == NO_DATA_VALUE
        assert cdw.accumPeriodValueLabel.text() == NO_DATA_VALUE
        assert cdw.centroidXLabel.text() == str(ffi.centerX)
        assert cdw.centroidYLabel.text() == str(ffi.centerY)
        assert cdw.fluxValueLabel.text() == self.formatFloatText(ffi.flux)
        assert cdw.maxAdcValueLabel.text() == self.formatFloatText(ffi.maxAdc)
        assert cdw.fwhmValueLabel.text() == self.formatFloatText(ffi.fwhm)
        assert cdw.rmsXLabel.text() == NO_DATA_VALUE
        assert cdw.rmsYLabel.text() == NO_DATA_VALUE
Exemplo n.º 5
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)