Ignore:
Timestamp:
Oct 7, 2016 12:21:40 PM (8 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.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ff3f5821
Parents:
cb823f0
Message:

#189 #12 Saving and loading project now fully saves and loads a simultaneous fits. Loading a project will reset Sasview state to its base state (with a warning). One error on load to fix before calling this finished.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/simfitpage.py

    r4fea1df r998ca90  
    10501050        """ 
    10511051 
    1052         # FIXME: Not tracking data set name on loading ==> NECESSARY! 
    10531052        model_map = {} 
    10541053        if fit.fit_panel.sim_page is None: 
     
    10691068                    check = bool(saved_model.pop('checked')) 
    10701069                    sim_page.model_list[i][0].SetValue(check) 
    1071                     continue 
     1070                    break 
    10721071            i += 1 
    10731072        sim_page.check_model_name(None) 
     
    10801079        for index, item in enumerate(self.constraints_list): 
    10811080            model_cbox = item.pop('model_cbox') 
    1082             constraint_value = item.pop('constraint') 
    1083             param = item.pop('param_cbox') 
    1084             equality = item.pop('egal_txt') 
    1085             for key, value in model_map.iteritems(): 
    1086                 model_cbox.replace(key, value) 
    1087                 constraint_value.replace(key, value) 
    1088  
    1089             sim_page.constraints_list[index][0].SetValue(model_cbox) 
    1090             sim_page._on_select_model(None) 
    1091             sim_page.constraints_list[index][1].SetValue(param) 
    1092             sim_page.constraints_list[index][2].SetLabel(equality) 
    1093             sim_page.constraints_list[index][3].SetValue(constraint_value) 
    1094             sim_page._on_add_constraint(None) 
     1081            if model_cbox != "": 
     1082                constraint_value = item.pop('constraint') 
     1083                param = item.pop('param_cbox') 
     1084                equality = item.pop('egal_txt') 
     1085                for key, value in model_map.iteritems(): 
     1086                    model_cbox.replace(key, value) 
     1087                    constraint_value.replace(key, value) 
     1088 
     1089                sim_page.constraints_list[index][0].SetValue(model_cbox) 
     1090                sim_page._on_select_model(None) 
     1091                sim_page.constraints_list[index][1].SetValue(param) 
     1092                sim_page.constraints_list[index][2].SetLabel(equality) 
     1093                sim_page.constraints_list[index][3].SetValue(constraint_value) 
     1094                sim_page._on_add_constraint(None) 
    10951095 
    10961096    def _format_id(self, original_id): 
Note: See TracChangeset for help on using the changeset viewer.