Ejemplo n.º 1
0
    def __init__(self, parent, axes=[], id=-1, color=None, dpi=None, **kwargs):
        """
        """
        PlotPanel.__init__(self, parent, id=id, xtransform='x', ytransform='y',
                           color=color, dpi=dpi,
                           size=(_STATICBOX_WIDTH, PANEL_SIZE - 100), **kwargs)

        # Keep track of the parent Frame
        self.parent = parent
        self.window_name = "Scattering Length Density Profile"
        self.window_caption = self.window_name
        self.prevXtrans = "x"
        self.prevYtrans = "y"
        self.viewModel = "--"
        # Internal list of plottable names (because graph
        # doesn't have a dictionary of handles for the plottables)
        self.plots = {}
        self.graph = Graph()
        self.axes_label = []
        for idx in range(0, len(axes)):
            self.axes_label.append(axes[idx])
        self.xaxis_label = ''
        self.xaxis_unit = ''
        self.yaxis_label = ''
        self.yaxis_unit = ''
        self.resizing = True
        self.xcolor = 'black'
        self.ycolor = 'black'
Ejemplo n.º 2
0
    def __init__(self, parent, axes=[], id=-1, color=None, dpi=None, **kwargs):
        """
        """
        PlotPanel.__init__(self,
                           parent,
                           id=id,
                           xtransform='x',
                           ytransform='y',
                           color=color,
                           dpi=dpi,
                           size=(_STATICBOX_WIDTH, PANEL_SIZE - 100),
                           **kwargs)

        # Keep track of the parent Frame
        self.parent = parent
        self.window_name = "Scattering Length Density Profile"
        self.window_caption = self.window_name
        self.prevXtrans = "x"
        self.prevYtrans = "y"
        self.viewModel = "--"
        # Internal list of plottable names (because graph
        # doesn't have a dictionary of handles for the plottables)
        self.plots = {}
        self.graph = Graph()
        self.axes_label = []
        for idx in range(0, len(axes)):
            self.axes_label.append(axes[idx])
        self.xaxis_label = ''
        self.xaxis_unit = ''
        self.yaxis_label = ''
        self.yaxis_unit = ''
        self.resizing = True
        self.xcolor = 'black'
        self.ycolor = 'black'
Ejemplo n.º 3
0
    def __init__(self,
                 parent,
                 id=-1,
                 data2d=None,
                 color=None,
                 dpi=None,
                 style=wx.NO_FULL_REPAINT_ON_RESIZE,
                 **kwargs):
        """
        Initialize the panel
        """
        ModelPanel1D.__init__(self, parent, id=id, style=style, **kwargs)
        self.parent = parent
        ## Reference to the parent window
        if hasattr(parent, "parent"):
            self.parent = self.parent.parent
        ## Dictionary containing Plottables
        self.plots = {}
        ## Save reference of the current plotted
        self.data2D = data2d
        ## Unique ID (from gui_manager)
        self.uid = None
        ## Action IDs for internal call-backs
        self.action_ids = {}
        ## Create Artist and bind it
        self.connect = BindArtist(self.subplot.figure)
        ## Beam stop
        self.beamstop_radius = DEFAULT_BEAM
        ## to set the order of lines drawn first.
        self.slicer_z = 5
        ## Reference to the current slicer
        self.slicer = None
        ## event to send slicer info
        self.Bind(EVT_INTERNAL, self._onEVT_INTERNAL)

        self.axes_frozen = False
        ## panel that contains result from slicer motion (ex: Boxsum info)
        self.panel_slicer = None
        self.title_label = None
        self.title_font = None
        self.title_color = 'black'
        ## Graph
        self.graph = Graph()
        self.graph.xaxis("\\rm{Q}", 'A^{-1}')
        self.graph.yaxis("\\rm{Intensity} ", "cm^{-1}")
        self.graph.render(self)
        ## store default value of zmin and zmax
        self.default_zmin_ctl = self.zmin_2D
        self.default_zmax_ctl = self.zmax_2D
Ejemplo n.º 4
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
Ejemplo n.º 5
0
    def __init__(self, parent, id=-1, data2d=None, color=None,
                 dpi=None, style=wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
        """
        Initialize the panel
        """
        ModelPanel1D.__init__(self, parent, id=id, style=style, **kwargs)
        self.parent = parent
        ## Reference to the parent window
        if hasattr(parent, "parent"):
            self.parent = self.parent.parent
        ## Dictionary containing Plottables
        self.plots = {}
        ## Save reference of the current plotted
        self.data2D = data2d
        ## Unique ID (from gui_manager)
        self.uid = None
        ## Action IDs for internal call-backs
        self.action_ids = {}
        ## Create Artist and bind it
        self.connect = BindArtist(self.subplot.figure)
        ## Beam stop
        self.beamstop_radius = DEFAULT_BEAM
        ## to set the order of lines drawn first.
        self.slicer_z = 5
        ## Reference to the current slicer
        self.slicer = None
        ## event to send slicer info
        self.Bind(EVT_INTERNAL, self._onEVT_INTERNAL)

        self.axes_frozen = False
        ## panel that contains result from slicer motion (ex: Boxsum info)
        self.panel_slicer = None
        self.title_label = None
        self.title_font = None
        self.title_color = 'black'
        ## Graph
        self.graph = Graph()
        self.graph.xaxis("\\rm{Q}", 'A^{-1}')
        self.graph.yaxis("\\rm{Intensity} ", "cm^{-1}")
        self.graph.render(self)
        ## store default value of zmin and zmax
        self.default_zmin_ctl = self.zmin_2D
        self.default_zmax_ctl = self.zmax_2D