Changes in src/sas/sasgui/perspectives/fitting/simfitpage.py [f73b47c:a9f9ca4] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/simfitpage.py
rf73b47c ra9f9ca4 1 1 """ 2 Simultaneous fit page2 Simultaneous or Batch fit page 3 3 """ 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 4 18 import sys 5 19 from collections import namedtuple … … 400 414 # General Help button 401 415 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.") 403 420 self.btHelp.Bind(wx.EVT_BUTTON, self._on_help) 404 421 … … 527 544 """ 528 545 _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, 531 549 _PageAnchor, 532 550 "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") 533 556 534 557 def set_manager(self, manager): … … 1050 1073 """ 1051 1074 1052 init_map = {} 1053 final_map = {} 1075 model_map = {} 1054 1076 if fit.fit_panel.sim_page is None: 1055 1077 fit.fit_panel.add_sim_page() … … 1065 1087 save_id = self._format_id(save_id) 1066 1088 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 1070 1091 check = bool(saved_model.pop('checked')) 1071 1092 sim_page.model_list[i][0].SetValue(check) … … 1085 1106 param = item.pop('param_cbox') 1086 1107 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) 1093 1111 1094 1112 sim_page.constraints_list[index][0].SetValue(model_cbox)
Note: See TracChangeset
for help on using the changeset viewer.