- Timestamp:
- Oct 29, 2018 9:54:42 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 6216eb75
- Parents:
- ec4a143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rec4a143 r7fb68060 293 293 self.has_magnet_error_column = False 294 294 295 # Enablement of comboboxes 296 self.enabled_cbmodel = False 297 self.enabled_sfmodel = False 298 295 299 # If the widget generated theory item, save it 296 300 self.theory_item = None … … 459 463 self.cbModel.setEnabled(False) 460 464 self.lblModel.setEnabled(False) 465 self.enabled_cbmodel = False 461 466 462 467 def enableModelCombo(self): … … 464 469 self.cbModel.setEnabled(True) 465 470 self.lblModel.setEnabled(True) 471 self.enabled_cbmodel = True 466 472 467 473 def disableStructureCombo(self): … … 469 475 self.cbStructureFactor.setEnabled(False) 470 476 self.lblStructure.setEnabled(False) 477 self.enabled_sfmodel = False 471 478 472 479 def enableStructureCombo(self): … … 474 481 self.cbStructureFactor.setEnabled(True) 475 482 self.lblStructure.setEnabled(True) 483 self.enabled_sfmodel = True 476 484 477 485 def togglePoly(self, isChecked): … … 3100 3108 shell_par = None 3101 3109 for par in kernel_pars: 3102 if par.name == param_name: 3110 parname = par.name 3111 if '[' in parname: 3112 parname = parname[:parname.index('[')] 3113 if parname == param_name: 3103 3114 shell_par = par 3104 3115 break 3105 if not shell_par:3116 if shell_par is None: 3106 3117 logger.error("Could not find %s in kernel parameters.", param_name) 3118 return 3107 3119 default_shell_count = shell_par.default 3108 3120 shell_min = 0 … … 3114 3126 # no info about limits 3115 3127 pass 3128 except Exception as ex: 3129 logging.error("Badly defined multiplicity: "+ str(ex)) 3130 return 3116 3131 # don't update the kernel here - this data is display only 3117 3132 self._model_model.blockSignals(True) … … 3120 3135 self._model_model.blockSignals(False) 3121 3136 3137 ## Respond to index change 3138 #func.currentTextChanged.connect(self.modifyShellsInList) 3139 3140 # Respond to button press 3141 button.clicked.connect(self.onShowSLDProfile) 3142 3143 # Available range of shells displayed in the combobox 3144 func.addItems([str(i) for i in range(shell_min, shell_max+1)]) 3145 3122 3146 # Respond to index change 3123 3147 func.currentTextChanged.connect(self.modifyShellsInList) 3124 3148 3125 # Respond to button press3126 button.clicked.connect(self.onShowSLDProfile)3127 3128 # Available range of shells displayed in the combobox3129 func.addItems([str(i) for i in range(shell_min, shell_max+1)])3130 3131 3149 # Add default number of shells to the model 3132 3150 func.setCurrentText(str(default_shell_count)) 3151 self.modifyShellsInList(str(default_shell_count)) 3133 3152 3134 3153 def modifyShellsInList(self, text): … … 3178 3197 """ 3179 3198 # get profile data 3180 x, y = self.kernel_module.getProfile() 3199 try: 3200 x, y = self.kernel_module.getProfile() 3201 except TypeError: 3202 msg = "SLD profile calculation failed." 3203 logging.error(msg) 3204 return 3205 3181 3206 y *= 1.0e6 3182 3207 profile_data = Data1D(x=x, y=y) … … 3211 3236 3212 3237 self.cbCategory.setEnabled(enabled) 3213 self.cbModel.setEnabled(enabled) 3238 3239 if enabled: 3240 # worry about original enablement of model and SF 3241 self.cbModel.setEnabled(self.enabled_cbmodel) 3242 self.cbStructureFactor.setEnabled(self.enabled_sfmodel) 3243 else: 3244 self.cbModel.setEnabled(enabled) 3245 self.cbStructureFactor.setEnabled(enabled) 3246 3214 3247 self.cmdPlot.setEnabled(enabled) 3215 3248
Note: See TracChangeset
for help on using the changeset viewer.