- 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
-
prview/perspectives/pr/pr.py
ra3149c5 re88ebfd 219 219 new_plot.xaxis("\\rm{r}", 'A') 220 220 new_plot.yaxis("\\rm{P(r)} ","cm^{-3}") 221 group_id = "P_{obs}(r)" 222 if group_id not in new_plot.group_id: 223 new_plot.group_id.append(group_id) 221 new_plot.group_id = "P_{obs}(r)" 224 222 new_plot.id = "P_{obs}(r)" 225 223 new_plot.title = title … … 255 253 new_plot.yaxis("\\rm{P(r)} ","cm^{-3}") 256 254 new_plot.id = "P_{true}(r)" 257 group_id = "P_{true}(r)" 258 if group_id not in new_plot.group_id: 259 new_plot.group_id.append(group_id) 255 new_plot.group_id = "P_{true}(r)" 260 256 self.parent.append_theory(data_id=self.current_plottable.id, 261 257 theory=new_plot) … … 316 312 # If we have a group ID, use it 317 313 if pr.info.has_key("plot_group_id"): 318 if len( pr.info["plot_group_id"]) > 0: 319 index = len( pr.info["plot_group_id"]) - 1 320 new_plot.group_id.append( pr.info["plot_group_id"][index]) 314 new_plot.group_id = pr.info["plot_group_id"] 321 315 new_plot.id = IQ_FIT_LABEL 322 316 self.parent.append_theory(data_id=self.current_plottable.id, … … 345 339 # If we have a group ID, use it 346 340 if pr.info.has_key("plot_group_id"): 347 if len( pr.info["plot_group_id"]) > 0: 348 index = len( pr.info["plot_group_id"]) - 1 349 new_plot.group_id.append( pr.info["plot_group_id"][index]) 350 341 new_plot.group_id = pr.info["plot_group_id"] 351 342 new_plot.id = IQ_SMEARED_LABEL 352 343 new_plot.title = title … … 418 409 new_plot.xtransform = "x" 419 410 new_plot.ytransform = "y" 420 group_id = "P(r) fit" 421 if group_id not in new_plot.group_id: 422 new_plot.group_id.append(group_id) 411 new_plot.group_id = "P(r) fit" 423 412 self.parent.append_theory(data_id=self.current_plottable.id, 424 413 theory=new_plot) … … 674 663 new_plot = Data1D(self._added_plots[plot].x, y) 675 664 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 676 index = len(self._added_plots[plot].group_id) - 1 677 if group_id not in new_plot.group_id: 678 new_plot.group_id.append(group_id) 665 new_plot.group_id = self._added_plots[plot].group_id 679 666 new_plot.id = self._added_plots[plot].id 680 667 new_plot.title = self._added_plots[plot].title … … 888 875 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 889 876 if pr.info.has_key("plot_group_id"): 890 new_plot.group_id .append(pr.info["plot_group_id"])877 new_plot.group_id = pr.info["plot_group_id"] 891 878 new_plot.id = IQ_DATA_LABEL 892 879 self.parent.append_theory(data_id=self.current_plottable.id, … … 937 924 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 938 925 new_plot.interactive = True 939 new_plot.group_id .append(IQ_DATA_LABEL)926 new_plot.group_id = IQ_DATA_LABEL 940 927 new_plot.id = IQ_DATA_LABEL 941 928 new_plot.title = "I(q)" … … 1049 1036 # Keep track of the plot window title to ensure that 1050 1037 # we can overlay the plots 1051 if self.current_plottable.group_id: 1052 index = len(self.current_plottable.group_id) - 1 1053 group_id = self.current_plottable.group_id[index] 1054 pr.info["plot_group_id"] = self.current_plottable.group_id 1038 pr.info["plot_group_id"] = self.current_plottable.group_id 1055 1039 1056 1040 # Fill in errors if none were provided … … 1350 1334 return [self.control_panel] 1351 1335 1352 def set_data(self, data_list=None , theory_list=None):1336 def set_data(self, data_list=None): 1353 1337 """ 1354 1338 receive a list of data to compute pr … … 1356 1340 if data_list is None: 1357 1341 data_list = [] 1358 if len(data_list) > 1: 1359 msg = "Pr panel does not allow multiple Data.\n" 1360 msg += "Please select one!\n" 1361 from pr_widgets import DataDialog 1362 dlg = DataDialog(data_list=data_list, text=msg) 1363 if dlg.ShowModal() == wx.ID_OK: 1364 data = dlg.get_data() 1365 if issubclass(data.__class__, Data1D): 1342 if len(data_list) >= 1: 1343 if len(data_list) == 1: 1344 data = data_list[0] 1345 else: 1346 msg = "Pr panel does not allow multiple Data.\n" 1347 msg += "Please select one!\n" 1348 from pr_widgets import DataDialog 1349 dlg = DataDialog(data_list=data_list, text=msg) 1350 if dlg.ShowModal() == wx.ID_OK: 1351 data = dlg.get_data() 1352 if data is None: 1353 return 1354 if issubclass(data.__class__, Data1D): 1355 try: 1366 1356 self.control_panel._change_file(evt=None, data=data) 1367 else: 1368 msg = "Pr cannot be computed for data of " 1369 msg += "type %s" % (data_list[0].__class__.__name__) 1370 wx.PostEvent(self.parent, 1371 StatusEvent(status=msg, info='error')) 1372 elif len(data_list) == 1: 1373 if issubclass(data_list[0].__class__, Data1D): 1374 self.control_panel._change_file(evt=None, data=data_list[0]) 1375 else: 1376 msg = "Pr cannot be computed for" 1377 msg += " data of type %s" % (data_list[0].__class__.__name__) 1357 except: 1358 msg = "Prview Set_data: " + str(sys.exc_value) 1359 wx.PostEvent(self.parent, StatusEvent(status=msg, 1360 info="error")) 1361 else: 1362 msg = "Pr cannot be computed for data of " 1363 msg += "type %s" % (data_list[0].__class__.__name__) 1378 1364 wx.PostEvent(self.parent, 1379 1365 StatusEvent(status=msg, info='error')) 1380 1366 else: 1381 1367 msg = "Pr contain no data"
Note: See TracChangeset
for help on using the changeset viewer.