Changeset 99f8760 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Dec 4, 2018 7:37:38 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
0989bad
Parents:
d9e7792
Message:

Improvements to batch save/load SASVIEW-1222.
Project save/load will now recreate the grid window as well as retain
result theories under dataset indices.

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rd9e7792 r99f8760  
    354354            properties['checked'] = is_checked 
    355355            other_datas = [] 
    356             # no need to save other_datas - things will be refit on read 
    357             #other_datas = GuiUtils.plotsFromFilename(filename, model) 
     356            # save underlying theories 
     357            other_datas = GuiUtils.plotsFromFilename(filename, model) 
    358358            # skip the main plot 
    359             #other_datas = list(other_datas.values())[1:] 
     359            other_datas = list(other_datas.values())[1:] 
    360360            all_data[data.id] = [data, properties, other_datas] 
    361361        return all_data 
     
    457457            if key=='is_batch': 
    458458                self.chkBatch.setChecked(True if value=='True' else False) 
     459                if 'batch_grid' not in all_data: 
     460                    continue 
     461                grid_pages = all_data['batch_grid'] 
     462                for grid_name, grid_page in grid_pages.items(): 
     463                    grid_page.append(grid_name) 
     464                    self.parent.showBatchOutput(grid_page) 
    459465                continue 
    460466            if 'cs_tab' in key: 
  • src/sas/qtgui/MainWindow/GuiManager.py

    rd9e7792 r99f8760  
    588588            if id=='is_batch': 
    589589                analysis['is_batch'] = data 
     590                analysis['batch_grid'] = self.grid_window.data_dict 
    590591                continue 
    591592            data_content = {"fit_data":data} 
     
    710711        """ 
    711712        self.grid_subwindow.setVisible(True) 
     713        self.grid_subwindow.raise_() 
    712714        if output_data: 
    713715            self.grid_window.addFitResults(output_data) 
  • src/sas/qtgui/Utilities/GridPanel.py

    rc4c4957 r99f8760  
    3636        # Tab numbering 
    3737        self.tab_number = 1 
     38 
     39        # save state 
     40        self.data_dict = {} 
    3841 
    3942        # System dependent menu items 
     
    176179        model_name = results[0][0].model.id 
    177180        self.tabWidget.setTabToolTip(self.tabWidget.count()-1, model_name) 
    178  
     181        self.data_dict[page_name] = results 
    179182 
    180183    @classmethod 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r133812c7 r99f8760  
    3636from sas.qtgui.Plotting.Plottables import Chisq 
    3737from sas.qtgui.MainWindow.DataState import DataState 
     38 
     39from sas.sascalc.fit.AbstractFitEngine import FResult 
     40from sas.sascalc.fit.AbstractFitEngine import FitData1D, FitData2D 
     41from sasmodels.sasview_model import SasviewModel 
    3842 
    3943from sas.sascalc.dataloader.loader import Loader 
     
    11751179 
    11761180        # "simple" types 
    1177         if isinstance(o, (Sample, Source, Vector)): 
     1181        if isinstance(o, (Sample, Source, Vector, FResult)): 
    11781182            return add_type(o.__dict__, type(o)) 
    11791183        if isinstance(o, (Plottable, View)): 
    11801184            return add_type(o.__dict__, type(o)) 
    11811185 
     1186        # SasviewModel - unique 
     1187        if isinstance(o, SasviewModel): 
     1188            # don't store parent 
     1189            content = o.__dict__.copy() 
     1190            return add_type(content, SasviewModel) 
     1191 
    11821192        # DataState 
    1183         if isinstance(o, (Data1D, Data2D)): 
     1193        if isinstance(o, (Data1D, Data2D, FitData1D, FitData2D)): 
    11841194            # don't store parent 
    11851195            content = o.__dict__.copy() 
     
    12101220        Sample, Source, Vector, 
    12111221        Plottable, Data1D, Data2D, PlottableTheory1D, PlottableFit1D, Text, Chisq, View, 
    1212         DataState, np.ndarray] 
     1222        DataState, np.ndarray, FResult, FitData1D, FitData2D, SasviewModel] 
    12131223 
    12141224    lookup = dict((cls.__name__, cls) for cls in supported) 
     
    12421252 
    12431253        # "simple" types 
    1244         if cls in (Sample, Source, Vector): 
     1254        if cls in (Sample, Source, Vector, FResult, FitData1D, FitData2D, SasviewModel): 
    12451255            return simple_type(cls, data, level) 
    12461256        if issubclass(cls, Plottable) or (cls == View): 
Note: See TracChangeset for help on using the changeset viewer.