mailr13055 - in /branches/gui_testing/gui: analyses/auto_model_free.py analyses/auto_noe.py analyses/auto_rx_base.py relax_gui.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 15, 2011 - 18:40:
Author: bugman
Date: Wed Jun 15 18:40:14 2011
New Revision: 13055

URL: http://svn.gna.org/viewcvs/relax?rev=13055&view=rev
Log:
The relax data store GUI analysis elements are now only initialised by the 
analysis classes if asked.

By passing in an index for a currently existing analysis data structure, a 
new structure will now
not be initialised by the analysis classes.


Modified:
    branches/gui_testing/gui/analyses/auto_model_free.py
    branches/gui_testing/gui/analyses/auto_noe.py
    branches/gui_testing/gui/analyses/auto_rx_base.py
    branches/gui_testing/gui/relax_gui.py

Modified: branches/gui_testing/gui/analyses/auto_model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_model_free.py?rev=13055&r1=13054&r2=13055&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_model_free.py (original)
+++ branches/gui_testing/gui/analyses/auto_model_free.py Wed Jun 15 18:40:14 
2011
@@ -154,36 +154,43 @@
 
 
 class Auto_model_free(Base_frame):
-    def __init__(self, gui, notebook):
+    def __init__(self, gui, notebook, data_index=None):
         """Build the automatic model-free protocol GUI element.
 
-        @param gui:         The main GUI class.
-        @type gui:          gui.relax_gui.Main instance
-        @param notebook:    The notebook to pack this frame into.
-        @type notebook:     wx.Notebook instance
+        @param gui:             The main GUI class.
+        @type gui:              gui.relax_gui.Main instance
+        @param notebook:        The notebook to pack this frame into.
+        @type notebook:         wx.Notebook instance
+        @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
         """
 
         # Store the main class.
         self.gui = gui
 
-        # Generate a storage container in the relax data store, and alias it 
for easy access.
-        self.data = ds.relax_gui.analyses.add('model-free')
-
-        # Model-free variables.
-        self.data.model_source = getcwd()
-        self.data.model_save = getcwd()
-        self.data.selection = "AIC"
-        self.data.model_toggle = [True]*10
-        self.data.nmrfreq1 = 600
-        self.data.nmrfreq2 = 800
-        self.data.nmrfreq3 = 900
-        self.data.paramfiles1 = ["", "", ""]
-        self.data.paramfiles2 = ["", "", ""]
-        self.data.paramfiles3 = ["", "", ""]
-        self.data.unresolved = ''
-        self.data.structure_file = ''
-        self.data.results_dir_model = self.gui.launch_dir
-        self.data.max_iter = "30"
+        # New data container.
+        if data_index == None:
+            # Generate a storage container in the relax data store, and 
alias it for easy access.
+            data_index = ds.relax_gui.analyses.add('model-free')
+
+            # Model-free variables.
+            ds.relax_gui.analyses[data_index].model_source = getcwd()
+            ds.relax_gui.analyses[data_index].model_save = getcwd()
+            ds.relax_gui.analyses[data_index].selection = "AIC"
+            ds.relax_gui.analyses[data_index].model_toggle = [True]*10
+            ds.relax_gui.analyses[data_index].nmrfreq1 = 600
+            ds.relax_gui.analyses[data_index].nmrfreq2 = 800
+            ds.relax_gui.analyses[data_index].nmrfreq3 = 900
+            ds.relax_gui.analyses[data_index].paramfiles1 = ["", "", ""]
+            ds.relax_gui.analyses[data_index].paramfiles2 = ["", "", ""]
+            ds.relax_gui.analyses[data_index].paramfiles3 = ["", "", ""]
+            ds.relax_gui.analyses[data_index].unresolved = ''
+            ds.relax_gui.analyses[data_index].structure_file = ''
+            ds.relax_gui.analyses[data_index].results_dir_model = 
self.gui.launch_dir
+            ds.relax_gui.analyses[data_index].max_iter = "30"
+
+        # Alias the data.
+        self.data = ds.relax_gui.analyses[data_index]
 
         # The parent GUI element for this class.
         self.parent = wx.Panel(notebook, -1)
@@ -715,7 +722,7 @@
         box.AddSpacer(10)
 
         # Add maximum interation selector.
-        self.max_iter = self.add_spin_element(box, self.parent, 
text="Maximum interations", default=self.data.max_iter, min=25, max=100)
+        self.max_iter = self.add_spin_element(box, self.parent, 
text="Maximum interations", default=str(self.data.max_iter), min=25, max=100)
 
         # Add the PDB file selection GUI element.
         self.field_structure = self.add_text_sel_element(box, self.parent, 
text="Structure file (.pdb)", default=str(self.gui.structure_file_pdb_msg), 
control=StructureTextCtrl, fn='open_file', editable=False, button=True)
@@ -899,16 +906,6 @@
             if global_model == 'local_tm':
                 # enable m1 - m5 to choose for calculation
                 return True
-
-
-    def link_data(self, data):
-        """Re-alias the storage container in the relax data store.
-        @keyword data:      The data storage container.
-        @type data:         class instance
-        """
-
-        # Alias.
-        self.data = data
 
 
     def model_noe1(self, event): # load noe1

Modified: branches/gui_testing/gui/analyses/auto_noe.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_noe.py?rev=13055&r1=13054&r2=13055&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_noe.py (original)
+++ branches/gui_testing/gui/analyses/auto_noe.py Wed Jun 15 18:40:14 2011
@@ -60,28 +60,35 @@
     bitmap = None
     label = None
 
-    def __init__(self, gui, notebook):
+    def __init__(self, gui, notebook, data_index=None):
         """Build the automatic NOE analysis GUI frame elements.
 
-        @param gui:                 The main GUI class.
-        @type gui:                  gui.relax_gui.Main instance
-        @param notebook:            The notebook to pack this frame into.
-        @type notebook:             wx.Notebook instance
+        @param gui:             The main GUI class.
+        @type gui:              gui.relax_gui.Main instance
+        @param notebook:        The notebook to pack this frame into.
+        @type notebook:         wx.Notebook instance
+        @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
         """
 
         # Store the main class.
         self.gui = gui
 
-        # Generate a storage container in the relax data store, and alias it 
for easy access.
-        self.data = ds.relax_gui.analyses.add('NOE')
-
-        # Initialise the variables.
-        self.data.frq = ''
-        self.data.ref_file = ''
-        self.data.sat_file = ''
-        self.data.ref_rmsd = 1000
-        self.data.sat_rmsd = 1000
-        self.data.save_dir = self.gui.launch_dir
+        # New data container.
+        if data_index == None:
+            # Generate a storage container in the relax data store, and 
alias it for easy access.
+            data_index = ds.relax_gui.analyses.add('NOE')
+
+            # Initialise the variables.
+            ds.relax_gui.analyses[data_index].frq = ''
+            ds.relax_gui.analyses[data_index].ref_file = ''
+            ds.relax_gui.analyses[data_index].sat_file = ''
+            ds.relax_gui.analyses[data_index].ref_rmsd = 1000
+            ds.relax_gui.analyses[data_index].sat_rmsd = 1000
+            ds.relax_gui.analyses[data_index].save_dir = self.gui.launch_dir
+
+        # Alias the data.
+        self.data = ds.relax_gui.analyses[data_index]
 
         # The parent GUI element for this class.
         self.parent = wx.Panel(notebook, -1)
@@ -352,17 +359,6 @@
         event.Skip()
 
 
-    def link_data(self, data):
-        """Re-alias the storage container in the relax data store.
-
-        @keyword data:      The data storage container.
-        @type data:         class instance
-        """
-
-        # Re-alias.
-        self.data = data
-
-
     def ref_file(self, event):
         """The results directory selection.
 

Modified: branches/gui_testing/gui/analyses/auto_rx_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_rx_base.py?rev=13055&r1=13054&r2=13055&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_rx_base.py (original)
+++ branches/gui_testing/gui/analyses/auto_rx_base.py Wed Jun 15 18:40:14 2011
@@ -60,28 +60,35 @@
     bitmap = None
     label = None
 
-    def __init__(self, gui, notebook):
+    def __init__(self, gui, notebook, data_index=None):
         """Build the automatic R1 and R2 analysis GUI frame elements.
 
-        @param gui:                 The main GUI class.
-        @type gui:                  gui.relax_gui.Main instance
-        @param notebook:            The notebook to pack this frame into.
-        @type notebook:             wx.Notebook instance
+        @param gui:             The main GUI class.
+        @type gui:              gui.relax_gui.Main instance
+        @param notebook:        The notebook to pack this frame into.
+        @type notebook:         wx.Notebook instance
+        @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
         """
 
         # Store the main class.
         self.gui = gui
 
-        # Generate a storage container in the relax data store, and alias it 
for easy access.
-        self.data = ds.relax_gui.analyses.add(self.label)
-
-        # Initialise the variables.
-        self.data.frq = ''
-        self.data.num = 0
-        self.data.file_list = []
-        self.data.ncyc = []
-        self.data.relax_times = []
-        self.data.save_dir = self.gui.launch_dir
+        # New data container.
+        if data_index == None:
+            # Generate a storage container in the relax data store, and 
alias it for easy access.
+            data_index = ds.relax_gui.analyses.add(self.label)
+
+            # Initialise the variables.
+            ds.relax_gui.analses[data_index].frq = ''
+            ds.relax_gui.analses[data_index].num = 0
+            ds.relax_gui.analses[data_index].file_list = []
+            ds.relax_gui.analses[data_index].ncyc = []
+            ds.relax_gui.analses[data_index].relax_times = []
+            ds.relax_gui.analses[data_index].save_dir = self.gui.launch_dir
+
+        # Alias the data.
+        self.data = ds.relax_gui.analyses[data_index]
 
         # The parent GUI element for this class.
         self.parent = wx.Panel(notebook, -1)
@@ -308,19 +315,6 @@
         
ds.relax_gui.results_rx.append(data.save_dir+sep+'grace'+sep+'intensities_norm.agr')
 
 
-    def link_data(self, data):
-        """Re-alias the storage container in the relax data store.
-        @keyword data:      The data storage container.
-        @type data:         class instance
-        """
-
-        # Re-alias.
-        self.data = data
-
-        # Re-alias in the peak intensity object as well.
-        self.peak_intensity.data = data
-
-
     def load_sequence(self, event):
         """The sequence loading GUI element.
 

Modified: branches/gui_testing/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13055&r1=13054&r2=13055&view=diff
==============================================================================
--- branches/gui_testing/gui/relax_gui.py (original)
+++ branches/gui_testing/gui/relax_gui.py Wed Jun 15 18:40:14 2011
@@ -346,11 +346,13 @@
         self.new_analysis(analysis_type)
 
 
-    def new_analysis(self, analysis_type):
+    def new_analysis(self, analysis_type, index=None):
         """Initialise a new analysis.
 
         @param analysis_type:   The type of analysis to initialise.  This 
can be one of 'noe', 'r1', 'r2', or 'mf'.
         @type analysis_type:    str
+        @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
         """
 
         # Starting from the initial state.
@@ -389,7 +391,7 @@
         analysis = classes[analysis_type]
 
         # Initialise the class and append it to the analysis window object.
-        self.analyses.append(analysis(self, self.notebook))
+        self.analyses.append(analysis(self, self.notebook, index))
 
         # Add to the notebook.
         self.notebook.AddPage(self.analyses[-1].parent, 
titles[analysis_type])
@@ -595,7 +597,7 @@
                'R2': 'r2',
                'model-free': 'mf'}
         for i in range(len(ds.relax_gui.analyses)):
-            self.new_analysis(map[ds.relax_gui.analyses[i].analysis_type])
+            self.new_analysis(map[ds.relax_gui.analyses[i].analysis_type], 
index=i)
 
         # Update the core of the GUI to match the new data store.
         self.sync_ds(upload=False)
@@ -625,10 +627,6 @@
 
         # Loop over each analysis.
         for i in range(len(self.analyses)):
-            # Link the data.
-            if not upload:
-                self.analyses[i].link_data(ds.relax_gui.analyses[i])
-
             # Execute the analysis frame specific update methods.
             if hasattr(self.analyses[i], 'sync_ds'):
                 self.analyses[i].sync_ds(upload)




Related Messages


Powered by MHonArc, Updated Wed Jun 15 19:00:03 2011