Ignore:
File:
1 edited

Legend:

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

    r24d9e84 r00f7ff1  
    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 
     
    163149        :return: None 
    164150        """ 
    165         init_map = {} 
    166         final_map = {} 
     151        model_map = {} 
    167152        # Process each model and associate old M# with new M# 
    168153        i = 0 
     
    178163                    check = bool(saved_model.pop('checked')) 
    179164                    self.model_list[i][0].SetValue(check) 
    180                     inter_id = str(i)*5 
    181                     init_map[saved_model.pop('fit_page_source')] = inter_id 
    182                     final_map[inter_id] = model[3].name 
    183                     check = bool(saved_model.pop('checked')) 
    184                     self.model_list[i][0].SetValue(check) 
    185165                    break 
    186166            i += 1 
     
    199179                param = item.pop('param_cbox') 
    200180                equality = item.pop('egal_txt') 
    201                 for key, value in init_map.items(): 
    202                     model_cbox = model_cbox.replace(key, value) 
    203                     constraint_value = constraint_value.replace(key, value) 
    204                 for key, value in final_map.items(): 
    205                     model_cbox = model_cbox.replace(key, value) 
    206                     constraint_value = constraint_value.replace(key, value) 
     181                for key, value in model_map.iteritems(): 
     182                    model_cbox.replace(key, value) 
     183                    constraint_value.replace(key, value) 
    207184 
    208185                self.constraints_list[index][0].SetValue(model_cbox) 
     
    479456        # General Help button 
    480457        self.btHelp = wx.Button(self, wx.ID_HELP, 'HELP') 
    481         if self.batch_on: 
    482             self.btHelp.SetToolTipString("Combined Batch Fitting help.") 
    483         else: 
    484             self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
     458        self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
    485459        self.btHelp.Bind(wx.EVT_BUTTON, self._on_help) 
    486460 
     
    609583    """ 
    610584        _TreeLocation = "user/sasgui/perspectives/fitting/fitting_help.html" 
    611         if not self.batch_on: 
    612             _PageAnchor = "#simultaneous-fit-mode" 
    613             _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
     585        _PageAnchor = "#simultaneous-fit-mode" 
     586        _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
    614587                                          _PageAnchor, 
    615588                                          "Simultaneous/Constrained Fitting Help") 
    616         else: 
    617             _PageAnchor = "#combined-batch-fit-mode" 
    618             _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
    619                                           _PageAnchor, 
    620                                           "Combined Batch Fit Help") 
    621589 
    622590    def set_manager(self, manager): 
Note: See TracChangeset for help on using the changeset viewer.