Changes in src/sas/sasgui/perspectives/fitting/simfitpage.py [24d9e84:00f7ff1] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/simfitpage.py
r24d9e84 r00f7ff1 1 1 """ 2 Simultaneous or Batchfit page2 Simultaneous fit page 3 3 """ 4 # Note that this is used for both Simultaneous/Constrained fit AND for5 # 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 in7 # if not batch_on:8 # xxxx9 # else:10 # xxxx11 # This is just wrong but dont have time to fix this go. Proper approach would be12 # to strip all parts of the code that depend on batch_on and create the top13 # level class from which a contrained/simultaneous fit page and a combined14 # batch page inherit.15 #16 # 04/09/2017 --PDB17 18 4 import sys 19 5 from collections import namedtuple … … 163 149 :return: None 164 150 """ 165 init_map = {} 166 final_map = {} 151 model_map = {} 167 152 # Process each model and associate old M# with new M# 168 153 i = 0 … … 178 163 check = bool(saved_model.pop('checked')) 179 164 self.model_list[i][0].SetValue(check) 180 inter_id = str(i)*5181 init_map[saved_model.pop('fit_page_source')] = inter_id182 final_map[inter_id] = model[3].name183 check = bool(saved_model.pop('checked'))184 self.model_list[i][0].SetValue(check)185 165 break 186 166 i += 1 … … 199 179 param = item.pop('param_cbox') 200 180 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) 207 184 208 185 self.constraints_list[index][0].SetValue(model_cbox) … … 479 456 # General Help button 480 457 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.") 485 459 self.btHelp.Bind(wx.EVT_BUTTON, self._on_help) 486 460 … … 609 583 """ 610 584 _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, 614 587 _PageAnchor, 615 588 "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")621 589 622 590 def set_manager(self, manager):
Note: See TracChangeset
for help on using the changeset viewer.