Ignore:
File:
1 edited

Legend:

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

    rf73b47c ra9f9ca4  
    11""" 
    2     Simultaneous fit page 
     2    Simultaneous or Batch 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 
    418import sys 
    519from collections import namedtuple 
     
    400414        # General Help button 
    401415        self.btHelp = wx.Button(self, wx.ID_HELP, 'HELP') 
    402         self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
     416        if self.batch_on: 
     417            self.btHelp.SetToolTipString("Combined Batch Fitting help.") 
     418        else: 
     419            self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.") 
    403420        self.btHelp.Bind(wx.EVT_BUTTON, self._on_help) 
    404421 
     
    527544    """ 
    528545        _TreeLocation = "user/sasgui/perspectives/fitting/fitting_help.html" 
    529         _PageAnchor = "#simultaneous-fit-mode" 
    530         _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
     546        if not self.batch_on: 
     547            _PageAnchor = "#simultaneous-fit-mode" 
     548            _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation, 
    531549                                          _PageAnchor, 
    532550                                          "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") 
    533556 
    534557    def set_manager(self, manager): 
     
    10501073        """ 
    10511074 
    1052         init_map = {} 
    1053         final_map = {} 
     1075        model_map = {} 
    10541076        if fit.fit_panel.sim_page is None: 
    10551077            fit.fit_panel.add_sim_page() 
     
    10651087                save_id = self._format_id(save_id) 
    10661088                if save_id == model_id: 
    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 
     1089                    model_map[saved_model.pop('fit_page_source')] = \ 
     1090                        model[3].name 
    10701091                    check = bool(saved_model.pop('checked')) 
    10711092                    sim_page.model_list[i][0].SetValue(check) 
     
    10851106                param = item.pop('param_cbox') 
    10861107                equality = item.pop('egal_txt') 
    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) 
     1108                for key, value in model_map.iteritems(): 
     1109                    model_cbox.replace(key, value) 
     1110                    constraint_value.replace(key, value) 
    10931111 
    10941112                sim_page.constraints_list[index][0].SetValue(model_cbox) 
Note: See TracChangeset for help on using the changeset viewer.