mailr25177 - /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:19:
Author: bugman
Date: Thu Aug 21 17:19:19 2014
New Revision: 25177

URL: http://svn.gna.org/viewcvs/relax?rev=25177&view=rev
Log:
Added the relax_disp.spin_lock_offset user function to the dispersion GUI.

This has been added to the pop up menu in the spectrum list GUI element, when 
the relax_disp_flag
has been set.  It simply mimics the relax_disp.spin_lock_field functionality 
already present.  This
follows from task #7820 (https://gna.org/task/?7820).


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=25177&r1=25176&r2=25177&view=diff
==============================================================================
--- trunk/gui/components/spectrum.py    (original)
+++ trunk/gui/components/spectrum.py    Thu Aug 21 17:19:19 2014
@@ -202,6 +202,36 @@
             uf_store['relax_disp.spin_lock_field'](spectrum_id=id)
 
 
+    def action_relax_disp_spin_lock_offset(self, event=None, item=None):
+        """Launch the relax_disp.spin_lock_offset user function.
+
+        @keyword event: The wx event.
+        @type event:    wx event
+        @keyword item:  This is for debugging purposes only, to allow the 
GUI tests to select items without worrying about OS dependent wxPython bugs.
+        @type item:     None or int
+        """
+
+        # The current selection.
+        if item == None:
+            item = self.element.GetFirstSelected()
+
+        # The spectrum ID.
+        id = gui_to_str(self.element.GetItemText(item))
+
+        # The offset.
+        offset = None
+        offset_flag = False
+        if hasattr(cdp, 'spin_lock_offset') and id in 
cdp.spin_lock_offset.keys():
+            offset = cdp.spin_lock_offset[id]
+            offset_flag = True
+
+        # Launch the dialog.
+        if offset_flag:
+            uf_store['relax_disp.spin_lock_offset'](field=offset, 
spectrum_id=id)
+        else:
+            uf_store['relax_disp.spin_lock_offset'](spectrum_id=id)
+
+
     def action_relax_fit_relax_time(self, event=None, item=None):
         """Launch the relax_fit.relax_time user function.
 
@@ -496,6 +526,12 @@
                 'text': u("Set the spin-&lock field strength \u03BD1"),
                 'icon': fetch_icon("relax.relax_disp"),
                 'method': self.action_relax_disp_spin_lock_field
+            })
+            popup_menus.append({
+                'id': wx.NewId(),
+                'text': u("Set the spin-&lock offset \u03C9_rf"),
+                'icon': fetch_icon("relax.relax_disp"),
+                'method': self.action_relax_disp_spin_lock_offset
             })
         if self.relax_disp_flag and is_cpmg_exp_type(id):
             popup_menus.append({




Related Messages


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