mailr25182 - /trunk/gui/components/spectrum.py


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

Header


Content

Posted by edward on August 21, 2014 - 17:30:
Author: bugman
Date: Thu Aug 21 17:30:29 2014
New Revision: 25182

URL: http://svn.gna.org/viewcvs/relax?rev=25182&view=rev
Log:
Added the offset column to the spectrum list GUI element for the dispersion 
analysis.

This is to complete task #7820 (https://gna.org/task/?7820).

The spectrum list GUI element add_offset() method has been added to insert 
the offset column when
the relax_disp_flag is set.  This is called by the update_data() method to 
fill and update the GUI
element.


Modified:
    trunk/gui/components/spectrum.py

Modified: trunk/gui/components/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/components/spectrum.py?rev=25182&r1=25181&r2=25182&view=diff
==============================================================================
--- trunk/gui/components/spectrum.py    (original)
+++ trunk/gui/components/spectrum.py    Thu Aug 21 17:30:29 2014
@@ -460,6 +460,31 @@
         return True
 
 
+    def add_offset(self, index):
+        """Add the offset info to the element.
+
+        @param index:   The column index for the data.
+        @type index:    int
+        @return:        True if the data exists, False otherwise.
+        @rtype:         bool
+        """
+
+        # Append a column.
+        self.element.InsertColumn(index, u("Offset \u03C9_rf (ppm)"))
+
+        # No data.
+        if not hasattr(cdp, 'spectrum_ids'):
+            return True
+
+        # Set the values.
+        for i in range(len(cdp.spectrum_ids)):
+            if hasattr(cdp, 'spin_lock_offset') and cdp.spectrum_ids[i] in 
cdp.spin_lock_offset.keys():
+                self.element.SetStringItem(i, index, 
float_to_gui(cdp.spin_lock_offset[cdp.spectrum_ids[i]]))
+
+        # Successful.
+        return True
+
+
     def generate_popup_menu(self, id=None):
         """Create the popup menu.
 
@@ -734,6 +759,10 @@
         if self.relax_disp_flag and self.add_disp_point(index):
             index += 1
 
+        # The offset.
+        if self.relax_disp_flag and self.add_offset(index):
+            index += 1
+
         # The relaxation times.
         if (self.relax_fit_flag or self.relax_disp_flag) and 
self.relax_times(index):
             index += 1




Related Messages


Powered by MHonArc, Updated Thu Aug 21 17:40:02 2014