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