Changeset 3658717e in sasview
- Timestamp:
- Mar 16, 2011 7:08:41 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:
- 20b482f
- Parents:
- d7f727d
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_panel.py
rd7f727d r3658717e 508 508 item, _, _, _, _, _ = value 509 509 if item.IsChecked(): 510 data_id, _, state_id = self.tree_ctrl.GetItemPyData(item) 511 data_to_plot.append(data_id) 512 if state_id not in state_to_plot: 513 state_to_plot.append(state_id) 510 data_id, _, state_id = self.tree_ctrl.GetItemPyData(item) 511 data_to_plot.append(data_id) 512 if state_id not in state_to_plot: 513 state_to_plot.append(state_id) 514 514 515 for theory_dict in self.list_cb_theory.values(): 515 516 for key, value in theory_dict.iteritems(): … … 535 536 def on_remove(self, event): 536 537 """ 537 remove data from application 538 Get a list of item checked and remove them from the treectrl 539 Ask the parent to remove reference to this item 538 540 """ 539 541 data_to_remove, theory_to_remove, _ = self.set_data_helper() 540 542 data_key = [] 541 543 theory_key = [] 542 for key, item in self.list_cb_data.iteritems(): 544 #remove data from treectrl 545 for d_key, item in self.list_cb_data.iteritems(): 543 546 data_c, d_i_c, i_c_c, p_c_c, d_p_c, t_c = item 544 547 if data_c.IsChecked(): 545 548 self.tree_ctrl.Delete(data_c) 546 data_key.append(key) 547 548 for key, theory_dict in self.list_cb_theory.iteritems(): 549 for value in theory_dict.values(): 549 data_key.append(d_key) 550 if d_key in self.list_cb_theory.keys(): 551 theory_list_ctrl = self.list_cb_theory[d_key] 552 theory_to_remove += theory_list_ctrl.keys() 553 # Remove theory from treectrl 554 for t_key, theory_dict in self.list_cb_theory.iteritems(): 555 for key, value in theory_dict.iteritems(): 550 556 item, _, _ = value 551 557 if item.IsChecked(): 552 558 self.tree_ctrl.Delete(item) 553 559 theory_key.append(key) 560 #Remove data and related theory references 554 561 for key in data_key: 555 562 del self.list_cb_data[key] 563 if key in theory_key: 564 del self.list_cb_theory[key] 565 #remove theory references independently of data 556 566 for key in theory_key: 557 del self.list_cb_theory[key] 567 for t_key, theory_dict in self.list_cb_theory.iteritems(): 568 del theory_dict[key] 569 558 570 self.parent.remove_data(data_id=data_to_remove, 559 571 theory_id=theory_to_remove) -
guiframe/gui_manager.py
rd7f727d r3658717e 1383 1383 else delete theory 1384 1384 """ 1385 for plug in self.plugins: 1386 plug.delete_data(data_id) 1387 total_plot_list = [] 1388 data_list, _ = self._data_manager.get_by_id(data_id) 1389 _, temp_list_theory = self._data_manager.get_by_id(theory_id) 1390 total_plot_list = data_list.values() 1391 for item in temp_list_theory.values(): 1392 theory_data, theory_state = item 1393 total_plot_list.append(theory_data) 1394 for new_plot in total_plot_list: 1395 id = new_plot.id 1396 for group_id in new_plot.list_group_id: 1397 wx.PostEvent(self, NewPlotEvent(id=id, 1398 group_id=group_id, 1399 action='remove')) 1385 1400 self._data_manager.delete_data(data_id=data_id, 1386 1401 theory_id=theory_id) 1387 for plug in self.plugins:1388 plug.delete_data(data_id)1389 1402 1390 1403 -
guiframe/local_perspectives/plotting/plotting.py
rdf22224 r3658717e 177 177 raise ValueError, msg 178 178 else: 179 if panel.group_id not in data.list_group_id: 180 data.list_group_id.append(panel.group_id) 179 181 panel.plot_data( data) 180 182 self.parent.show_panel(panel.uid) … … 240 242 new_panel = self.create_2d_panel(data, group_id) 241 243 self.create_panel_helper(new_panel, data, group_id, title) 242 244 print "_on_plot_event", data.list_group_id 243 245 return 244 246 -
guiframe/plugin_base.py
re88ebfd r3658717e 70 70 return True 71 71 72 def is_in_use(self, data_id): 73 """ 74 get a data id and return true or false if the data 75 is currently in use the current plugin 76 """ 77 return False 78 72 79 def delete_data(self, data_id): 73 80 """
Note: See TracChangeset
for help on using the changeset viewer.