Author: bugman Date: Sun Apr 21 11:59:07 2013 New Revision: 19523 URL: http://svn.gna.org/viewcvs/relax?rev=19523&view=rev Log: Modified the GUI new analysis wizard to return a list of user function on_execute methods. This will be used in the relax_disp branch and in the future for when a special user function page is added to the new analysis wizard. This allows the use of user function pages with execution delayed until the analysis __init__() method is being run. Modified: trunk/gui/analyses/__init__.py trunk/gui/analyses/auto_model_free.py trunk/gui/analyses/auto_noe.py trunk/gui/analyses/auto_rx_base.py trunk/gui/analyses/wizard.py Modified: trunk/gui/analyses/__init__.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/__init__.py?rev=19523&r1=19522&r2=19523&view=diff ============================================================================== --- trunk/gui/analyses/__init__.py (original) +++ trunk/gui/analyses/__init__.py Sun Apr 21 11:59:07 2013 @@ -419,16 +419,16 @@ return # Unpack the data. - analysis_type, analysis_name, pipe_name, pipe_bundle = data + analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = data # Initialise the new analysis. - self.new_analysis(analysis_type, analysis_name, pipe_name, pipe_bundle) + self.new_analysis(analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec) # Delete the wizard data. del self.new_wizard - def new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, pipe_bundle=None, index=None): + def new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], index=None): """Initialise a new analysis. @keyword analysis_type: The type of analysis to initialise. This can be one of 'noe', 'r1', 'r2', or 'mf'. @@ -439,6 +439,8 @@ @type pipe_name: str @keyword pipe_bundle: The name of the data pipe bundle to associate with this analysis. @type pipe_bundle: str + @keyword uf_exec: The list of user function on_execute methods returned from the new analysis wizard. + @type uf_exec: list of methods @keyword index: The index of the analysis in the relax data store (set to None if no data currently exists). @type index: None or int """ @@ -485,7 +487,7 @@ raise RelaxError("The analysis '%s' is unknown." % analysis_type) # Initialise the class. - analysis = classes[analysis_type](parent=self.notebook, id=-1, gui=self.gui, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle, data_index=index) + analysis = classes[analysis_type](parent=self.notebook, id=-1, gui=self.gui, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle, uf_exec=uf_exec, data_index=index) # Failure. if not analysis.init_flag: Modified: trunk/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_model_free.py?rev=19523&r1=19522&r2=19523&view=diff ============================================================================== --- trunk/gui/analyses/auto_model_free.py (original) +++ trunk/gui/analyses/auto_model_free.py Sun Apr 21 11:59:07 2013 @@ -152,7 +152,7 @@ class Auto_model_free(Base_analysis): """The model-free auto-analysis GUI element.""" - def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, data_index=None): + def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], data_index=None): """Build the automatic model-free protocol GUI element. @param parent: The parent wx element. @@ -175,6 +175,8 @@ @type pipe_name: str @keyword pipe_bundle: The name of the data pipe bundle associated with this analysis. @type pipe_bundle: str + @keyword uf_exec: The list of user function on_execute methods returned from the new analysis wizard. + @type uf_exec: list of methods @keyword data_index: The index of the analysis in the relax data store (set to None if no data currently exists). @type data_index: None or int """ Modified: trunk/gui/analyses/auto_noe.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_noe.py?rev=19523&r1=19522&r2=19523&view=diff ============================================================================== --- trunk/gui/analyses/auto_noe.py (original) +++ trunk/gui/analyses/auto_noe.py Sun Apr 21 11:59:07 2013 @@ -61,7 +61,7 @@ paths.IMAGE_PATH+'noe.png'] label = None - def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, data_index=None): + def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], data_index=None): """Build the automatic NOE analysis GUI frame elements. @param parent: The parent wx element. @@ -84,6 +84,8 @@ @type pipe_name: str @keyword pipe_bundle: The name of the data pipe bundle associated with this analysis. @type pipe_bundle: str + @keyword uf_exec: The list of user function on_execute methods returned from the new analysis wizard. + @type uf_exec: list of methods @keyword data_index: The index of the analysis in the relax data store (set to None if no data currently exists). @type data_index: None or int """ Modified: trunk/gui/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_rx_base.py?rev=19523&r1=19522&r2=19523&view=diff ============================================================================== --- trunk/gui/analyses/auto_rx_base.py (original) +++ trunk/gui/analyses/auto_rx_base.py Sun Apr 21 11:59:07 2013 @@ -60,7 +60,7 @@ bitmap = None label = None - def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, data_index=None): + def __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=524288, name='scrolledpanel', gui=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], data_index=None): """Build the automatic R1 and R2 analysis GUI frame elements. @param parent: The parent wx element. @@ -83,6 +83,8 @@ @type pipe_name: str @keyword pipe_bundle: The name of the data pipe bundle associated with this analysis. @type pipe_bundle: str + @keyword uf_exec: The list of user function on_execute methods returned from the new analysis wizard. + @type uf_exec: list of methods @keyword data_index: The index of the analysis in the relax data store (set to None if no data currently exists). @type data_index: None or int """ Modified: trunk/gui/analyses/wizard.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/wizard.py?rev=19523&r1=19522&r2=19523&view=diff ============================================================================== --- trunk/gui/analyses/wizard.py (original) +++ trunk/gui/analyses/wizard.py Sun Apr 21 11:59:07 2013 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2011-2012 Edward d'Auvergne # +# Copyright (C) 2011-2013 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -43,7 +43,7 @@ def run(self): """Run through the analysis selection wizard, returning the results. - @return: The analysis type, analysis name, and data pipe name. + @return: The analysis type, analysis name, data pipe name, data pipe bundle name, and user function on_execute method list. @rtype: tuple of str """ @@ -74,15 +74,15 @@ if setup != wx.ID_OK: return - # Return the analysis type, analysis name, and pipe name. + # Return the analysis type, analysis name, data pipe name, data pipe bundle name, and user function on_execute method list. return self.get_data() def get_data(self): """Assemble and return the analysis type, analysis name, and pipe name. - @return: The analysis type, analysis name, and data pipe name. - @rtype: tuple of str + @return: The analysis type, analysis name, data pipe name, data pipe bundle name, and list of user function on_execute methods. + @rtype: str, str, str, str, list of methods """ # Get the data. @@ -91,8 +91,11 @@ pipe_name = gui_to_str(self.pipe_page.pipe_name.GetValue()) pipe_bundle = gui_to_str(self.pipe_page.pipe_bundle.GetValue()) + # The user function on_execute methods. + uf_exec = [] + # Return it. - return analysis_type, analysis_name, pipe_name, pipe_bundle + return analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec