Changeset 7a07864 in sasview
- Timestamp:
- Aug 16, 2010 1:35:12 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:
- 077f096
- Parents:
- b63dc6e
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rb63dc6e r7a07864 8 8 from DataLoader.loader import Loader 9 9 from load_thread import DataReader 10 from sans. perspectives.invariant import InvStateUpdateEvent11 from perspectives.fitting import FitStateUpdateEvent10 from sans.guicomm.events import FitStateUpdateEvent 11 from sans.guicomm.events import InvStateUpdateEvent 12 12 13 13 from sans.guicomm.events import NewPlotEvent, StatusEvent -
guiframe/gui_manager.py
rb63dc6e r7a07864 50 50 from sans.guicomm.events import EVT_NEW_PLOT,EVT_SLICER_PARS_UPDATE 51 51 from sans.guicomm.events import EVT_ADD_MANY_DATA 52 53 54 52 from data_manager import DataManager 53 STATE_FILE_EXT = ['.inv','.fitv','.prv'] 55 54 56 55 def quit_guiframe(parent=None): … … 720 719 if basename.endswith('.svs'): 721 720 #remove panels for new states 722 723 724 725 726 plot_data(self, path,'.inv')727 plot_data(self, path,'.prv')728 plot_data(self, path,'.fitv')721 for item in self.panels: 722 try: 723 self.panels[item].clear_panel() 724 except: pass 725 #reset states and plot data 726 for item in STATE_FILE_EXT: 727 exec "plot_data(self, path,'%s')"% str(item) 729 728 else: plot_data(self,path) 729 730 730 if self.defaultPanel is not None and \ 731 731 self._mgr.GetPane(self.panels["default"].window_name).IsShown(): … … 755 755 for item in self.panels: 756 756 try: 757 if self.panels[item].window_name == 'Invariant' or self.panels[item].window_name == 'pr_control' or self.panels[item].window_name == 'Fit panel': 758 if self.panels[item].window_name == 'Invariant': 759 data = self.panels[item]._data 760 if data != None: 761 state = self.panels[item].state 762 new_doc =self.panels[item]._manager.state_reader.write_toXML(data,state) 763 if hasattr(doc, "firstChild"): 764 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 757 if self.panels[item].window_name == 'Invariant': 758 data = self.panels[item]._data 759 if data != None: 760 state = self.panels[item].state 761 new_doc =self.panels[item]._manager.state_reader.write_toXML(data,state) 762 if hasattr(doc, "firstChild"): 763 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 764 else: 765 doc = new_doc 766 elif self.panels[item].window_name == 'pr_control': 767 data = self.panels[item].manager.current_plottable 768 if data != None: 769 state = self.panels[item].get_state() 770 new_doc =self.panels[item].manager.state_reader.write_toXML(data,state) 771 if hasattr(doc, "firstChild"): 772 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 773 else: 774 doc = new_doc 775 elif self.panels[item].window_name == 'Fit panel': 776 for index in range(self.panels[item].GetPageCount()): 777 selected_page = self.panels[item].GetPage(index) 778 if hasattr(selected_page,"get_data"): 779 data = selected_page.get_data() 780 state = selected_page.state 781 new_doc =selected_page.manager.state_reader.write_toXML(data,state) 782 if doc != None and hasattr(doc, "firstChild"): 783 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 765 784 else: 766 doc = new_doc 767 elif self.panels[item].window_name == 'pr_control': 768 data = self.panels[item].manager.current_plottable 769 if data != None: 770 state = self.panels[item].get_state() 771 new_doc =self.panels[item].manager.state_reader.write_toXML(data,state) 772 if hasattr(doc, "firstChild"): 773 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 774 else: 775 doc = new_doc 776 elif self.panels[item].window_name == 'Fit panel': 777 for index in range(self.panels[item].GetPageCount()): 778 selected_page = self.panels[item].GetPage(index) 779 if hasattr(selected_page,"get_data"): 780 data = selected_page.get_data() 781 state = selected_page.state 782 new_doc =selected_page.manager.state_reader.write_toXML(data,state) 783 if doc != None and hasattr(doc, "firstChild"): 784 doc.firstChild.appendChild (new_doc.firstChild.firstChild) 785 else: 786 doc = new_doc 785 doc = new_doc 787 786 788 787 except: -
invariantview/perspectives/invariant/invariant.py
r9b18735 r7a07864 26 26 from DataLoader.loader import Loader 27 27 from invariant_panel import InvariantPanel 28 (InvStateUpdateEvent, EVT_STATE_UPDATE) = wx.lib.newevent.NewEvent() 28 from sans.guicomm.events import EVT_INVSTATE_UPDATE 29 29 30 30 class Plugin: … … 98 98 #add error back to the data 99 99 self.parent.Bind(ERR_DATA, self._on_data_error) 100 self.parent.Bind(EVT_ STATE_UPDATE, self.on_set_state_helper)100 self.parent.Bind(EVT_INVSTATE_UPDATE, self.on_set_state_helper) 101 101 102 102 self.invariant_panel = InvariantPanel(parent=self.parent) -
sansview/perspectives/fitting/fitting.py
rb63dc6e r7a07864 35 35 from sans.guicomm.events import EVT_SLICER_PANEL,ERR_DATA,EVT_REMOVE_DATA 36 36 from sans.guicomm.events import EVT_SLICER_PARS_UPDATE 37 from sans.guicomm.events import EVT_FITSTATE_UPDATE 37 38 38 39 from sans.fit.AbstractFitEngine import Model … … 51 52 52 53 (PageInfoEvent, EVT_PAGE_INFO) = wx.lib.newevent.NewEvent() 53 (FitStateUpdateEvent, EVT_STATE_UPDATE) = wx.lib.newevent.NewEvent()54 #(FitStateUpdateEvent, EVT_STATE_UPDATE) = wx.lib.newevent.NewEvent() 54 55 from fitpage import Chi2UpdateEvent 55 56 … … 238 239 """ 239 240 self.parent = parent 240 self.parent.Bind(EVT_ STATE_UPDATE, self.on_set_state_helper)241 self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper) 241 242 # Creation of the fit panel 242 243 self.fit_panel = FitPanel(self.parent, -1) … … 320 321 : event: FitStateUpdateEvent called by dataloader.plot_data from guiframe 321 322 """ 322 if len(self.temp_state) == 0 and self.sfile_ext =='.svs':323 if self.state_index==0 and len(self.mypanels) <= 0 :323 if len(self.temp_state) == 0: 324 if self.state_index==0 and len(self.mypanels) <= 0 and self.sfile_ext =='.svs': 324 325 self.fit_panel.add_default_pages() 325 326 self.temp_state = []
Note: See TracChangeset
for help on using the changeset viewer.