예제 #1
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     ScrolledPanel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     self.SetupScrolling()
     #Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     # chemeical formula, string
     self.compound = ''
     # value of the density/volume, float
     self.input = None
     # text controls
     self.compound_ctl = None
     self.input_ctl = None
     self.molar_mass_ctl = None
     self.output_ctl = None
     self.ctr_color = self.GetBackgroundColour()
     # button
     self.button_calculate = None
     # list
     self._input_list = _INPUTS
     self._input = self._input_list[1]
     self._output = self._input_list[0]
     self._unit_list = _UNITS
     #Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
예제 #2
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     #Font size 
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     self.wavelength = WAVELENGTH
     self.parent = parent
     #layout attribute
     self.compound_ctl = None
     self.density_ctl = None
     self.compound = ""
     self.density = ""
     self.wavelength_ctl = None
     self.neutron_sld_real_ctl = None
     self.neutron_sld_im_ctl = None
     self.mo_ka_sld_real_ctl = None
     self.mo_ka_sld_im_ctl = None
     self.cu_ka_sld_real_ctl = None
     self.cu_ka_sld_im_ctl = None
     self.neutron_abs_ctl = None
     self.neutron_inc_ctl = None
     self.neutron_length_ctl = None
     self.button_calculate = None
     #Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
예제 #3
0
 def __init__(self, parent, id=-1, type=None, base=None,
              params=None, *args, **kwargs):
     wx.Panel.__init__(self, parent, id, *args, **kwargs)
     PanelBase.__init__(self)
     ##  Initialization of the class
     self.base = base
     if params is None:
         params = {}
     self.params = params
     self.parent = base.parent
     self.frame = None
     self.type = type
     self.listeners = []
     self.parameters = []
     self.bck = wx.GridBagSizer(5, 5)
     self.SetSizer(self.bck)
     if type == None and params == None:
         label = "Right-click on 2D plot for slicer options"
         title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
         self.bck.Add(title, (0, 0), (1, 2),
                      flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
     else:
         self.set_slicer(type, params)
     ## Bindings
     self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
     self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
예제 #4
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     #Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     self.wavelength = WAVELENGTH
     #layout attribute
     self.compound_ctl = None
     self.density_ctl = None
     self.compound = ""
     self.density = ""
     self.wavelength_ctl = None
     self.neutron_sld_real_ctl = None
     self.neutron_sld_im_ctl = None
     self.mo_ka_sld_real_ctl = None
     self.mo_ka_sld_im_ctl = None
     self.cu_ka_sld_real_ctl = None
     self.cu_ka_sld_im_ctl = None
     self.neutron_abs_ctl = None
     self.neutron_inc_ctl = None
     self.neutron_length_ctl = None
     self.button_calculate = None
     #Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
예제 #5
0
 def __init__(self, parent):
     wx.ScrolledWindow.__init__(self, parent,
              style=wx.FULL_REPAINT_ON_RESIZE)
     PanelBase.__init__(self, parent)
     msg = "right click on the data when it is highlighted "
     msg += "the select option to fit for futher options"
     self.do_layout()
예제 #6
0
 def __init__(self, parent):
     wx.ScrolledWindow.__init__(self, parent,
              style=wx.FULL_REPAINT_ON_RESIZE)
     PanelBase.__init__(self, parent)
     msg = "right click on the data when it is highlighted "
     msg += "the select option to fit for futher options"
     self.do_layout()
예제 #7
0
 def __init__(self,
              parent,
              id=-1,
              type=None,
              base=None,
              params=None,
              *args,
              **kwargs):
     wx.Panel.__init__(self, parent, id, *args, **kwargs)
     PanelBase.__init__(self)
     ##  Initialization of the class
     self.base = base
     if params is None:
         params = {}
     self.params = params
     self.parent = base.parent
     self.frame = None
     self.type = type
     self.listeners = []
     self.parameters = []
     self.bck = wx.GridBagSizer(5, 5)
     self.SetSizer(self.bck)
     if type == None and params == None:
         label = "Right-click on 2D plot for slicer options"
         title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
         self.bck.Add(title, (0, 0), (1, 2),
                      flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL,
                      border=15)
     else:
         self.set_slicer(type, params)
     ## Bindings
     self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
     self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
예제 #8
0
 def __init__(self, parent, base=None, *args, **kwds):
     """
     """
     ScrolledPanel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     self.SetupScrolling()
     # Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.base = base
     self.parent = parent
     # chemeical formula, string
     self.compound = ""
     # value of the density/volume, float
     self.input = None
     # text controls
     self.compound_ctl = None
     self.input_ctl = None
     self.molar_mass_ctl = None
     self.output_ctl = None
     self.ctr_color = self.GetBackgroundColour()
     # button
     self.button_calculate = None
     # list
     self._input_list = _INPUTS
     self._input = self._input_list[1]
     self._output = self._input_list[0]
     self._unit_list = _UNITS
     # Draw the panel
     self._do_layout()
     self.SetAutoLayout(True)
     self.Layout()
예제 #9
0
    def __init__(self, parent, id=-1, plots=None, standalone=False, **kwargs):
        """
        """
        ScrolledPanel.__init__(self, parent, id=id, **kwargs)
        PanelBase.__init__(self, parent)
        self.SetupScrolling()
        #Set window's font size
        self.SetWindowVariant(variant=FONT_VARIANT)

        self.plots = plots
        self.radio_buttons = {}
        self.parent = parent.parent

        ## Data file TextCtrl
        self.data_file = None
        self.plot_data = None
        self.nfunc_ctl = None
        self.alpha_ctl = None
        self.dmax_ctl = None
        self.time_ctl = None
        self.chi2_ctl = None
        self.osc_ctl = None
        self.file_radio = None
        self.plot_radio = None
        self.label_sugg = None
        self.qmin_ctl = None
        self.qmax_ctl = None
        self.swidth_ctl = None
        self.sheight_ctl = None

        self.rg_ctl = None
        self.iq0_ctl = None
        self.bck_chk = None
        self.bck_ctl = None

        # TextCtrl for fraction of positive P(r)
        self.pos_ctl = None

        # TextCtrl for fraction of 1 sigma positive P(r)
        self.pos_err_ctl = None

        ## Estimates
        self.alpha_estimate_ctl = None
        self.nterms_estimate_ctl = None
        ## D_max distance explorator
        self.distance_explorator_ctl = None
        ## Data manager
        self._manager = None
        ## Standalone flage
        self.standalone = standalone
        ## Default file location for save
        self._default_save_location = os.getcwd()
        if self.parent is not None:
            self._default_save_location = \
                        self.parent._default_save_location

        # Default width
        self._default_width = 350
        self._do_layout()
예제 #10
0
    def __init__(self, parent, id=-1, plots=None, **kwargs):
        """
        """
        ScrolledPanel.__init__(self, parent, id=id, **kwargs)
        PanelBase.__init__(self, parent)
        self.SetupScrolling()
        #Set window's font size
        self.SetWindowVariant(variant=FONT_VARIANT)

        self.plots = plots
        self.radio_buttons = {}
        self.parent = parent.parent

        ## Data file TextCtrl
        self.data_file = None
        self.plot_data = None
        self.nfunc_ctl = None
        self.alpha_ctl = None
        self.dmax_ctl = None
        self.time_ctl = None
        self.chi2_ctl = None
        self.osc_ctl = None
        self.file_radio = None
        self.plot_radio = None
        self.label_sugg = None
        self.qmin_ctl = None
        self.qmax_ctl = None
        self.swidth_ctl = None
        self.sheight_ctl = None

        self.rg_ctl = None
        self.iq0_ctl = None
        self.bck_chk = None
        self.bck_ctl = None

        # TextCtrl for fraction of positive P(r)
        self.pos_ctl = None

        # TextCtrl for fraction of 1 sigma positive P(r)
        self.pos_err_ctl = None

        ## Estimates
        self.alpha_estimate_ctl = None
        self.nterms_estimate_ctl = None
        ## D_max distance explorator
        self.distance_explorator_ctl = None
        ## Data manager
        self._manager = None
        ## Default file location for save
        self._default_save_location = os.getcwd()
        if self.parent is not None:
            self._default_save_location = \
                        self.parent._default_save_location

        # Default width
        self._default_width = 350
        self._do_layout()
 def __init__(self, parent, *args, **kwds):
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     # Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.parent = parent
     self.kiessig = KiessigThicknessCalculator()
     # layout attribute
     self.hint_sizer = None
     self._do_layout()
예제 #12
0
 def __init__(self, parent, *args, **kwds):
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     #Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     # Object that receive status event
     self.parent = parent
     self.kiessig = KiessigThicknessCalculator()
     #layout attribute
     self.hint_sizer = None
     self._do_layout()
예제 #13
0
 def __init__(self, parent, *args, **kwds):
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     #Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     #thread to read data
     self.reader = None
     # Default location
     self._default_save_location = os.getcwd()
     # Object that receive status event
     self.parent = parent
     self._do_layout()
 def __init__(self, parent, *args, **kwds):
     wx.Panel.__init__(self, parent, *args, **kwds)
     PanelBase.__init__(self)
     #Font size 
     self.SetWindowVariant(variant=FONT_VARIANT)
     #thread to read data 
     self.reader = None
     # Default location
     self._default_save_location = os.getcwd()
     # Object that receive status event
     self.parent = parent
     self._do_layout()
예제 #15
0
 def __init__(self, parent, manager=None, *args, **kwargs):
     """
     """
     style = ((wx.aui.AUI_NB_WINDOWLIST_BUTTON
              | wx.aui.AUI_NB_DEFAULT_STYLE
              | wx.CLIP_CHILDREN)
              & ~wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB)
     Notebook.__init__(self, parent, -1, style=style)
     PanelBase.__init__(self, parent)
     self.frame = parent
     self.Bind(EVT_PLOT_RESULT, self.on_plot_results)
     self.frame.Bind(wx.EVT_CLOSE, self.on_close)
     self._manager = None
예제 #16
0
 def __init__(self, parent, manager=None, *args, **kwargs):
     """
     """
     style = ((wx.aui.AUI_NB_WINDOWLIST_BUTTON
              | wx.aui.AUI_NB_DEFAULT_STYLE
              | wx.CLIP_CHILDREN)
              & ~wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB)
     Notebook.__init__(self, parent, -1, style=style)
     PanelBase.__init__(self, parent)
     self.frame = parent
     self.Bind(EVT_PLOT_RESULT, self.on_plot_results)
     self.frame.Bind(wx.EVT_CLOSE, self.on_close)
     self._manager = None
예제 #17
0
    def __init__(self, parent, *args, **kwds):
        kwds["style"] = wx.aui.AUI_NB_DEFAULT_STYLE

        wx.aui.AuiNotebook.__init__(self, parent, *args, **kwds)
        PanelBase.__init__(self)
        # For sasview the parent is guiframe
        self.parent = parent.parent
        self.frame = None
        self.manager = None

        welcome_page = WelcomePage(self)
        self.AddPage(welcome_page, "Welcome")

        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on_close_page)
        self.Center()
예제 #18
0
    def __init__(self, parent, *args, **kwds):
        kwds["style"] = wx.aui.AUI_NB_DEFAULT_STYLE

        wx.aui.AuiNotebook.__init__(self, parent, *args, **kwds)
        PanelBase.__init__(self)
        #For sasview the parent is guiframe
        self.parent = parent.parent
        self.frame = None
        self.manager = None

        welcome_page = WelcomePage(self)
        self.AddPage(welcome_page, "Welcome")

        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on_close_page)
        self.Center()
예제 #19
0
 def __init__(self,
              parent,
              page_finder={},
              id=-1,
              batch_on=False,
              *args,
              **kwargs):
     ScrolledPanel.__init__(self,
                            parent,
                            id=id,
                            style=wx.FULL_REPAINT_ON_RESIZE,
                            *args,
                            **kwargs)
     PanelBase.__init__(self, parent)
     """
     Simultaneous page display
     """
     self.SetupScrolling()
     ##Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     self.uid = wx.NewId()
     self.parent = parent
     self.batch_on = batch_on
     ## store page_finder
     self.page_finder = page_finder
     ## list contaning info to set constraint
     ## look like self.constraint_dict[page_id]= page
     self.constraint_dict = {}
     ## item list
     # self.constraints_list=[combobox1, combobox2,=,textcrtl, button ]
     self.constraints_list = []
     ## list of current model
     self.model_list = []
     ## selected mdoel to fit
     self.model_toFit = []
     ## number of constraint
     self.nb_constraint = 0
     self.model_cbox_left = None
     self.model_cbox_right = None
     self.uid = wx.NewId()
     ## draw page
     self.define_page_structure()
     self.draw_page()
     self.set_layout()
     self._set_save_flag(False)
예제 #20
0
    def __init__(self, parent, manager=None, *args, **kwargs):
        """
        """
        nb.__init__(self,
                    parent,
                    -1,
                    style=wx.aui.AUI_NB_WINDOWLIST_BUTTON
                    | wx.aui.AUI_NB_DEFAULT_STYLE | wx.CLIP_CHILDREN)
        PanelBase.__init__(self, parent)
        #self.SetWindowStyleFlag(style=nb.FNB_FANCY_TABS)
        self._manager = manager
        self.parent = parent
        self.event_owner = None
        #dictionary of miodel {model class name, model class}
        self.menu_mng = models.ModelManager()
        self.model_list_box = self.menu_mng.get_model_list()
        #pageClosedEvent = nb.EVT_FLATNOTEBOOK_PAGE_CLOSING
        self.model_dictionary = self.menu_mng.get_model_dictionary()
        self.pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE

        self.Bind(self.pageClosedEvent, self.on_close_page)
        ## save the title of the last page tab added
        self.fit_page_name = {}
        ## list of existing fit page
        self.opened_pages = {}
        #index of fit page
        self.fit_page_index = 0
        #index of batch page
        self.batch_page_index = 0
        #page of simultaneous fit
        self.sim_page = None
        self.batch_page = None
        self.fit_engine_type = "bumps"
        ## get the state of a page
        self.Bind(basepage.EVT_PAGE_INFO, self._onGetstate)
        self.Bind(basepage.EVT_PREVIOUS_STATE, self._onUndo)
        self.Bind(basepage.EVT_NEXT_STATE, self._onRedo)
        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.on_page_changing)
        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSED, self.on_closed)
예제 #21
0
    def __init__(self, parent, manager=None, *args, **kwargs):
        """
        """
        nb.__init__(self, parent, wx.ID_ANY,
                    style=wx.aui.AUI_NB_WINDOWLIST_BUTTON |
                    wx.aui.AUI_NB_DEFAULT_STYLE |
                    wx.CLIP_CHILDREN)
        PanelBase.__init__(self, parent)
        #self.SetWindowStyleFlag(style=nb.FNB_FANCY_TABS)
        self._manager = manager
        self.parent = parent
        self.event_owner = None
        #dictionary of miodel {model class name, model class}
        self.menu_mng = models.ModelManager()
        self.model_list_box = self.menu_mng.get_model_list()
        #pageClosedEvent = nb.EVT_FLATNOTEBOOK_PAGE_CLOSING
        self.model_dictionary = self.menu_mng.get_model_dictionary()
        self.pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE

        self.Bind(self.pageClosedEvent, self.on_close_page)
        ## save the title of the last page tab added
        self.fit_page_name = {}
        ## list of existing fit page
        self.opened_pages = {}
        #index of fit page
        self.fit_page_index = 0
        #index of batch page
        self.batch_page_index = 0
        #page of simultaneous fit
        self.sim_page = None
        self.batch_page = None
        ## get the state of a page
        self.Bind(basepage.EVT_PAGE_INFO, self._onGetstate)
        self.Bind(basepage.EVT_PREVIOUS_STATE, self._onUndo)
        self.Bind(basepage.EVT_NEXT_STATE, self._onRedo)
        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.on_page_changing)
        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSED, self.on_closed)
예제 #22
0
 def __init__(self, parent, page_finder={}, id= -1, batch_on=False,
                  *args, **kwargs):
     ScrolledPanel.__init__(self, parent, id=id,
                            style=wx.FULL_REPAINT_ON_RESIZE,
                            *args, **kwargs)
     PanelBase.__init__(self, parent)
     """
     Simultaneous page display
     """
     self.SetupScrolling()
     ##Font size
     self.SetWindowVariant(variant=FONT_VARIANT)
     self.uid = wx.NewId()
     self.parent = parent
     self.batch_on = batch_on
     ## store page_finder
     self.page_finder = page_finder
     ## list contaning info to set constraint
     ## look like self.constraint_dict[page_id]= page
     self.constraint_dict = {}
     ## item list
     # self.constraints_list=[combobox1, combobox2,=,textcrtl, button ]
     self.constraints_list = []
     ## list of current model
     self.model_list = []
     ## selected mdoel to fit
     self.model_toFit = []
     ## number of constraint
     self.nb_constraint = 0
     self.model_cbox_left = None
     self.model_cbox_right = None
     self.uid = wx.NewId()
     ## draw page
     self.define_page_structure()
     self.draw_page()
     self.set_layout()
     self._set_save_flag(False)