- Timestamp:
- Apr 21, 2017 9:38:11 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:
- 180bd54
- Parents:
- e1e3e09
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
re1e3e09 r98b13f72 197 197 self.chkMagnetism.setEnabled(True) 198 198 199 # Weighting and smearingcontrols199 # Weighting controls 200 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 201 if self.logic.data.err_data is None or\ 205 202 numpy.all(err == 1 for err in self.logic.data.err_data) or \ … … 211 208 self.rbWeighting2.setChecked(True) 212 209 else: 213 #self.slit_smearer.Enable(True)214 #self.pinhole_smearer.Enable(True)215 210 if self.logic.data.dy is None or\ 216 211 numpy.all(self.logic.data.dy == 1) or\ … … 305 300 self.cbCategory.currentIndexChanged.connect(self.onSelectCategory) 306 301 self.cbModel.currentIndexChanged.connect(self.onSelectModel) 307 #self.cbSmearing.currentIndexChanged.connect(self.onSelectSmearing)308 302 # Checkboxes 309 303 self.chk2DView.toggled.connect(self.toggle2D) … … 320 314 self.txtMinRange.editingFinished.connect(self.onMinRange) 321 315 self.txtMaxRange.editingFinished.connect(self.onMaxRange) 322 #self.txtSmearUp.editingFinished.connect(self.onSmearUp)323 #self.txtSmearDown.editingFinished.connect(self.onSmearDown)324 316 # Button groups 325 317 self.weightingGroup.buttonClicked.connect(self.onWeightingChoice) … … 399 391 # Populate the models combobox 400 392 self.cbModel.addItems(sorted([model for (model, _) in model_list])) 401 402 def onSelectSmearing(self):403 """404 Select Smearing type from list405 """406 pass407 408 def onSmearUp(self):409 """410 Update state based on entered smear value411 """412 pass413 414 def onSmearDown(self):415 """416 Update state based on entered smear value417 """418 pass419 393 420 394 def onWeightingChoice(self, button): … … 476 450 # Potential weights added 477 451 self.addWeightingToData(data) 452 453 # Potential smearing added 454 smearing, accuracy, smearing_min, smearing_max = self.smearing_widget.state() 478 455 479 456 # These should be updating somehow? -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
re1e3e09 r98b13f72 12 12 13 13 class DataWidgetMapper(QtGui.QDataWidgetMapper): 14 """ 15 Custom version of the standard QDataWidgetMapper allowing for proper 16 response to index change in comboboxes 17 """ 14 18 def addMapping(self, widget, section, propertyName=None): 15 19 if propertyName is None: … … 36 40 37 41 self.setupUi(self) 42 43 # Have we loaded data yet? If so, what kind 44 self.is_data = None 45 # Local model for holding data 46 self.model = None 47 # Mapper for model update 48 self.mapper = None 49 50 # Let only floats in the line edits 51 self.txtSmearDown.setValidator(QtGui.QDoubleValidator()) 52 self.txtSmearUp.setValidator(QtGui.QDoubleValidator()) 53 54 # Attach slots 38 55 self.cbSmearing.currentIndexChanged.connect(self.onIndexChange) 39 56 self.cbSmearing.setCurrentIndex(0) 40 self.is_data = None41 self.model = None42 self.mapper = None43 57 44 58 self.initModel() … … 52 66 for model_item in xrange(len(MODEL)): 53 67 self.model.setItem(model_item, QtGui.QStandardItem()) 54 68 # Attach slot 55 69 self.model.dataChanged.connect(self.onModelChange) 56 57 ##self.modelReset()58 70 59 71 def initMapper(self): … … 61 73 Initialize model item <-> UI element mapping 62 74 """ 63 #self.mapper = QtGui.QDataWidgetMapper(self)64 75 self.mapper = DataWidgetMapper(self) 65 76 … … 107 118 def onModelChange(self, top, bottom): 108 119 """ 120 Respond to model change by updating 109 121 """ 110 print "MODEL CHANGED: ", top, bottom 122 print "MODEL CHANGED for property: %s. The value is now: %s" % \ 123 (MODEL[top.row()], str(self.model.item(top.row()).text())) 111 124 pass 112 125 … … 150 163 Returns current state of controls 151 164 """ 152 165 # or model-held values 166 smearing = str(self.model.item(MODEL.index('SMEARING')).text()) 167 accuracy = str(self.model.item(MODEL.index('ACCURACY')).text()) 168 d_down = float(self.model.item(MODEL.index('PINHOLE_MIN')).text()) 169 d_up = float(self.model.item(MODEL.index('PINHOLE_MAX')).text()) 170 171 return (smearing, accuracy, d_down, d_up)
Note: See TracChangeset
for help on using the changeset viewer.