Changeset e900a47 in sasview for src/sas/qtgui
- Timestamp:
- Mar 28, 2019 8:22:55 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_opencl
- Children:
- b8bdbcc, aa47ea5
- Parents:
- 770c42c
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rc149fba re900a47 2870 2870 self.createNewIndex(weighted_data) 2871 2871 2872 # Plot residuals if actual data2873 if not self.data_is_loaded:2874 return2875 2876 2872 # Calculate difference between return_data and logic.data 2877 2873 self.chi2 = FittingUtilities.calculateChi2(weighted_data, self.data) … … 2879 2875 chi2_repr = "---" if self.chi2 is None else GuiUtils.formatNumber(self.chi2, high=True) 2880 2876 self.lblChi2Value.setText(chi2_repr) 2877 2878 # Plot residuals if actual data 2879 if not self.data_is_loaded: 2880 return 2881 2881 2882 2882 residuals_plot = FittingUtilities.plotResiduals(self.data, weighted_data) -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
ra5f7bf4 re900a47 64 64 self.kernel_model = None 65 65 # dQ data variables 66 smear_type = None 67 dq_l = None 68 dq_r = None 66 self.smear_type = None 67 self.dq_l = None 68 self.dq_r = None 69 70 # current pinhole/slot values 71 self.pinhole = 0.0 72 self.slit_height = 0.0 73 self.slit_width = 0.0 74 69 75 # Let only floats in the line edits 70 76 self.txtSmearDown.setValidator(GuiUtils.DoubleValidator()) … … 184 190 # Recalculate the smearing 185 191 index = self.cbSmearing.currentIndex() 192 ## update the backup values based on model choice 193 smearing, accuracy, d_down, d_up = self.state() 194 # don't save the state if dQ Data 195 if smearing == "Custom Pinhole Smear": 196 self.pinhole = d_down 197 self.accuracy = accuracy 198 elif smearing == 'Custom Slit Smear': 199 self.slit_height = d_up 200 self.slit_width = d_down 201 186 202 self.onIndexChange(index) 187 203 … … 221 237 self.lblSmearUp.setText('<html><head/><body><p>dQ/Q</p></body></html>') 222 238 self.lblUnitUp.setText('%') 239 self.txtSmearUp.setText(str(self.pinhole)) 240 223 241 self.txtSmearDown.setEnabled(True) 224 242 self.txtSmearUp.setEnabled(True) … … 234 252 self.lblUnitDown.setText('<html><head/><body><p>Ã 235 253 <span style=" vertical-align:super;">-1</span></p></body></html>') 254 self.txtSmearDown.setText(str(self.slit_height)) 255 self.txtSmearUp.setText(str(self.slit_width)) 236 256 self.txtSmearDown.setEnabled(True) 237 257 self.txtSmearUp.setEnabled(True) … … 277 297 accuracy = str(self.model.item(MODEL.index('ACCURACY')).text()) 278 298 try: 279 d_down = float(self. model.item(MODEL.index('PINHOLE_MIN')).text())299 d_down = float(self.txtSmearUp.text()) 280 300 except ValueError: 281 301 d_down = None 282 302 try: 283 d_up = float(self. model.item(MODEL.index('PINHOLE_MAX')).text())303 d_up = float(self.txtSmearDown.text()) 284 304 except ValueError: 285 305 d_up = None … … 292 312 """ 293 313 # Update the model -> controls update automatically 294 #if smearing is not None:295 #self.model.item(MODEL.index('SMEARING')).setText(smearing)296 314 if accuracy is not None: 297 315 self.model.item(MODEL.index('ACCURACY')).setText(accuracy) … … 347 365 if d_height is None: 348 366 d_height = 0.0 367 368 self.slit_width = d_width 369 self.slit_height = d_height 349 370 350 371 if isinstance(self.data, Data2D):
Note: See TracChangeset
for help on using the changeset viewer.