Changeset ee2b492 in sasview
- Timestamp:
- Mar 14, 2011 2:44: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:
- e6a93df
- Parents:
- e88ebfd
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_manager.py
re88ebfd ree2b492 186 186 """ 187 187 """ 188 new_data_state = []188 selected_theory = {} 189 189 for d_id in data_id: 190 190 if d_id in self.stored_data: … … 193 193 for t_id in theory_id: 194 194 if t_id in theory_list.keys(): 195 theory = theory_list[t_id]196 new_theory = copy.deepcopy(theory )195 theory_data, theory_state = theory_list[t_id] 196 new_theory = copy.deepcopy(theory_data) 197 197 new_theory.id = wx.NewId() 198 data_state.append_theory(new_theory)199 theory_list.append(new_theory)200 new_data_state.append(data_state)198 selected_theory[new_theory.id] = DataState(new_theory) 199 self.stored_data[new_theory.id] = selected_theory[new_theory.id] 200 else: 201 201 msg = "Theory with ID %s " % str(theory_id) 202 202 msg += "couldn't not be frozen" 203 203 raise ValueError, msg 204 return new_data_state204 return selected_theory 205 205 206 206 -
guiframe/data_panel.py
re88ebfd ree2b492 53 53 PanelBase.__init__(self) 54 54 self.SetupScrolling() 55 55 self.all_data1d = True 56 56 self.parent = parent 57 57 self.manager = manager … … 286 286 """ 287 287 self.tree_ctrl = DataTreeCtrl(parent=self) 288 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_CHECK ED, self.on_check_item)288 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_CHECKING, self.on_check_item) 289 289 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_RIGHT_CLICK, self.on_right_click) 290 290 label = wx.StaticText(self, -1, "LOADED DATA") … … 322 322 self.PopupMenu(self.popUpMenu, pos) 323 323 324 324 325 def on_check_item(self, event): 325 326 """ 326 327 """ 327 328 item = event.GetItem() 328 name = self.tree_ctrl.GetItemText(item) 329 329 item.Check(not item.IsChecked()) 330 self.enable_button(item) 331 event.Skip() 332 333 def enable_button(self, item): 334 """ 335 """ 336 _, data_class, _= self.tree_ctrl.GetItemPyData(item) 337 if item.IsChecked(): 338 self.all_data1d &= (data_class != "Data2D") 339 if self.all_data1d: 340 self.bt_freeze.Enable() 341 else: 342 self.bt_freeze.Disable() 343 else: 344 self.all_data1d |= True 345 self.all_data1d &= (data_class != "Data2D") 346 if self.all_data1d: 347 self.bt_freeze.Enable() 348 else: 349 self.bt_freeze.Disable() 350 330 351 def load_data_list(self, list): 331 352 """ … … 356 377 data=(data_id, data_class, state_id)) 357 378 data_c.Check(True) 379 self.enable_button(data_c) 358 380 d_i_c = self.tree_ctrl.AppendItem(data_c, 'Info') 359 381 i_c_c = self.tree_ctrl.AppendItem(d_i_c, … … 388 410 process.__str__()) 389 411 self.append_theory(state_id, theory_list) 390 412 391 413 392 414 def append_theory(self, state_id, theory_list): … … 420 442 theory_class = theory_data.__class__.__name__ 421 443 theory_id = theory_data.id 422 if theory_state is not None:423 name = theory_state.model.name444 #if theory_state is not None: 445 # name = theory_state.model.name 424 446 temp = (theory_id, theory_class, state_id) 425 447 if theory_id not in theory_list_ctrl: … … 435 457 i_t_c = self.tree_ctrl.AppendItem(t_p_c, 436 458 process.__str__()) 459 t_child.Bind(wx.EVT_TREE_CHECK, self.check_item) 437 460 theory_list_ctrl[theory_id] = [t_child, 438 461 i_c_c, … … 458 481 theory_class = theory_data.__class__.__name__ 459 482 theory_id = theory_data.id 460 if theory_state is not None:461 name = theory_state.model.name483 #if theory_state is not None: 484 # name = theory_state.model.name 462 485 temp = (theory_id, theory_class, state_id) 463 486 t_child = self.tree_ctrl.AppendItem(theory_child, … … 476 499 self.list_cb_theory[data_id] = theory_list_ctrl 477 500 478 501 479 502 def set_data_helper(self): 480 503 """ … … 563 586 """ 564 587 _, theory_id, state_id = self.set_data_helper() 565 self.parent.freeze( state_id=state_id, theory_id=theory_id)588 self.parent.freeze(data_id=state_id, theory_id=theory_id) 566 589 567 590 def set_active_perspective(self, name): … … 648 671 data_list = {} 649 672 # state 1 650 data = Data 1D()651 data.name = "data 1"673 data = Data2D() 674 data.name = "data2" 652 675 data.id = 1 653 676 data.append_empty_process() 654 677 process = data.process[len(data.process)-1] 655 678 process.data = "07/01/2010" 656 theory = Theory1D()679 theory = Data2D() 657 680 theory.id = 34 658 681 theory.name = "theory1" … … 661 684 data_list['1']=set_data_state(data, path,theory, state) 662 685 #state 2 663 data = Data 1D()686 data = Data2D() 664 687 data.name = "data2" 665 688 data.id = 76 666 theory = Theory1D()689 theory = Data2D() 667 690 theory.id = 78 668 691 theory.name = "CoreShell 07/24/25" -
guiframe/gui_manager.py
re88ebfd ree2b492 455 455 456 456 self._data_panel.load_data_list(list=data_state_list) 457 for data_state in data_state_list: 458 theory_list = data_state.get_theory() 459 for new_plot in theory_list: 460 wx.PostEvent(self, NewplotEvent(plot=new_plot, 457 for data_state in data_state_list.values(): 458 new_plot = data_state.get_data() 459 wx.PostEvent(self, NewPlotEvent(plot=new_plot, 461 460 title=new_plot.title)) 462 461 … … 1340 1339 for new_plot in data_list: 1341 1340 if append: 1342 if self.panel_on_focus is None or \ 1343 not self.enable_add_data(new_plot): 1341 if self.panel_on_focus is None: 1344 1342 message = "cannot append plot. No plot panel on focus!" 1345 1343 message += "please click on any available plot to set focus" … … 1468 1466 Enable append data on a plot panel 1469 1467 """ 1468 if self.panel_on_focus not in self._plotting_plugin.plot_panels.values(): 1469 return 1470 1470 is_theory = len(self.panel_on_focus.plots) <= 1 and \ 1471 1471 self.panel_on_focus.plots.values()[0].__class__.__name__ == "Theory1D"
Note: See TracChangeset
for help on using the changeset viewer.