Changeset e88ebfd in sasview for guiframe/data_panel.py
- 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
-
guiframe/data_panel.py
rae83ad3 re88ebfd 410 410 411 411 for theory_id, item in theory_list.iteritems(): 412 theory_data, _= item412 theory_data, theory_state = item 413 413 if theory_data is None: 414 414 name = "Unknown" … … 420 420 theory_class = theory_data.__class__.__name__ 421 421 theory_id = theory_data.id 422 if theory_state is not None: 423 name = theory_state.model.name 422 424 temp = (theory_id, theory_class, state_id) 423 425 if theory_id not in theory_list_ctrl: … … 451 453 theory_list_ctrl = {} 452 454 for theory_id, item in theory_list.iteritems(): 453 theory_data, _= item455 theory_data, theory_state = item 454 456 if theory_data is not None: 457 name = theory_data.name 455 458 theory_class = theory_data.__class__.__name__ 456 459 theory_id = theory_data.id 460 if theory_state is not None: 461 name = theory_state.model.name 462 temp = (theory_id, theory_class, state_id) 457 463 t_child = self.tree_ctrl.AppendItem(theory_child, 458 theory_data.name, ct_type=1,464 name, ct_type=1, 459 465 data=(theory_data.id, theory_class, state_id)) 460 466 t_i_c = self.tree_ctrl.AppendItem(t_child, 'Info') … … 475 481 """ 476 482 data_to_plot = [] 483 state_to_plot = [] 484 theory_to_plot = [] 477 485 for value in self.list_cb_data.values(): 478 486 item, _, _, _, _, _ = value 479 487 if item.IsChecked(): 480 data_id, _, _= self.tree_ctrl.GetItemPyData(item)488 data_id, _, state_id = self.tree_ctrl.GetItemPyData(item) 481 489 data_to_plot.append(data_id) 482 theory_to_plot = [] 490 if state_id not in state_to_plot: 491 state_to_plot.append(state_id) 483 492 for theory_dict in self.list_cb_theory.values(): 484 493 for key, value in theory_dict.iteritems(): 485 494 item, _, _ = value 486 495 if item.IsChecked(): 487 theory_id, _, _= self.tree_ctrl.GetItemPyData(item)496 theory_id, _, state_id = self.tree_ctrl.GetItemPyData(item) 488 497 theory_to_plot.append(theory_id) 489 return data_to_plot, theory_to_plot 498 if state_id not in state_to_plot: 499 state_to_plot.append(state_id) 500 return data_to_plot, theory_to_plot, state_to_plot 490 501 491 502 def remove_by_id(self, id): … … 524 535 Get all select data and set them to the current active perspetive 525 536 """ 526 self.post_helper(plot=False) 527 537 data_id, theory_id, state_id = self.set_data_helper() 538 self.parent.set_data(data_id) 539 self.parent.set_data(state_id=state_id, theory_id=theory_id) 540 528 541 def on_append_plot(self, event=None): 529 542 """ 530 543 append plot to plot panel on focus 531 544 """ 532 self.post_helper(plot=True, append=True) 545 data_id, theory_id, state_id = self.set_data_helper() 546 self.parent.plot_data(data_id=data_id, 547 state_id=state_id, 548 theory_id=theory_id, 549 append=True) 533 550 534 551 def on_plot(self, event=None): … … 536 553 Send a list of data names to plot 537 554 """ 538 self.post_helper(plot=True) 555 data_id, theory_id, state_id = self.set_data_helper() 556 self.parent.plot_data(data_id=data_id, 557 state_id=state_id, 558 theory_id=theory_id, 559 append=False) 539 560 540 561 def on_freeze(self, event): 541 562 """ 542 563 """ 543 data_to_plot, theory_to_plot= self.set_data_helper()544 self.parent.freeze( data_id=data_to_plot, theory_id=theory_to_plot)564 _, theory_id, state_id = self.set_data_helper() 565 self.parent.freeze(state_id=state_id, theory_id=theory_id) 545 566 546 567 def set_active_perspective(self, name): … … 555 576 """ 556 577 self.tctrl_plotpanel.SetLabel(str(name)) 557 558 def post_helper(self, plot=False, append=False): 559 """ 560 """ 561 data_to_plot, theory_to_plot = self.set_data_helper() 562 if self.parent is not None: 563 self.parent.get_data_from_panel(data_id=data_to_plot, plot=plot, 564 append=append) 565 578 566 579 567 580
Note: See TracChangeset
for help on using the changeset viewer.