Changeset f73b47c in sasview


Ignore:
Timestamp:
Jun 12, 2017 12:47:50 PM (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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9804394
Parents:
8cec26b
Message:

Properly restore constraint mappings when loading constrained fit projects.

File:
1 edited

Legend:

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

    r959eb01 rf73b47c  
    10501050        """ 
    10511051 
    1052         model_map = {} 
     1052        init_map = {} 
     1053        final_map = {} 
    10531054        if fit.fit_panel.sim_page is None: 
    10541055            fit.fit_panel.add_sim_page() 
     
    10641065                save_id = self._format_id(save_id) 
    10651066                if save_id == model_id: 
    1066                     model_map[saved_model.pop('fit_page_source')] = \ 
    1067                         model[3].name 
     1067                    inter_id = str(i) + str(i) + str(i) + str(i) + str(i) 
     1068                    init_map[saved_model.pop('fit_page_source')] = inter_id 
     1069                    final_map[inter_id] = model[3].name 
    10681070                    check = bool(saved_model.pop('checked')) 
    10691071                    sim_page.model_list[i][0].SetValue(check) 
     
    10831085                param = item.pop('param_cbox') 
    10841086                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) 
     1087                for key, value in init_map.items(): 
     1088                    model_cbox = model_cbox.replace(key, value) 
     1089                    constraint_value = constraint_value.replace(key, value) 
     1090                for key, value in final_map.items(): 
     1091                    model_cbox = model_cbox.replace(key, value) 
     1092                    constraint_value = constraint_value.replace(key, value) 
    10881093 
    10891094                sim_page.constraints_list[index][0].SetValue(model_cbox) 
Note: See TracChangeset for help on using the changeset viewer.