Changeset 940aca7 in sasview for sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
- Timestamp:
- May 19, 2012 10:17:02 AM (12 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:
- baa915c
- Parents:
- d225e32
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
r48832ac r940aca7 276 276 277 277 """ 278 action_check = False 278 279 if hasattr(event, 'action'): 279 group_id = event.group_id 280 if group_id in self.plot_panels.keys(): 281 #remove data from panel 282 if event.action.lower().strip() == 'remove': 283 id = event.id 284 return self.remove_plot(group_id, id) 285 if event.action.lower().strip() == 'hide': 286 return self.hide_panel(group_id) 287 if event.action.lower().strip() == 'delete': 288 panel = self.plot_panels[group_id] 289 uid = panel.uid 290 return self.parent.delete_panel(uid) 291 if event.action.lower().strip() == "clear": 292 return self.clear_panel_by_id(group_id) 280 action_string = event.action.lower().strip() 281 if action_string == 'check': 282 action_check = True 283 else: 284 group_id = event.group_id 285 if group_id in self.plot_panels.keys(): 286 #remove data from panel 287 if action_string == 'remove': 288 id = event.id 289 return self.remove_plot(group_id, id) 290 if action_string == 'hide': 291 return self.hide_panel(group_id) 292 if action_string == 'delete': 293 panel = self.plot_panels[group_id] 294 uid = panel.uid 295 return self.parent.delete_panel(uid) 296 if action_string == "clear": 297 return self.clear_panel_by_id(group_id) 298 293 299 if not hasattr(event, 'plot'): 294 300 return 295 301 title = None 296 302 if hasattr(event, 'title'): 297 title = 'Graph'#event.title 298 303 title = 'Graph'#event.title 299 304 data = event.plot 300 group_id = data.group_id 301 302 if group_id in self.plot_panels.keys(): 305 group_id = data.group_id 306 if group_id in self.plot_panels.keys(): 307 if action_check: 308 # Check if the plot already exist. if it does, do nothing. 309 if data.id in self.plot_panels[group_id].plots.keys(): 310 return 303 311 #update a panel graph 304 312 panel = self.plot_panels[group_id] … … 309 317 new_panel = self.create_1d_panel(data, group_id) 310 318 else: 319 # Need to make the group_id consistent with 1D thus no if below 320 if len(self.plot_panels.values()) > 0: 321 for p_group_id in self.plot_panels.keys(): 322 p_plot = self.plot_panels[p_group_id] 323 if data.id in p_plot.plots.keys(): 324 p_plot.plots[data.id] = data 325 self.plot_panels[group_id] = p_plot 326 if group_id != p_group_id: 327 del self.plot_panels[p_group_id] 328 if p_group_id in data.list_group_id: 329 data.list_group_id.remove(p_group_id) 330 if group_id not in data.list_group_id: 331 data.list_group_id.append(group_id) 332 p_plot.group_id = group_id 333 return 334 311 335 new_panel = self.create_2d_panel(data, group_id) 312 self.create_panel_helper(new_panel, data, group_id, title) 313 336 self.create_panel_helper(new_panel, data, group_id, title) 314 337 return 315 338
Note: See TracChangeset
for help on using the changeset viewer.