Author: bugman Date: Tue Jul 19 14:11:19 2011 New Revision: 13729 URL: http://svn.gna.org/viewcvs/relax?rev=13729&view=rev Log: Shifted the Error_type_page class from the auto NOE GUI analysis to the base class. It was also renamed from Error_type_page to Spectral_error_type_page. Modified: branches/gui_testing/gui/analyses/auto_noe.py branches/gui_testing/gui/analyses/base.py 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=13729&r1=13728&r2=13729&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/auto_noe.py (original) +++ branches/gui_testing/gui/analyses/auto_noe.py Tue Jul 19 14:11:19 2011 @@ -36,7 +36,7 @@ from status import Status; status = Status() # relaxGUI module imports. -from gui.analyses.base import Base_frame +from gui.analyses.base import Base_frame, Spectral_error_type_page from gui.analyses.execute import Execute from gui.analyses.results_analysis import color_code_noe from gui.base_classes import Container @@ -46,7 +46,6 @@ from gui.message import error_message, missing_data from gui.misc import add_border, gui_to_str, protected_exec, str_to_gui from gui import paths -from gui.user_functions.base import UF_page from gui.user_functions.noe import Spectrum_type_page from gui.user_functions.spectrum import Baseplane_rmsd_page, Integration_points_page, Read_intensities_page, Replicated_page from gui.wizard import Wiz_window @@ -274,7 +273,7 @@ self.page_indices['read'] = self.wizard.add_page(self.page_intensity, skip_button=True, proceed_on_error=False) # Error type selection page. - self.page_error_type = Error_type_page(self.wizard, self.gui) + self.page_error_type = Spectral_error_type_page(self.wizard, self.gui) self.page_indices['err_type'] = self.wizard.add_page(self.page_error_type, apply_button=False) self.wizard.set_seq_next_fn(self.page_indices['err_type'], self.wizard_page_after_error_type) @@ -454,87 +453,6 @@ # Set the ID in the spectrum.baseplane_rmsd page. page = self.wizard.get_page(self.page_indices['spectrum_type']) page.spectrum_id.SetValue(id) - - - -class Error_type_page(UF_page): - """The NOE peak intensity reading wizard page for specifying the type of error to be used.""" - - # Class variables. - image_path = paths.WIZARD_IMAGE_PATH + 'spectrum' + sep + 'spectrum_200.png' - uf_path = ['spectrum', 'error_analysis'] - desc_height = 500 - - def add_contents(self, sizer): - """Add the specific GUI elements. - - @param sizer: A sizer object. - @type sizer: wx.Sizer instance - """ - - # Intro text. - msg = "Please specify from where the peak intensity errors will be obtained. The execution of the spectrum.error_analysis user function, as described above, will be postponed until after clicking on the 'Execute relax' button at the end of the automatic NOE analysis page." - text = wx.StaticText(self, -1, msg) - text.Wrap(self._main_size) - sizer.Add(text, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - - # Spacing. - sizer.AddStretchSpacer() - - # A box sizer for placing the box sizer in. - sizer2 = wx.BoxSizer(wx.HORIZONTAL) - sizer.Add(sizer2, 1, wx.ALL|wx.EXPAND, 0) - - # Bottom spacing. - sizer.AddStretchSpacer() - - # A bit of indentation. - sizer2.AddStretchSpacer() - - # A vertical sizer for the radio buttons. - sizer_radio = wx.BoxSizer(wx.VERTICAL) - sizer2.Add(sizer_radio, 1, wx.ALL|wx.EXPAND, 0) - - # The RMSD radio button. - self.radio_rmsd = wx.RadioButton(self, -1, "Baseplane RMSD.") - sizer_radio.Add(self.radio_rmsd, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - - # Spacing. - sizer_radio.AddSpacer(10) - - # The replicated spectra radio button. - self.radio_repl = wx.RadioButton(self, -1, "Replicated spectra.") - sizer_radio.Add(self.radio_repl, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) - - # Bind the buttons. - self.Bind(wx.EVT_RADIOBUTTON, self._on_select, self.radio_rmsd) - self.Bind(wx.EVT_RADIOBUTTON, self._on_select, self.radio_repl) - - # Right side spacing. - sizer2.AddStretchSpacer(3) - - # Bottom spacing. - sizer.AddStretchSpacer() - - # Set the default selection. - self.selection = 'rmsd' - - - def _on_select(self, event): - """Handle the radio button switching. - - @param event: The wx event. - @type event: wx event - """ - - # The button. - button = event.GetEventObject() - - # RMSD. - if button == self.radio_rmsd: - self.selection = 'rmsd' - elif button == self.radio_repl: - self.selection = 'repl' Modified: branches/gui_testing/gui/analyses/base.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/base.py?rev=13729&r1=13728&r2=13729&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/base.py (original) +++ branches/gui_testing/gui/analyses/base.py Tue Jul 19 14:11:19 2011 @@ -25,6 +25,7 @@ """Module containing the base class for all frames.""" # Python module imports. +from os import sep import wx from wx.lib import buttons @@ -35,6 +36,7 @@ # relax GUI module imports. from gui import paths from gui.misc import int_to_gui, str_to_gui +from gui.user_functions.base import UF_page class Base_frame: @@ -506,3 +508,84 @@ # Set the new value. self.spin_systems.SetValue(str_to_gui(self.spin_count())) + + + +class Spectral_error_type_page(UF_page): + """The NOE peak intensity reading wizard page for specifying the type of error to be used.""" + + # Class variables. + image_path = paths.WIZARD_IMAGE_PATH + 'spectrum' + sep + 'spectrum_200.png' + uf_path = ['spectrum', 'error_analysis'] + desc_height = 500 + + def add_contents(self, sizer): + """Add the specific GUI elements. + + @param sizer: A sizer object. + @type sizer: wx.Sizer instance + """ + + # Intro text. + msg = "Please specify from where the peak intensity errors will be obtained. The execution of the spectrum.error_analysis user function, as described above, will be postponed until after clicking on the 'Execute relax' button at the end of the automatic NOE analysis page." + text = wx.StaticText(self, -1, msg) + text.Wrap(self._main_size) + sizer.Add(text, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + + # Spacing. + sizer.AddStretchSpacer() + + # A box sizer for placing the box sizer in. + sizer2 = wx.BoxSizer(wx.HORIZONTAL) + sizer.Add(sizer2, 1, wx.ALL|wx.EXPAND, 0) + + # Bottom spacing. + sizer.AddStretchSpacer() + + # A bit of indentation. + sizer2.AddStretchSpacer() + + # A vertical sizer for the radio buttons. + sizer_radio = wx.BoxSizer(wx.VERTICAL) + sizer2.Add(sizer_radio, 1, wx.ALL|wx.EXPAND, 0) + + # The RMSD radio button. + self.radio_rmsd = wx.RadioButton(self, -1, "Baseplane RMSD.") + sizer_radio.Add(self.radio_rmsd, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + + # Spacing. + sizer_radio.AddSpacer(10) + + # The replicated spectra radio button. + self.radio_repl = wx.RadioButton(self, -1, "Replicated spectra.") + sizer_radio.Add(self.radio_repl, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) + + # Bind the buttons. + self.Bind(wx.EVT_RADIOBUTTON, self._on_select, self.radio_rmsd) + self.Bind(wx.EVT_RADIOBUTTON, self._on_select, self.radio_repl) + + # Right side spacing. + sizer2.AddStretchSpacer(3) + + # Bottom spacing. + sizer.AddStretchSpacer() + + # Set the default selection. + self.selection = 'rmsd' + + + def _on_select(self, event): + """Handle the radio button switching. + + @param event: The wx event. + @type event: wx event + """ + + # The button. + button = event.GetEventObject() + + # RMSD. + if button == self.radio_rmsd: + self.selection = 'rmsd' + elif button == self.radio_repl: + self.selection = 'repl'