Changeset 70f4458 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Sep 7, 2018 5:57:38 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 3fbd77b
- Parents:
- f3a19ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rf3a19ad r70f4458 221 221 # Utility variable to enable unselectable option in category combobox 222 222 self._previous_category_index = 0 223 # Utility variable for multishell display 224 self._last_model_row = 0 223 # Utility variables for multishell display 224 self._n_shells_row = 0 225 self._num_shell_params = 0 225 226 # Dictionary of {model name: model class} for the current category 226 227 self.models = {} … … 1968 1969 else: 1969 1970 self.fromModelToQModel(model_name) 1971 self.addExtraShells() 1972 1970 1973 if structure_factor not in (None, "None"): 1971 1974 # add S(Q) … … 1974 1977 # enable selection of S(Q) 1975 1978 self.enableStructureFactorControl(structure_factor) 1979 1976 1980 # Add polydispersity to the model 1977 1981 self.setPolyModel() 1978 1982 # Add magnetic parameters to the model 1979 1983 self.setMagneticModel() 1980 1981 # Then, add multishells1982 if model_name is not None:1983 # Multishell models need additional treatment1984 self.addExtraShells()1985 1984 1986 1985 # Adjust the table cells width … … 2056 2055 for row in new_rows: 2057 2056 self._model_model.appendRow(row) 2058 # Update the counter used for multishell display2059 self._last_model_row = self._model_model.rowCount()2060 2057 2061 2058 def fromStructureFactorToQModel(self, structure_factor): … … 2124 2121 # row_num = self._model_model.rowCount() - 1 2125 2122 # FittingUtilities.markParameterDisabled(self._model_model, row_num) 2126 2127 # Update the counter used for multishell display2128 self._last_model_row = self._model_model.rowCount()2129 2123 2130 2124 def haveParamsToFit(self): … … 2744 2738 2745 2739 self.lstParams.setIndexWidget(shell_index, func) 2746 self._ last_model_row = self._model_model.rowCount()2740 self._n_shells_row = shell_row - 1 2747 2741 2748 2742 # Set the index to the state-kept value … … 2755 2749 """ 2756 2750 # Find row location of the combobox 2757 last_row = self._last_model_row2758 remove_rows = self._ model_model.rowCount() - last_row2751 first_row = self._n_shells_row + 1 2752 remove_rows = self._num_shell_params 2759 2753 2760 2754 if remove_rows > 1: 2761 self._model_model.removeRows(last_row, remove_rows) 2762 2763 FittingUtilities.addShellsToModel(self.model_parameters, self._model_model, index) 2755 self._model_model.removeRows(first_row, remove_rows) 2756 2757 new_rows = FittingUtilities.addShellsToModel(self.model_parameters, self._model_model, index, first_row) 2758 self._num_shell_params = len(new_rows) 2759 2764 2760 self.current_shell_displayed = index 2765 2761
Note: See TracChangeset
for help on using the changeset viewer.