Changeset 3c44c66 in sasview for invariantview/perspectives/invariant
- Timestamp:
- Jul 20, 2010 2:36:35 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- cb19af9f
- Parents:
- 1b17a64
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant_panel.py
r4e1c362 r3c44c66 113 113 return flag 114 114 115 def set_data(self, data): 115 def set_data(self, list=[], state=None): 116 """ 117 Receive a list of data from gui_manager to compute invariant 118 """ 119 if list==[]: 120 msg = "Please select data for Invariant perspective.\n" 121 dial = wx.MessageDialog(None, msg, 'Error Loading File', 122 wx.OK | wx.ICON_EXCLAMATION) 123 dial.ShowModal() 124 return 125 elif len(list) == 1: 126 data, filepath = list[0] 127 if data.__class__.__name__ == "Data2D": 128 msg = "Invariant cannot be computed for Data2D.\n" 129 msg += "Please load another file.\n" 130 dial = wx.MessageDialog(None, msg, 'Error Loading File', 131 wx.OK | wx.ICON_EXCLAMATION) 132 dial.ShowModal() 133 else: 134 self.set_current_data(data=data) 135 else: 136 msg = " Invariant cannot be computed for more than one data.\n" 137 msg += "Please load only file.\n" 138 dial = wx.MessageDialog(None, msg, 'Error Loading File', 139 wx.OK | wx.ICON_EXCLAMATION) 140 dial.ShowModal() 141 142 def set_current_data(self, data): 116 143 """ 117 144 Set the data 118 145 119 : return: True/False; if False, it will not set_ data146 : return: True/False; if False, it will not set_current_data 120 147 """ 121 148 # warn the users … … 178 205 self.state = IState() 179 206 else: 180 if not self.set_ data(data):207 if not self.set_current_data(data): 181 208 return 182 209 self.new_state = True … … 826 853 def _reset_state_list(self,data=None): 827 854 """ 828 Reset the state_list just before data was loading: Used in 'set_ data()'855 Reset the state_list just before data was loading: Used in 'set_current_data()' 829 856 """ 830 857 #if data == None: return … … 1703 1730 1704 1731 data.name = data.filename 1705 self.panel.set_ data(data)1732 self.panel.set_current_data(data) 1706 1733 self.Centre() 1707 1734 self.Show(True)
Note: See TracChangeset
for help on using the changeset viewer.