Changeset e1e3e09 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Apr 21, 2017 8:40:01 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:
- 98b13f72
- Parents:
- 9d266d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r9d266d2 re1e3e09 30 30 from sas.qtgui.Perspectives.Fitting.FittingLogic import FittingLogic 31 31 from sas.qtgui.Perspectives.Fitting import FittingUtilities 32 from SmearingWidget import SmearingWidget 32 33 33 34 TAB_MAGNETISM = 4 … … 91 92 self.communicate = self.parent.communicate 92 93 94 # Smearing widget 95 layout = QtGui.QGridLayout() 96 self.smearing_widget = SmearingWidget(self) 97 layout.addWidget(self.smearing_widget) 98 #self.tabFitting.removeTab(2) 99 self.tabFitting.insertTab(2, self.smearing_widget, "Resolution") 100 93 101 # Define bold font for use in various controls 94 102 self.boldFont=QtGui.QFont() … … 161 169 self.logic.data = GuiUtils.dataFromItem(value) 162 170 171 # Overwrite data type descriptor 172 self.is2D = True if isinstance(self.logic.data, Data2D) else False 173 163 174 self.data_is_loaded = True 175 176 # Enable/disable UI components 177 self.setEnablementOnDataLoad() 178 179 def setEnablementOnDataLoad(self): 180 """ 181 Enable/disable various UI elements based on data loaded 182 """ 164 183 # Tag along functionality 165 184 self.label.setText("Data loaded from: ") … … 173 192 self.txtNptsFit.setEnabled(False) 174 193 self.chkLogData.setEnabled(False) 194 # Switch off Data2D control 195 self.chk2DView.setEnabled(False) 196 self.chk2DView.setVisible(False) 197 self.chkMagnetism.setEnabled(True) 198 199 # Weighting and smearing controls 200 if self.is2D: 201 #self.slit_smearer.Disable() 202 #self.pinhole_smearer.Enable(True) 203 #self.default_mask = copy.deepcopy(self.data.mask) 204 if self.logic.data.err_data is None or\ 205 numpy.all(err == 1 for err in self.logic.data.err_data) or \ 206 not numpy.any(self.logic.data.err_data): 207 self.rbWeighting2.setEnabled(False) 208 self.rbWeighting1.setChecked(True) 209 else: 210 self.rbWeighting2.setEnabled(True) 211 self.rbWeighting2.setChecked(True) 212 else: 213 #self.slit_smearer.Enable(True) 214 #self.pinhole_smearer.Enable(True) 215 if self.logic.data.dy is None or\ 216 numpy.all(self.logic.data.dy == 1) or\ 217 not numpy.any(self.logic.data.dy): 218 self.rbWeighting2.setEnabled(False) 219 self.rbWeighting1.setChecked(True) 220 else: 221 self.rbWeighting2.setEnabled(True) 222 self.rbWeighting2.setChecked(True) 223 224 # Smearing tab 225 self.smearing_widget.updateSmearing(self.data) 175 226 176 227 def acceptsData(self): … … 211 262 self.is2D = isChecked 212 263 # Reload the current model 213 self.onSelectModel() 264 if self.kernel_module: 265 self.onSelectModel() 214 266 215 267 def toggleLogData(self, isChecked): … … 242 294 self.weightingGroup.addButton(self.rbWeighting3) 243 295 self.weightingGroup.addButton(self.rbWeighting4) 296 # Smearing tab 297 self.smearing_widget.updateSmearing(self.data) 244 298 245 299 def initializeSignals(self): … … 251 305 self.cbCategory.currentIndexChanged.connect(self.onSelectCategory) 252 306 self.cbModel.currentIndexChanged.connect(self.onSelectModel) 253 self.cbSmearing.currentIndexChanged.connect(self.onSelectSmearing)307 #self.cbSmearing.currentIndexChanged.connect(self.onSelectSmearing) 254 308 # Checkboxes 255 309 self.chk2DView.toggled.connect(self.toggle2D) … … 266 320 self.txtMinRange.editingFinished.connect(self.onMinRange) 267 321 self.txtMaxRange.editingFinished.connect(self.onMaxRange) 268 self.txtSmearUp.editingFinished.connect(self.onSmearUp)269 self.txtSmearDown.editingFinished.connect(self.onSmearDown)322 #self.txtSmearUp.editingFinished.connect(self.onSmearUp) 323 #self.txtSmearDown.editingFinished.connect(self.onSmearDown) 270 324 # Button groups 271 325 self.weightingGroup.buttonClicked.connect(self.onWeightingChoice) … … 717 771 # Check the state of the Weighting radio buttons 718 772 button_id = self.weightingGroup.checkedId() 773 # Cast the id to a valid index 719 774 button_id = abs(button_id + 2) 720 775 if button_id == 0: 776 # No weight added 721 777 return 722 778 # Send original data for weighting
Note: See TracChangeset
for help on using the changeset viewer.