mailRe: r12866 - /1.3/gui/analyses/auto_rx_base.py


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

Header


Content

Posted by Edward d'Auvergne on June 07, 2011 - 11:25:
Hi,

Another idea, rather than a variable delay list, would be a file
formatted with the first column being the file name and the second
being the delay value.  I.e. it would resemble the grid.  This could
be done in the wizard too.

Cheers,

Edward


On 7 June 2011 03:04,  <michael.bieri@xxxxxxxxxxxxx> wrote:
Author: michaelbieri
Date: Tue Jun  7 03:04:13 2011
New Revision: 12866

URL: http://svn.gna.org/viewcvs/relax?rev=12866&view=rev
Log:
R1 delays can be imported from VD lists.

Modified:
   1.3/gui/analyses/auto_rx_base.py

Modified: 1.3/gui/analyses/auto_rx_base.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/analyses/auto_rx_base.py?rev=12866&r1=12865&r2=12866&view=diff
==============================================================================
--- 1.3/gui/analyses/auto_rx_base.py (original)
+++ 1.3/gui/analyses/auto_rx_base.py Tue Jun  7 03:04:13 2011
@@ -44,7 +44,7 @@
 from gui.components.spectrum import Peak_intensity
 from gui.controller import Redirect_text, Thread_container
 from gui.derived_wx_classes import StructureTextCtrl
-from gui.filedialog import multi_openfile, opendir
+from gui.filedialog import multi_openfile, opendir, openfile
 from gui.message import error_message, missing_data
 from gui import paths
 from gui.settings import load_sequence
@@ -566,7 +566,6 @@
            if str(self.peaklist.GetCellValue(i, 0)) == '':
                # Write peak file
                self.peaklist.SetCellValue(i, 0, str(files[index]))
-                print str(files[index])

                # Next file
                index = index + 1
@@ -599,6 +598,44 @@

        # Sync.
        self.sync_ds(upload=False)
+
+
+    def load_vd(self, event):
+        """The variable delay list loading GUI element.
+
+        @param event:   The wx event.
+        @type event:    wx event
+        """
+
+        # The file
+        filename = openfile(msg='Select VD file.', filetype='*.*', 
default='all files (*.*)|*')
+
+        # Abort if nothing selected
+        if not filename:
+            return
+
+        # Open the file
+        file = open(filename, 'r')
+
+        # Read entries
+        index = 0
+        for line in file:
+            # Evaluate if line is a number
+            try:
+                t = float(line.replace('/n', ''))
+            except:
+                continue
+
+            # Write delay to peak list grid
+            self.peaklist.SetCellValue(index, 1, str(t))
+
+            # Next peak list
+            index = index + 1
+
+            # Too many entries in VD list
+            if index == self.pk_list:
+                error_message('Too many entries in VD list.')
+                return


    def results_directory(self, event):


_______________________________________________
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 Jun 08 14:20:13 2011