Changeset e88ebfd in sasview for invariantview/perspectives/invariant
- Timestamp:
- Mar 11, 2011 4:39:00 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:
- ee2b492
- Parents:
- 14cd91b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant.py
r14cd91b1 re88ebfd 144 144 self.compute_helper(data=data) 145 145 146 def set_data(self, data_list=None , theory_list=None):146 def set_data(self, data_list=None): 147 147 """ 148 148 receive a list of data and compute invariant … … 151 151 if data_list is None: 152 152 data_list = [] 153 if len(data_list) > 1: 154 msg = "invariant panel does not allow multiple data!\n" 155 msg += "Please select one.\n" 156 from invariant_widgets import DataDialog 157 dlg = DataDialog(data_list=data_list, text=msg) 158 if dlg.ShowModal() == wx.ID_OK: 159 data = dlg.get_data() 160 elif len(data_list) == 1: 161 data = data_list[0] 162 if data is None: 163 return 164 if issubclass(data.__class__, Data1D): 165 wx.PostEvent(self.parent, NewPlotEvent(plot=data, 166 title=data.title)) 167 self.compute_helper(data) 153 if len(data_list) >= 1: 154 if len(data_list) == 1: 155 data = data_list[0] 156 else: 157 msg = "invariant panel does not allow multiple data!\n" 158 msg += "Please select one.\n" 159 from invariant_widgets import DataDialog 160 dlg = DataDialog(data_list=data_list, text=msg) 161 if dlg.ShowModal() == wx.ID_OK: 162 data = dlg.get_data() 163 if data is None: 164 return 165 if issubclass(data.__class__, Data1D): 166 wx.PostEvent(self.parent, NewPlotEvent(plot=data, 167 title=data.title)) 168 try: 169 self.compute_helper(data) 170 except: 171 msg = "Prview Set_data: " + str(sys.exc_value) 172 wx.PostEvent(self.parent, StatusEvent(status=msg, 173 info="error")) 168 174 else: 169 175 msg = "invariant cannot be computed for data of " … … 230 236 data.filename = name 231 237 data = self.parent.create_gui_data(data,None) 232 #self.__data = datainfo233 #self.__data.group_id = data.filename234 #self.__data.id = datainfo.filename235 238 self.__data = data 236 239 wx.PostEvent(self.parent, NewPlotEvent(plot=self.__data, … … 271 274 if data is None: 272 275 id = str(self.__data.id) + name 273 self.__data.group_id276 group_id = self.__data.group_id 274 277 wx.PostEvent(self.parent, NewPlotEvent(id=id, 275 278 group_id=group_id,
Note: See TracChangeset
for help on using the changeset viewer.