Changeset 377ca62f in sasview for src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py
- Timestamp:
- Apr 8, 2017 4:21:01 AM (8 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7a80072
- Parents:
- cac1828
- git-author:
- Jeff Krzywon <krzywon@…> (04/08/17 04:21:01)
- git-committer:
- krzywon <krzywon@…> (04/08/17 04:21:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py
rcac1828 r377ca62f 9 9 from sas.sasgui.guiframe.events import SlicerParameterEvent, SlicerEvent 10 10 from Plotter2D import ModelPanel2D 11 from sas.sascalc.dataloader.data_info import Data1D, Data2D12 11 apply_params, EVT_APPLY_PARAMS = wx.lib.newevent.NewEvent() 13 12 auto_save, EVT_AUTO_SAVE = wx.lib.newevent.NewEvent() … … 28 27 wx.Dialog.__init__(self, parent, *args, **kwargs) 29 28 self.params = {} 29 self.iter = 0 30 30 self.parent = parent 31 31 self.type = None … … 364 364 :param evt: Event that triggered the call to the method 365 365 """ 366 if self.iter == 0: 367 # Forces the event to be processed after dynamically generated evts 368 clone = evt.Clone() 369 wx.PostEvent(self, clone) 370 self.iter += 1 371 return 366 372 if evt is None: 367 373 return 374 375 # Start definitions 368 376 writer = Reader() 369 377 main_window = self.parent.parent … … 371 379 append = evt.append_to_name 372 380 names = [] 381 file_list = [] 373 382 convert_dict = {"SectorInteractor": "SectorQ", 374 383 "AnnulusInteractor": "AnnulusPhi", 375 384 "BoxInteractorX": "SlabX", 376 385 "BoxInteractorY": "SlabY"} 386 # Get list of 2D data names for saving 377 387 for f_name in evt.file_list: 378 388 names.append(f_name.data2D.label) 389 # Find the correct plots to save 379 390 for key, plot in main_window.plot_panels.iteritems(): 380 391 if not hasattr(plot, "data2D"): … … 383 394 if base in names: 384 395 data_dic[item] = plot.plots[item] 396 # Save files as XML 385 397 for item, data1d in data_dic.iteritems(): 386 398 base = ('.').join(item.split('.')[:-1]) 387 399 save_to = evt.path + "\\" + base + append + ".xml" 388 400 writer.write(save_to, data1d) 401 file_list.append(save_to) 402 # Load files into GUI 403 for item in file_list: 404 self.parent.parent.load_data(item) 389 405 390 406 def on_auto_save_checked(self, evt=None):
Note: See TracChangeset
for help on using the changeset viewer.