mailr11823 - in /branches/bieri_gui/gui_bieri: relax_gui.py settings.py


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

Header


Content

Posted by michael . bieri on December 15, 2010 - 01:16:
Author: michaelbieri
Date: Wed Dec 15 01:16:53 2010
New Revision: 11823

URL: http://svn.gna.org/viewcvs/relax?rev=11823&view=rev
Log:
The settings for parameter files are stored in integers. The GUI converts 
them and passes integers back to the relax data store.

In addition, the settings dialog is craeted in the relax_gui.py script.

Modified:
    branches/bieri_gui/gui_bieri/relax_gui.py
    branches/bieri_gui/gui_bieri/settings.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=11823&r1=11822&r2=11823&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/relax_gui.py (original)
+++ branches/bieri_gui/gui_bieri/relax_gui.py Wed Dec 15 01:16:53 2010
@@ -60,7 +60,7 @@
 from gui_bieri import paths
 from references import References
 from relax_prompt import Prompt
-from settings import import_file_settings, load_sequence, 
relax_global_settings
+from settings import Inputfile, load_sequence, relax_global_settings
 from user_functions import User_functions
 
 
@@ -420,7 +420,7 @@
         ds.relax_gui.results_rx = []
         ds.relax_gui.results_model_free = []
         ds.relax_gui.global_setting = ['1.02 * 1e-10', '-172 * 1e-6', 'N', 
'H', '11', 'newton', '500']
-        ds.relax_gui.file_setting = ['1', '2', '3', '4', '5', '6', '7']
+        ds.relax_gui.file_setting = [1, 2, 3, 4, 5, 6, 7]
 
         # Table of relax Results
         ds.relax_gui.table_residue = []
@@ -508,10 +508,8 @@
 
 
     def param_file_setting(self, event): # set up parameter files
-        tmp_setting = import_file_settings(ds.relax_gui.file_setting)
-        if not tmp_setting == None:
-            if question('Do you realy want to change import file settings?'):
-                ds.relax_gui.file_setting = tmp_setting
+        set_relax_params = Inputfile(ds.relax_gui.file_setting, self, -1, "")
+        set_relax_params.Show()
 
 
     def references(self, event):
@@ -559,7 +557,7 @@
         global global_setting #import global variable
         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.file_setting = ['1', '2', '3', '4', '5', '6', '7']
+            ds.relax_gui.file_setting = [1, 2, 3, 4, 5, 6, 7]
 
 
     def settings(self, event): # set up for relax variables

Modified: branches/bieri_gui/gui_bieri/settings.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/settings.py?rev=11823&r1=11822&r2=11823&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/settings.py (original)
+++ branches/bieri_gui/gui_bieri/settings.py Wed Dec 15 01:16:53 2010
@@ -38,16 +38,6 @@
     settings = []
     old_settings = oldsettings
     set_relax_params = Globalparam(None, -1, "")
-    set_relax_params.ShowModal()
-    return settings
-
-
-def import_file_settings(oldsettings):
-    global settings
-    global old_settings
-    settings = []
-    old_settings = oldsettings
-    set_relax_params = Inputfile(None, -1, "")
     set_relax_params.ShowModal()
     return settings
 
@@ -180,7 +170,10 @@
 
 
 class Inputfile(wx.Dialog):
-    def __init__(self, *args, **kwds):
+    def __init__(settings, self, *args, **kwds):
+        # Link settings list.
+        self.settings = settings
+
         # begin inputfile.__init__
         kwds["style"] = wx.DEFAULT_FRAME_STYLE
         wx.Dialog.__init__(self, *args, **kwds)
@@ -188,19 +181,19 @@
         self.bitmap_1_copy_copy = wx.StaticBitmap(self, -1, 
wx.Bitmap(IMAGE_PATH+'relax.gif', wx.BITMAP_TYPE_ANY))
         self.subheader = wx.StaticText(self, -1, "Please specify column 
number below:\n")
         self.label_2_copy_copy = wx.StaticText(self, -1, "Molecule name")
-        self.mol_nam = wx.TextCtrl(self, -1, old_settings[0])
+        self.mol_nam = wx.TextCtrl(self, -1, str(self.settings[0]))
         self.label_3_copy_copy = wx.StaticText(self, -1, "Residue number")
-        self.res_num_col = wx.TextCtrl(self, -1, old_settings[1])
+        self.res_num_col = wx.TextCtrl(self, -1, str(self.settings[1]))
         self.label_5_copy_copy = wx.StaticText(self, -1, "Residue name")
-        self.res_nam_col = wx.TextCtrl(self, -1, old_settings[2])
+        self.res_nam_col = wx.TextCtrl(self, -1, str(self.settings[2]))
         self.label_6_copy_copy = wx.StaticText(self, -1, "Spin number")
-        self.spin_num_col = wx.TextCtrl(self, -1, old_settings[3])
+        self.spin_num_col = wx.TextCtrl(self, -1, str(self.settings[3]))
         self.label_9_copy_copy = wx.StaticText(self, -1, "Spin name")
-        self.spin_nam_col = wx.TextCtrl(self, -1, old_settings[4])
+        self.spin_nam_col = wx.TextCtrl(self, -1, str(self.settings[4]))
         self.label_7_copy_copy = wx.StaticText(self, -1, "Values")
-        self.value_col = wx.TextCtrl(self, -1, old_settings[5])
+        self.value_col = wx.TextCtrl(self, -1, str(self.settings[5]))
         self.label_8_copy_copy = wx.StaticText(self, -1, "Errors")
-        self.error_col = wx.TextCtrl(self, -1, old_settings[6])
+        self.error_col = wx.TextCtrl(self, -1, str(self.settings[6]))
         self.ok_copy_copy = wx.Button(self, -1, "Ok")
         self.cancel_copy_copy = wx.Button(self, -1, "Cancel")
 
@@ -262,21 +255,16 @@
 
 
     def accept_settings(self, event): # change settings
-        global settings
-        settings = []
-        settings.append(str(self.mol_nam.GetValue()))
-        settings.append(str(self.res_num_col.GetValue()))
-        settings.append(str(self.res_nam_col.GetValue()))
-        settings.append(str(self.spin_num_col.GetValue()))
-        settings.append(str(self.spin_nam_col.GetValue()))
-        settings.append(str(self.value_col.GetValue()))
-        settings.append(str(self.error_col.GetValue()))
-        self.Destroy()
-        event.Skip()
+        self.settings = []
+        self.settings.append(int(self.mol_nam.GetValue()))
+        self.settings.append(int(self.res_num_col.GetValue()))
+        self.settings.append(int(self.res_nam_col.GetValue()))
+        self.settings.append(int(self.spin_num_col.GetValue()))
+        self.settings.append(int(self.spin_nam_col.GetValue()))
+        self.settings.append(int(self.value_col.GetValue()))
+        self.settings.append(int(self.error_col.GetValue()))
+        self.Destroy()
 
 
     def cancel_settings(self, event): # cancel
-        global settings
-        settings = None
-        self.Destroy()
-        event.Skip()
+        self.Destroy()




Related Messages


Powered by MHonArc, Updated Wed Dec 15 01:40:02 2010