Changeset 00b3b40 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- May 15, 2017 10:57:34 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 2a432e7
- Parents:
- 2241130
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r2241130 r00b3b40 370 370 371 371 # Update state stack 372 if self.undo_supported: 373 state = self.currentState() 374 self.pushFitPage(state) 372 self.updateUndo() 375 373 376 374 def onSelectStructureFactor(self): … … 429 427 name_index = self._poly_model.index(model_row, 0) 430 428 # Extract changed value. Assumes proper validation by QValidator/Delegate 431 # Checkbox in column 0429 # TODO: abstract away hardcoded column numbers 432 430 if model_column == 0: 431 # Is the parameter checked for fitting? 433 432 value = item.checkState() 433 # TODO: add the param to self.params_for_fitting 434 elif model_column == 6: 435 value = item.text() 436 # TODO: Modify Npts/Nsigs based on function choice 434 437 else: 435 438 try: … … 866 869 return 867 870 parameter_name = str(self._model_model.data(name_index).toPyObject()) # sld, background etc. 868 property_name = str(self._model_model.headerData(1, model_column).toPyObject()) # Value, min, max, etc. 869 871 property_index = self._model_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 872 873 # Update the parameter value - note: this supports +/-inf as well 870 874 self.kernel_module.params[parameter_name] = value 871 875 872 # TODO: update min/max based on property_name873 876 # min/max to be changed in self.kernel_module.details[parameter_name] = ['Ang', 0.0, inf] 874 # magnetic params in self.kernel_module.details['M0:parameter_name'] = value 875 # multishell params in self.kernel_module.details[??] = value 877 self.kernel_module.details[parameter_name][property_index] = value 878 879 # TODO: magnetic params in self.kernel_module.details['M0:parameter_name'] = value 880 # TODO: multishell params in self.kernel_module.details[??] = value 876 881 877 882 # Force the chart update when actual parameters changed … … 880 885 881 886 # Update state stack 882 if self.undo_supported: 883 state = self.currentState() 884 self.pushFitPage(state) 887 self.updateUndo() 885 888 886 889 def checkboxSelected(self, item): … … 943 946 Update a QStandardModelIndex containing model data 944 947 """ 945 if fitted_data.name is None: 946 name = self.nameForFittedData(self.logic.data.filename) 947 fitted_data.title = name 948 fitted_data.name = name 949 else: 950 name = fitted_data.name 948 name = self.nameFromData(fitted_data) 951 949 # Make this a line if no other defined 952 950 if hasattr(fitted_data, 'symbol') and fitted_data.symbol is None: … … 959 957 Create a QStandardModelIndex containing model data 960 958 """ 959 name = self.nameFromData(fitted_data) 960 # Notify the GUI manager so it can create the theory model in DataExplorer 961 new_item = GuiUtils.createModelItemWithPlot(QtCore.QVariant(fitted_data), name=name) 962 self.communicate.updateTheoryFromPerspectiveSignal.emit(new_item) 963 964 def nameFromData(self, fitted_data): 965 """ 966 Return name for the dataset. Terribly impure function. 967 """ 961 968 if fitted_data.name is None: 962 name = self.nameForFittedData(self. kernel_module.name)969 name = self.nameForFittedData(self.logic.data.filename) 963 970 fitted_data.title = name 964 971 fitted_data.name = name … … 966 973 else: 967 974 name = fitted_data.name 968 # Notify the GUI manager so it can create the theory model in DataExplorer 969 new_item = GuiUtils.createModelItemWithPlot(QtCore.QVariant(fitted_data), name=name) 970 self.communicate.updateTheoryFromPerspectiveSignal.emit(new_item) 975 return name 971 976 972 977 def methodCalculateForData(self): … … 1258 1263 # TODO: add polidyspersity and magnetism 1259 1264 1265 1266 def updateUndo(self): 1267 """ 1268 Create a new state page and add it to the stack 1269 """ 1270 if self.undo_supported: 1271 self.pushFitPage(self.currentState()) 1272 1260 1273 def currentState(self): 1261 1274 """
Note: See TracChangeset
for help on using the changeset viewer.