Author: bugman Date: Wed Jul 20 10:41:13 2011 New Revision: 13762 URL: http://svn.gna.org/viewcvs/relax?rev=13762&view=rev Log: Eliminated the global parameters data store object and GUI window. This concept severely limits the GUI's flexibility and usefulness and is to be replaced by either analysis specific GUI elements within the analysis pages, or by direct access to the corresponding user function. For example specifying 'newton' optimisation is useless for the R1 and R2 as only simplex can be used, or the NOE as no optimisation is performed. Modified: branches/gui_testing/gui/menu.py branches/gui_testing/gui/relax_gui.py branches/gui_testing/gui/settings.py Modified: branches/gui_testing/gui/menu.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/menu.py?rev=13762&r1=13761&r2=13762&view=diff ============================================================================== --- branches/gui_testing/gui/menu.py (original) +++ branches/gui_testing/gui/menu.py Wed Jul 20 10:41:13 2011 @@ -88,13 +88,11 @@ # The 'Settings' menu entries. menu = wx.Menu() - menu.AppendItem(self.build_menu_item(menu, id=20, text="&Global relax settings", icon=paths.icon_16x16.settings_global)) menu.AppendItem(self.build_menu_item(menu, id=21, text="&Free file format settings", icon=paths.icon_16x16.document_properties)) menu.AppendItem(self.build_menu_item(menu, id=22, text="Reset a&ll settings", icon=paths.icon_16x16.settings_reset)) self.menubar.Append(menu, "&Settings") # The 'Settings' menu actions. - self.gui.Bind(wx.EVT_MENU, self.gui.global_parameters, id=20) self.gui.Bind(wx.EVT_MENU, self.gui.free_file_format_settings, id=21) self.gui.Bind(wx.EVT_MENU, self.gui.reset_setting, id=22) Modified: branches/gui_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/relax_gui.py?rev=13762&r1=13761&r2=13762&view=diff ============================================================================== --- branches/gui_testing/gui/relax_gui.py (original) +++ branches/gui_testing/gui/relax_gui.py Wed Jul 20 10:41:13 2011 @@ -58,7 +58,7 @@ from gui import paths from gui.references import References from gui.relax_prompt import Prompt -from gui.settings import Free_file_format, Global_params, load_sequence +from gui.settings import Free_file_format, load_sequence from gui.user_functions import User_functions @@ -284,7 +284,6 @@ # Define Global Variables ds.relax_gui.unresolved = "" - ds.relax_gui.global_setting = ['1.02 * 1e-10', '-172 * 1e-6', 'N', 'H', '11', 'newton', '500'] # Table of relax Results ds.relax_gui.table_residue = [] @@ -309,21 +308,6 @@ win.Show() - def global_parameters(self, event): - """Open the global parameters window. - - @param event: The wx event. - @type event: wx event - """ - - # Build the window. - win = Global_params() - - # Show the window. - if status.show_gui: - win.Show() - - def references(self, event): """Display the references relevant for relax. @@ -368,7 +352,6 @@ def reset_setting(self, event): #reset all settings if question('Do you realy want to change relax settings?'): - ds.relax_gui.global_setting = ['1.02 * 1e-10', '-172 * 1e-6', 'N', 'H', '11', 'newton', '500'] ds.relax_gui.free_file_format.reset() Modified: branches/gui_testing/gui/settings.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/settings.py?rev=13762&r1=13761&r2=13762&view=diff ============================================================================== --- branches/gui_testing/gui/settings.py (original) +++ branches/gui_testing/gui/settings.py Wed Jul 20 10:41:13 2011 @@ -232,131 +232,3 @@ # Destroy the window. self.Destroy() - - - -class Global_params(Base_window, Wiz_page): - """The global parameters setting window.""" - - # The window size. - SIZE = (500, 550) - - def __init__(self, parent=None): - """Set up the window.""" - - # The sizes. - self.main_size = self.SIZE[0] - 2*self.BORDER - self.div_left = self.main_size / 2 - - # Execute the base __init__() method. - super(Global_params, self).__init__(parent=parent, id=-1, title="Global settings", heading="Global settings") - - - def add_centre(self, sizer): - """Add the centre of the free file format settings window. - - @param sizer: A sizer object. - @type sizer: wx.Sizer instance - """ - - # The widget. - self.settings(sizer, save=False) - - # Spacing. - self.main_sizer.AddStretchSpacer() - - - def settings(self, sizer, save=True): - """Build the free format file settings widget. - - @param sizer: The sizer to put the input field into. - @type sizer: wx.Sizer instance - @keyword save: A flag which if True will cause the save button to be displayed. - @type save: bool - """ - - # A static box to hold all the widgets. - box = wx.StaticBox(self, -1, "Set the parameters for optimisation") - - # Init. - sub_sizer = wx.StaticBoxSizer(box, wx.VERTICAL) - sub_sizer.AddSpacer(10) - divider = self.div_left - 15 - padding = 10 - spacer = 3 - - # The columns. - self.bond = self.input_field(sub_sizer, "Bond length:", divider=divider, padding=padding, spacer=spacer) - self.csa = self.input_field(sub_sizer, "Chemical shift anisotropy (CSA):", divider=divider, padding=padding, spacer=spacer) - self.hetero = self.input_field(sub_sizer, "Heteronucleus name:", divider=divider, padding=padding, spacer=spacer) - self.prot = self.input_field(sub_sizer, "Proton name:", divider=divider, padding=padding, spacer=spacer) - self.grid = self.input_field(sub_sizer, "Grid search increments:", divider=divider, padding=padding, spacer=spacer) - self.minim = self.input_field(sub_sizer, "Minimisation algorithm:", divider=divider, padding=padding, spacer=spacer) - self.monte = self.input_field(sub_sizer, "Monte Carlo simulation number:", divider=divider, padding=padding, spacer=spacer) - - # Set the values. - self.bond.SetValue(int_to_gui(ds.relax_gui.global_setting[0])) - self.csa.SetValue(int_to_gui(ds.relax_gui.global_setting[1])) - self.hetero.SetValue(int_to_gui(ds.relax_gui.global_setting[2])) - self.prot.SetValue(int_to_gui(ds.relax_gui.global_setting[3])) - self.grid.SetValue(int_to_gui(ds.relax_gui.global_setting[4])) - self.minim.SetValue(int_to_gui(ds.relax_gui.global_setting[5])) - self.monte.SetValue(int_to_gui(ds.relax_gui.global_setting[6])) - - # Add a save button. - if save: - # A sizer. - button_sizer = wx.BoxSizer(wx.HORIZONTAL) - - # Build the button. - button = buttons.ThemedGenBitmapTextButton(self, -1, None, " Save") - button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.save, wx.BITMAP_TYPE_ANY)) - button.SetToolTipString("Save the free file format settings within the relax data store") - - # Add the button. - button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) - - # Right padding. - button_sizer.AddSpacer(padding) - - # Bind the click event. - self.Bind(wx.EVT_BUTTON, self.save, button) - - # Add the button sizer to the widget (with spacing). - sub_sizer.AddSpacer(10-spacer) - sub_sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT|wx.ALL, 0) - - # Set the size of the widget. - sub_sizer.AddSpacer(10) - x, y = box.GetSize() - box.SetMinSize((self.main_size, y)) - - # The border of the widget. - border = wx.BoxSizer() - - # Place the box sizer inside the border. - border.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0) - - # Add to the main sizer (followed by stretchable spacing). - sizer.Add(border, 0, wx.EXPAND) - sizer.AddStretchSpacer() - - - def save(self, event): - """Save the free file format widget contents into the relax data store. - - @param event: The wx event. - @type event: wx event - """ - - # Get the values. - ds.relax_gui.global_setting[0] = str(self.bond.GetValue()) - ds.relax_gui.global_setting[1] = str(self.csa.GetValue()) - ds.relax_gui.global_setting[2] = str(self.hetero.GetValue()) - ds.relax_gui.global_setting[3] = str(self.prot.GetValue()) - ds.relax_gui.global_setting[4] = str(self.grid.GetValue()) - ds.relax_gui.global_setting[5] = str(self.minim.GetValue()) - ds.relax_gui.global_setting[6] = str(self.monte.GetValue()) - - # Destroy the window. - self.Destroy()