mailRe: r10889 - /branches/bieri_gui/gui_bieri/relax_gui.py


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

Header


Content

Posted by Edward d'Auvergne on February 24, 2010 - 17:02:
Hi Michael,

This too looks perfect.  I would suggest for you to merge and
interleave the contents of build_main_window() into build_notebooks().
 The self.hardcoded_index_* initialisation from __init__() can be
brought into build_notebooks() as well!  This will allow for removal
of most objects from the class namespace!  This important
simplification will help with future debugging and makes the code base
much cleaner.

Cheers,

Edward



On 24 February 2010 05:29,  <michael.bieri@xxxxxx> wrote:
Author: michaelbieri
Date: Wed Feb 24 05:29:24 2010
New Revision: 10889

URL: http://svn.gna.org/viewcvs/relax?rev=10889&view=rev
Log:
New function to pack the main notebook was added.

This is the preparation of spliting the NOE automatic analysis in its own 
file, as discussed with Edward d'Auvergne. The NOE tab is curretly 
invisible until automatic NOE scripts are generated. The build_notebooks() 
function packs the tabs generated in the build_main_window() function.


Modified:
   branches/bieri_gui/gui_bieri/relax_gui.py

Modified: branches/bieri_gui/gui_bieri/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/relax_gui.py?rev=10889&r1=10888&r2=10889&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/relax_gui.py (original)
+++ branches/bieri_gui/gui_bieri/relax_gui.py Wed Feb 24 05:29:24 2010
@@ -114,6 +114,9 @@
        # Build the main window.
        self.build_main_window()

+        # Build Notebooks
+        self.build_notebooks()
+
        # Build the menu bar.
        self.build_menu_bar()

@@ -122,9 +125,6 @@

        rx_data = ds.relax_gui.analyses[self.noe_index[0]]
        self.frame_1_statusbar = self.CreateStatusBar(3, 0)
-
-        # The automatic model-free protocol frame.
-        self.analysis_frames[self.hardcoded_index_mf] = 
Auto_model_free(self, self.notebook_2)

        self.__set_properties()
        self.__do_layout()
@@ -228,35 +228,39 @@
    def build_main_window(self):
        """Construct the main relax GUI window."""

-        self.notebook_2 = wx.Notebook(self, -1, style=wx.NB_LEFT)
-        self.results = wx.Panel(self.notebook_2, -1)
+
+        self.notebook_left = wx.Notebook(self, -1, style=wx.NB_LEFT)
+        #self.results = wx.Panel(self.notebook_left, -1)

        # The 5th notebook (freq 3).
-        self.frq3 = wx.Panel(self.notebook_2, -1)
-        self.notebook_3_copy_1 = wx.Notebook(self.frq3, -1, style=0)
+        self.frq3 = wx.Panel(self.notebook_left, -1)
+        self.notebook_frq_3 = wx.Notebook(self.frq3, -1, style=0)

        # The automatic relaxation data analysis frames.
-        self.analysis_frames[self.hardcoded_index_r1_3] = Auto_r1(self, 
self.notebook_3_copy_1, hardcoded_index=self.r1_index[2])
-        self.analysis_frames[self.hardcoded_index_r2_3] = Auto_r2(self, 
self.notebook_3_copy_1, hardcoded_index=self.r2_index[2])
-        self.noe1_copy_1 = wx.Panel(self.notebook_3_copy_1, -1)
+        self.analysis_frames[self.hardcoded_index_r1_3] = Auto_r1(self, 
self.notebook_frq_3, hardcoded_index=self.r1_index[2])
+        self.analysis_frames[self.hardcoded_index_r2_3] = Auto_r2(self, 
self.notebook_frq_3, hardcoded_index=self.r2_index[2])
+        #self.analysis_frames[self.hardcoded_index_noe_3] = Auto_noe(self, 
self.notebook_frq_3, hardcoded_index=self.noe_index[2])

        # The 4th notebook (freq 2).
-        self.frq2 = wx.Panel(self.notebook_2, -1)
-        self.notebook_3_copy = wx.Notebook(self.frq2, -1, style=0)
+        self.frq2 = wx.Panel(self.notebook_left, -1)
+        self.notebook_frq_2 = wx.Notebook(self.frq2, -1, style=0)

        # The automatic relaxation data analysis frames.
-        self.analysis_frames[self.hardcoded_index_r1_2] = Auto_r1(self, 
self.notebook_3_copy, hardcoded_index=self.r1_index[1])
-        self.analysis_frames[self.hardcoded_index_r2_2] = Auto_r2(self, 
self.notebook_3_copy, hardcoded_index=self.r2_index[1])
-        self.noe1_copy = wx.Panel(self.notebook_3_copy, -1)
+        self.analysis_frames[self.hardcoded_index_r1_2] = Auto_r1(self, 
self.notebook_frq_2, hardcoded_index=self.r1_index[1])
+        self.analysis_frames[self.hardcoded_index_r2_2] = Auto_r2(self, 
self.notebook_frq_2, hardcoded_index=self.r2_index[1])
+        #self.analysis_frames[self.hardcoded_index_noe_2] = Auto_noe(self, 
self.notebook_frq_2, hardcoded_index=self.noe_index[1])

        # The 3rd notebook (freq 1).
-        self.frq1 = wx.Panel(self.notebook_2, -1)
-        self.notebook_3 = wx.Notebook(self.frq1, -1, style=0)
+        self.frq1 = wx.Panel(self.notebook_left, -1)
+        self.notebook_frq_1 = wx.Notebook(self.frq1, -1, style=0)

        # The automatic relaxation data analysis frames.
-        self.analysis_frames[self.hardcoded_index_r1_1] = Auto_r1(self, 
self.notebook_3, hardcoded_index=self.r1_index[0])
-        self.analysis_frames[self.hardcoded_index_r2_1] = Auto_r2(self, 
self.notebook_3, hardcoded_index=self.r2_index[0])
-        self.noe1 = wx.Panel(self.notebook_3, -1)
+        self.analysis_frames[self.hardcoded_index_r1_1] = Auto_r1(self, 
self.notebook_frq_1, hardcoded_index=self.r1_index[0])
+        self.analysis_frames[self.hardcoded_index_r2_1] = Auto_r2(self, 
self.notebook_frq_1, hardcoded_index=self.r2_index[0])
+        #self.analysis_frames[self.hardcoded_index_noe_1] = Auto_noe(self, 
self.notebook_frq_1, hardcoded_index=self.noe_index[0])
+
+        # The automatic model-free protocol frame.
+        self.analysis_frames[self.hardcoded_index_mf] = 
Auto_model_free(self, self.notebook_left)


    def build_menu_bar(self):
@@ -357,6 +361,56 @@

        # Return the element.
        return element
+
+
+    def build_notebooks(self):
+        """Build the notebooks for the 3 frequencies and analysis modes"""
+
+        # Add NOE, R1 and R2 tabs to main notebook (1. frequency).
+        frq1sub = wx.BoxSizer(wx.HORIZONTAL)
+        # Create sub-tabs.
+        
#self.notebook_frq_1.AddPage(self.analysis_frames[self.hardcoded_index_noe_1].parent,
 "steady-state NOE")
+        
self.notebook_frq_1.AddPage(self.analysis_frames[self.hardcoded_index_r1_1].parent,
 "R1 relaxation")
+        
self.notebook_frq_1.AddPage(self.analysis_frames[self.hardcoded_index_r2_1].parent,
 "R2 relaxation")
+        frq1sub.Add(self.notebook_frq_1, 1, wx.EXPAND, 0)
+        self.frq1.SetSizer(frq1sub)
+        # Pack frequency 1 tab.
+        self.notebook_left.AddPage(self.frq1, "Frq. 1")
+
+        # Add NOE, R1 and R2 tabs to main notebook (2. frequency).
+        frq2sub = wx.BoxSizer(wx.HORIZONTAL)
+        # Create sub-tabs.
+        
#self.notebook_frq_2.AddPage(self.analysis_frames[self.hardcoded_index_noe_2].parent,
 "steady-state NOE")
+        
self.notebook_frq_2.AddPage(self.analysis_frames[self.hardcoded_index_r1_2].parent,
 "R1 relaxation")
+        
self.notebook_frq_2.AddPage(self.analysis_frames[self.hardcoded_index_r2_2].parent,
 "R2 relaxation")
+        frq2sub.Add(self.notebook_frq_2, 1, wx.EXPAND, 0)
+        self.frq2.SetSizer(frq2sub)
+        # Pack frequency 2 tab.
+        self.notebook_left.AddPage(self.frq2, "Frq. 2")
+
+        # Add NOE, R1 and R2 tabs to main notebook (3. frequency).
+        frq3sub = wx.BoxSizer(wx.HORIZONTAL)
+        # Create sub-tabs.
+        
#self.notebook_frq_3.AddPage(self.analysis_frames[self.hardcoded_index_noe_3].parent,
 "steady-state NOE")
+        
self.notebook_frq_3.AddPage(self.analysis_frames[self.hardcoded_index_r1_3].parent,
 "R1 relaxation")
+        
self.notebook_frq_3.AddPage(self.analysis_frames[self.hardcoded_index_r2_3].parent,
 "R2 relaxation")
+        frq3sub.Add(self.notebook_frq_3, 1, wx.EXPAND, 0)
+        self.frq3.SetSizer(frq3sub)
+        # Pack frequency 3 tab.
+        self.notebook_left.AddPage(self.frq3, "Frq. 3")
+
+        # Results tab.
+        self.results = wx.Panel(self.notebook_left, -1)
+
+        # Model-free tab.
+        
self.notebook_left.AddPage(self.analysis_frames[self.hardcoded_index_mf].parent,
 "Model-free")
+        self.notebook_left.AddPage(self.results, "Results")
+
+        # Pack main notebook.
+        main_sizer = wx.BoxSizer(wx.VERTICAL)
+        main_sizer.Add(self.notebook_left, 1, wx.EXPAND, 0)
+        self.SetSizer(main_sizer)
+


    def exec_noe1(self, event): # Start NOE calculation no. 1


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits




Related Messages


Powered by MHonArc, Updated Wed Feb 24 17:20:17 2010