Changeset e5ae812 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Nov 13, 2018 5:25:48 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
baeac95
Parents:
133812c7
Message:

Added C&S tab serialization.

Location:
src/sas/qtgui/MainWindow
Files:
2 edited

Legend:

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

    r133812c7 re5ae812  
    457457                self.chkBatch.setChecked(True if value=='True' else False) 
    458458                continue 
     459            if 'cs_tab' in key: 
     460                continue 
    459461            # send newly created items to the perspective 
    460462            self.updatePerspectiveWithProperties(key, value) 
     
    462464        # See if there are any batch pages defined and create them, if so 
    463465        self.updateWithBatchPages(all_data) 
     466 
     467        # Only now can we create/assign C&S pages. 
     468        for key, value in all_data.items(): 
     469            if 'cs_tab' in key: 
     470                self.updatePerspectiveWithProperties(key, value) 
    464471 
    465472    def updateWithBatchPages(self, all_data): 
     
    488495                self._perspective().setData(data_item=items, is_batch=True) 
    489496                self._perspective().updateFromParameters(page) 
    490  
    491497        pass 
    492498 
     
    494500        """ 
    495501        """ 
    496         data_dict = {key:value['fit_data']} 
    497         # Create new model items in the data explorer 
    498         items = self.updateModelFromData(data_dict) 
     502        if 'fit_data' in value: 
     503            data_dict = {key:value['fit_data']} 
     504            # Create new model items in the data explorer 
     505            items = self.updateModelFromData(data_dict) 
    499506 
    500507        if 'fit_params' in value: 
     
    512519                # Assign parameters to the most recent (current) page. 
    513520                self._perspective().updateFromParameters(page) 
     521        if 'cs_tab' in key and 'is_constraint' in value: 
     522            # Create a C&S page 
     523            self._perspective().addConstraintTab() 
     524            # Modify the tab 
     525            self._perspective().updateFromParameters(value) 
     526 
    514527        pass # debugger 
    515528 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r133812c7 re5ae812  
    594594            analysis[id] = data_content 
    595595 
     596        # standalone constraint pages 
     597        for keys, values in params.items(): 
     598            if not 'is_constraint' in values[0]: 
     599                continue 
     600            analysis[keys] = values[0] 
     601 
    596602        with open(filename, 'w') as outfile: 
    597603            GuiUtils.saveData(outfile, analysis) 
     
    11771183            out_f.write("#Application appearance custom configuration\n") 
    11781184            for key, item in config.__dict__.items(): 
    1179                 if key[:2] != "__": 
    1180                     if isinstance(item, str): 
    1181                         item = '"' + item + '"' 
    1182                     out_f.write("%s = %s\n" % (key, str(item))) 
     1185                if key[:2] == "__": 
     1186                    continue 
     1187                if isinstance(item, str): 
     1188                    item = '"' + item + '"' 
     1189                out_f.write("%s = %s\n" % (key, str(item))) 
    11831190        pass # debugger anchor 
Note: See TracChangeset for help on using the changeset viewer.