Changeset 377ca62f in sasview


Ignore:
Timestamp:
Apr 8, 2017 2:21:01 AM (7 years ago)
Author:
krzywon
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 02:21:01)
git-committer:
krzywon <krzywon@…> (04/08/17 02:21:01)
Message:

All files saved and reloaded into data manager. see #467

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py

    rcac1828 r377ca62f  
    99from sas.sasgui.guiframe.events import SlicerParameterEvent, SlicerEvent 
    1010from Plotter2D import ModelPanel2D 
    11 from sas.sascalc.dataloader.data_info import Data1D, Data2D 
    1211apply_params, EVT_APPLY_PARAMS = wx.lib.newevent.NewEvent() 
    1312auto_save, EVT_AUTO_SAVE = wx.lib.newevent.NewEvent() 
     
    2827        wx.Dialog.__init__(self, parent, *args, **kwargs) 
    2928        self.params = {} 
     29        self.iter = 0 
    3030        self.parent = parent 
    3131        self.type = None 
     
    364364        :param evt: Event that triggered the call to the method 
    365365        """ 
     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 
    366372        if evt is None: 
    367373            return 
     374 
     375        # Start definitions 
    368376        writer = Reader() 
    369377        main_window = self.parent.parent 
     
    371379        append = evt.append_to_name 
    372380        names = [] 
     381        file_list = [] 
    373382        convert_dict = {"SectorInteractor": "SectorQ", 
    374383                        "AnnulusInteractor": "AnnulusPhi", 
    375384                        "BoxInteractorX": "SlabX", 
    376385                        "BoxInteractorY": "SlabY"} 
     386        # Get list of 2D data names for saving 
    377387        for f_name in evt.file_list: 
    378388            names.append(f_name.data2D.label) 
     389        # Find the correct plots to save 
    379390        for key, plot in main_window.plot_panels.iteritems(): 
    380391            if not hasattr(plot, "data2D"): 
     
    383394                    if base in names: 
    384395                        data_dic[item] = plot.plots[item] 
     396        # Save files as XML 
    385397        for item, data1d in data_dic.iteritems(): 
    386398            base = ('.').join(item.split('.')[:-1]) 
    387399            save_to = evt.path + "\\" + base + append + ".xml" 
    388400            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) 
    389405 
    390406    def on_auto_save_checked(self, evt=None): 
Note: See TracChangeset for help on using the changeset viewer.