Esempio n. 1
0
    def test_marking_line_overlay(self):
        cnvs = miccanvas.TwoDPlotCanvas(self.panel)
        mlol = cnvs.markline_overlay
        self.add_control(cnvs, wx.EXPAND, proportion=1, clear=True)

        rgb = numpy.empty((30, 200, 3), dtype=numpy.uint8)
        data = model.DataArray(rgb)
        cnvs.set_2d_data(data, unit_x='m', unit_y='m',
                         range_x=[200e-9, 500e-9], range_y=[0, 20e-6])

        test.gui_loop()

        mlol.val.value = (201e-9, 10e-6)
        cnvs.Refresh()

        test.gui_loop(0.5)
        mlol.orientation = vol.MarkingLineOverlay.HORIZONTAL
        cnvs.Refresh()

        test.gui_loop(0.5)
        mlol.orientation = vol.MarkingLineOverlay.VERTICAL
        mlol.val.value = (301e-9, 12e-6)
        cnvs.Refresh()

        test.gui_loop(0.5)
        mlol.orientation = vol.MarkingLineOverlay.HORIZONTAL | vol.MarkingLineOverlay.VERTICAL
        mlol.val.value = (401e-9, 20e-6)
        cnvs.Refresh()

        test.gui_loop(0.5)
        # Out of the range
        mlol.val.value = (0, 0)
        cnvs.Refresh()
        test.gui_loop(0.5)
Esempio n. 2
0
    def test_onedimensional_canvas(self):
        cnvs = miccanvas.TwoDPlotCanvas(self.panel)
        cnvs.SetBackgroundColour("#00599B")
        self.add_control(cnvs, wx.EXPAND, proportion=1)

        im_data = generate_img_data(200, 10, 4)

        cnvs.set_2d_data(im_data)
        cnvs.update_drawing()

        test.gui_loop(0.2)