Ignore:
File:
1 edited

Legend:

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

    ra9f9ca4 rf73b47c  
    11""" 
    2     Simultaneous or Batch fit page 
     2    Simultaneous fit page 
    33""" 
    4 # Note that this is used for both Simultaneous/Constrained fit AND for  
    5 # combined batch fit.  This is done through setting of the batch_on parameter. 
    6 # There are the a half dozen or so places where an if statement is used as in  
    7 # if not batch_on: 
    8 #     xxxx 
    9 # else: 
    10 #     xxxx 
    11 # This is just wrong but dont have time to fix this go. Proper approach would be 
    12 # to strip all parts of the code that depend on batch_on and create the top 
    13 # level class from which a contrained/simultaneous fit page and a combined  
    14 # batch page inherit. 
    15 # 
    16 #            04/09/2017   --PDB 
    17  
    184import sys 
    195from collections import namedtuple 
     
    414400        # General Help button 
    415401        self.btHelp = wx.Button(self, wx.ID_HELP, 'HELP') 
    416         if self.batch_on: 
    417             self.btHelp.SetToolTipString("Combined Batch Fitting help.") 
    418         else: 
    419             self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
     402        self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
    420403        self.btHelp.Bind(wx.EVT_BUTTON, self._on_help) 
    421404 
     
    544527    """ 
    545528        _TreeLocation = "user/sasgui/perspectives/fitting/fitting_help.html" 
    546         if not self.batch_on: 
    547             _PageAnchor = "#simultaneous-fit-mode" 
    548             _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
     529        _PageAnchor = "#simultaneous-fit-mode" 
     530        _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
    549531                                          _PageAnchor, 
    550532                                          "Simultaneous/Constrained Fitting Help") 
    551         else: 
    552             _PageAnchor = "#combined-batch-fit-mode" 
    553             _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
    554                                           _PageAnchor, 
    555                                           "Combined Batch Fit Help") 
    556533 
    557534    def set_manager(self, manager): 
     
    10731050        """ 
    10741051 
    1075         model_map = {} 
     1052        init_map = {} 
     1053        final_map = {} 
    10761054        if fit.fit_panel.sim_page is None: 
    10771055            fit.fit_panel.add_sim_page() 
     
    10871065                save_id = self._format_id(save_id) 
    10881066                if save_id == model_id: 
    1089                     model_map[saved_model.pop('fit_page_source')] = \ 
    1090                         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 
    10911070                    check = bool(saved_model.pop('checked')) 
    10921071                    sim_page.model_list[i][0].SetValue(check) 
     
    11061085                param = item.pop('param_cbox') 
    11071086                equality = item.pop('egal_txt') 
    1108                 for key, value in model_map.iteritems(): 
    1109                     model_cbox.replace(key, value) 
    1110                     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) 
    11111093 
    11121094                sim_page.constraints_list[index][0].SetValue(model_cbox) 
Note: See TracChangeset for help on using the changeset viewer.