Author: bugman Date: Thu Aug 21 17:37:17 2014 New Revision: 25183 URL: http://svn.gna.org/viewcvs/relax?rev=25183&view=rev Log: Merged revisions 25182 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r25182 | bugman | 2014-08-21 17:30:29 +0200 (Thu, 21 Aug 2014) | 9 lines 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: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/gui/components/spectrum.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Aug 21 17:37:17 2014 @@ -1 +1 @@ -/trunk:1-25180 +/trunk:1-25182 Modified: branches/frame_order_cleanup/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/gui/components/spectrum.py?rev=25183&r1=25182&r2=25183&view=diff ============================================================================== --- branches/frame_order_cleanup/gui/components/spectrum.py (original) +++ branches/frame_order_cleanup/gui/components/spectrum.py Thu Aug 21 17:37:17 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