Changes in src/sas/qtgui/Perspectives/Fitting/FittingWidget.py [f3cc979:bb477f5] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rf3cc979 rbb477f5 1219 1219 if model_column in [delegate.poly_pd, delegate.poly_error, delegate.poly_min, delegate.poly_max]: 1220 1220 row = self.getRowFromName(parameter_name) 1221 param_item = self._model_model.item(row).child(0).child(0, model_column) 1222 if param_item is None: 1223 return 1221 param_item = self._model_model.item(row) 1224 1222 self._model_model.blockSignals(True) 1225 param_item. setText(item.text())1223 param_item.child(0).child(0, model_column).setText(item.text()) 1226 1224 self._model_model.blockSignals(False) 1227 1225 … … 2798 2796 2799 2797 func = QtWidgets.QComboBox() 2798 # Available range of shells displayed in the combobox 2799 func.addItems([str(i) for i in range(param_length+1)]) 2800 2801 # Respond to index change 2802 func.currentIndexChanged.connect(self.modifyShellsInList) 2800 2803 2801 2804 # cell 2: combobox 2802 2805 item2 = QtGui.QStandardItem() 2803 2804 # cell 3: min value 2805 item3 = QtGui.QStandardItem() 2806 2807 # cell 4: max value 2808 item4 = QtGui.QStandardItem() 2809 2810 self._model_model.appendRow([item1, item2, item3, item4]) 2806 self._model_model.appendRow([item1, item2]) 2811 2807 2812 2808 # Beautify the row: span columns 2-4 … … 2827 2823 logger.error("Could not find %s in kernel parameters.", param_name) 2828 2824 default_shell_count = shell_par.default 2829 shell_min = 02830 shell_max = 02831 try:2832 shell_min = int(shell_par.limits[0])2833 shell_max = int(shell_par.limits[1])2834 except IndexError as ex:2835 # no info about limits2836 pass2837 item3.setText(str(shell_min))2838 item4.setText(str(shell_max))2839 2840 # Respond to index change2841 func.currentTextChanged.connect(self.modifyShellsInList)2842 2843 # Available range of shells displayed in the combobox2844 func.addItems([str(i) for i in range(shell_min, shell_max+1)])2845 2825 2846 2826 # Add default number of shells to the model 2847 func.setCurrent Text(str(default_shell_count))2848 2849 def modifyShellsInList(self, text):2827 func.setCurrentIndex(default_shell_count) 2828 2829 def modifyShellsInList(self, index): 2850 2830 """ 2851 2831 Add/remove additional multishell parameters … … 2854 2834 first_row = self._n_shells_row + 1 2855 2835 remove_rows = self._num_shell_params 2856 try:2857 index = int(text)2858 except ValueError:2859 # bad text on the control!2860 index = 02861 logger.error("Multiplicity incorrect! Setting to 0")2862 2836 2863 2837 if remove_rows > 1: … … 2874 2848 self.current_shell_displayed = index 2875 2849 2876 # Param values for existing shells were reset to default; force all changes into kernel module 2877 for row in new_rows: 2878 par = row[0].text() 2879 val = GuiUtils.toDouble(row[1].text()) 2880 self.kernel_module.setParam(par, val) 2881 2882 # Change 'n' in the parameter model; also causes recalculation 2850 # Change 'n' in the parameter model, thereby updating the underlying model 2883 2851 self._model_model.item(self._n_shells_row, 1).setText(str(index)) 2884 2852
Note: See TracChangeset
for help on using the changeset viewer.