- Timestamp:
- Apr 22, 2010 4:07:22 PM (15 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:
- 85a8e95
- Parents:
- efea0bd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
r04349fe rd792e813 11 11 from sans.guicomm.events import NewPlotEvent, StatusEvent 12 12 13 def enable_add_data(existing_panel, new_plot): 14 """ 15 Enable append data on a plot panel 16 """ 17 is_theory = len(existing_panel.plots)<= 1 and \ 18 existing_panel.plots.values()[0].__class__.__name__=="Theory1D" 19 20 is_data2d = hasattr(new_plot, 'data') 21 is_data1d = existing_panel.__class__.__name__ == "ModelPanel1D"\ 22 and existing_panel.group_id is not None 23 24 return is_data1d and not is_data2d and not is_theory 13 25 14 26 def parse_name(name, expression): … … 41 53 return path 42 54 43 def append_data_to_existing_panel(panel_name, data_name):55 def open_dialog_append_data(panel_name, data_name): 44 56 """ 45 57 Pop up an error message. … … 202 214 panel_name = existing_panel.window_caption 203 215 data_name = new_plot.name 204 if existing_panel.__class__.__name__ == "ModelPanel1D"\ 205 and existing_panel.group_id is not None and \ 206 not hasattr(new_plot, 'data'): 207 if append_data_to_existing_panel(panel_name, data_name): 216 if enable_add_data(existing_panel, new_plot): 217 if open_dialog_append_data(panel_name, data_name): 208 218 #add this plot the an existing panel 209 219 new_plot.group_id = existing_panel.group_id … … 261 271 panel_name = existing_panel.window_caption 262 272 data_name = new_plot.name 263 if existing_panel.__class__.__name__ == "ModelPanel1D"\ 264 and existing_panel.group_id is not None and \ 265 not hasattr(new_plot, 'data'): 266 if append_data_to_existing_panel(panel_name, data_name): 273 if enable_add_data(existing_panel, new_plot): 274 if open_dialog_append_data(panel_name, data_name): 267 275 #add this plot the an existing panel 268 276 new_plot.group_id = existing_panel.group_id
Note: See TracChangeset
for help on using the changeset viewer.