Changes in src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py [a5f7bf4:73fb503] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
ra5f7bf4 r73fb503 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()) … … 109 115 Update control elements based on data and model passed 110 116 """ 117 # retain the index 118 cur_index = self.cbSmearing.currentIndex() 111 119 self.cbSmearing.clear() 112 120 self.cbSmearing.addItem("None") … … 117 125 model = self.kernel_model 118 126 self.updateKernelModel(model) 127 # already has the required setup so modify the index 128 self.cbSmearing.setCurrentIndex(cur_index) 119 129 120 130 def updateKernelModel(self, kernel_model=None): … … 184 194 # Recalculate the smearing 185 195 index = self.cbSmearing.currentIndex() 196 ## update the backup values based on model choice 197 smearing, accuracy, d_down, d_up = self.state() 198 # don't save the state if dQ Data 199 if smearing == "Custom Pinhole Smear": 200 self.pinhole = d_down 201 self.accuracy = accuracy 202 elif smearing == 'Custom Slit Smear': 203 self.slit_height = d_up 204 self.slit_width = d_down 205 186 206 self.onIndexChange(index) 187 207 … … 221 241 self.lblSmearUp.setText('<html><head/><body><p>dQ/Q</p></body></html>') 222 242 self.lblUnitUp.setText('%') 243 self.txtSmearUp.setText(str(self.pinhole)) 244 223 245 self.txtSmearDown.setEnabled(True) 224 246 self.txtSmearUp.setEnabled(True) … … 234 256 self.lblUnitDown.setText('<html><head/><body><p>Ã 235 257 <span style=" vertical-align:super;">-1</span></p></body></html>') 258 self.txtSmearDown.setText(str(self.slit_height)) 259 self.txtSmearUp.setText(str(self.slit_width)) 236 260 self.txtSmearDown.setEnabled(True) 237 261 self.txtSmearUp.setEnabled(True) … … 277 301 accuracy = str(self.model.item(MODEL.index('ACCURACY')).text()) 278 302 try: 279 d_down = float(self. model.item(MODEL.index('PINHOLE_MIN')).text())303 d_down = float(self.txtSmearUp.text()) 280 304 except ValueError: 281 305 d_down = None 282 306 try: 283 d_up = float(self. model.item(MODEL.index('PINHOLE_MAX')).text())307 d_up = float(self.txtSmearDown.text()) 284 308 except ValueError: 285 309 d_up = None … … 292 316 """ 293 317 # Update the model -> controls update automatically 294 #if smearing is not None:295 #self.model.item(MODEL.index('SMEARING')).setText(smearing)296 318 if accuracy is not None: 297 319 self.model.item(MODEL.index('ACCURACY')).setText(accuracy) … … 347 369 if d_height is None: 348 370 d_height = 0.0 371 372 self.slit_width = d_width 373 self.slit_height = d_height 349 374 350 375 if isinstance(self.data, Data2D):
Note: See TracChangeset
for help on using the changeset viewer.