Exemplo n.º 1
0
    def create_1d_panel(self, data, group_id):
        """
        """
        # Create a new plot panel if none was available
        if issubclass(data.__class__, Data1D):
            from Plotter1D import ModelPanel1D
            ## get the data representation label of the data to plot
            ## when even the user select "change scale"
            xtransform = data.xtransform
            ytransform = data.ytransform
            ## create a plotpanel for 1D Data
            win = MDIFrame(self.parent, None, 'None', (100, 200))
            new_panel = ModelPanel1D(win,
                                     -1,
                                     xtransform=xtransform,
                                     ytransform=ytransform,
                                     style=wx.RAISED_BORDER)
            win.set_panel(new_panel)
            win.Show(False)
            new_panel.frame = win
            #win.Show(True)
            return new_panel

        msg = "1D Panel of group ID %s could not be created" % str(group_id)
        raise ValueError, msg
Exemplo n.º 2
0
 def create_2d_panel(self, data, group_id):
     """
     """
     if issubclass(data.__class__, Data2D):
         ##Create a new plotpanel for 2D data
         from Plotter2D import ModelPanel2D
         scale = data.scale
         win = MDIFrame(self.parent, None, 'None', (200, 150))
         win.Show(False)
         new_panel = ModelPanel2D(win,
                                  id=-1,
                                  data2d=data,
                                  scale=scale,
                                  style=wx.RAISED_BORDER)
         win.set_panel(new_panel)
         new_panel.frame = win
         return new_panel
     msg = "2D Panel of group ID %s could not be created" % str(group_id)
     raise ValueError, msg