Changeset e4a3302 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Oct 24, 2017 11:49:38 AM (7 years ago)
- Children:
- 9634f86
- Parents:
- c1b3ffb
- Location:
- src/sas/qtgui/Perspectives/Corfunc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
rc1b3ffb re4a3302 90 90 #def __init__(self, manager=None, parent=None): 91 91 def __init__(self, parent=None): 92 #super(InvariantWindow, self).__init__(parent)93 92 super(CorfuncWindow, self).__init__() 94 93 self.setupUi(self) … … 102 101 self._canvas = MyMplCanvas(self) 103 102 self._realplot = MyMplCanvas(self) 104 self.verticalLayout_7.insertWidget(0, self._canvas)103 self.verticalLayout_7.insertWidget(0, self._canvas) 105 104 self.verticalLayout_7.insertWidget(1, self._realplot) 106 105 … … 137 136 self.model.setItem(W.W_TRANSFORM, 138 137 QtGui.QStandardItem("Fourier")) 138 self.model.setItem(W.W_GUINIERA, 139 QtGui.QStandardItem("0.0")) 140 self.model.setItem(W.W_GUINIERB, 141 QtGui.QStandardItem("0.0")) 142 self.model.setItem(W.W_PORODK, 143 QtGui.QStandardItem("0.0")) 144 self.model.setItem(W.W_PORODSIGMA, 145 QtGui.QStandardItem("0.0")) 139 146 140 147 def modelChanged(self, item): 141 148 if item.row() == W.W_QMIN: 142 149 value = float(self.model.item(W.W_QMIN).text()) 143 self.qMin.setValue(value)144 150 self._calculator.lowerq = value 145 151 self._canvas.qmin = value 146 152 elif item.row() == W.W_QMAX: 147 153 value = float(self.model.item(W.W_QMAX).text()) 148 self.qMax1.setValue(value)149 154 self._calculator.upperq = (value, self._calculator.upperq[1]) 150 155 self._canvas.qmax1 = value 151 156 elif item.row() == W.W_QCUTOFF: 152 157 value = float(self.model.item(W.W_QCUTOFF).text()) 153 self.qMax2.setValue(value)154 158 self._calculator.upperq = (self._calculator.upperq[0], value) 155 159 self._canvas.qmax2 = value 156 160 elif item.row() == W.W_BACKGROUND: 157 161 value = float(self.model.item(W.W_BACKGROUND).text()) 158 self.bg.setValue(value)159 162 self._calculator.background = value 160 163 else: 161 164 print("{} Changed".format(item)) 162 165 166 self.mapper.toFirst() 163 167 self._canvas.drawQSpace() 164 168 … … 166 170 def extrapolate(self): 167 171 params, extrapolation = self._calculator.compute_extrapolation() 168 self.guinierA.setValue(params['A']) 169 self.guinierB.setValue(params['B']) 170 self.porodK.setValue(params['K']) 171 self.porodSigma.setValue(params['sigma']) 172 173 self.model.setItem(W.W_GUINIERA, QtGui.QStandardItem(str(params['A']))) 174 self.model.setItem(W.W_GUINIERB, QtGui.QStandardItem(str(params['B']))) 175 self.model.setItem(W.W_PORODK, QtGui.QStandardItem(str(params['K']))) 176 self.model.setItem(W.W_PORODSIGMA, QtGui.QStandardItem(str(params['sigma']))) 177 172 178 self._canvas.extrap = extrapolation 173 179 self._canvas.drawQSpace() … … 209 215 self.mapper.addMapping(self.bg, W.W_BACKGROUND) 210 216 217 self.mapper.addMapping(self.guinierA, W.W_GUINIERA) 218 self.mapper.addMapping(self.guinierB, W.W_GUINIERB) 219 self.mapper.addMapping(self.porodK, W.W_PORODK) 220 self.mapper.addMapping(self.porodSigma, W.W_PORODSIGMA) 221 211 222 self.mapper.toFirst() 212 223 213 224 def calculateBackground(self): 214 225 bg = self._calculator.compute_background() 215 print(bg)216 self.model.setItem(W.W_BACKGROUND, QtGui.QStandardItem(str(bg)))226 temp = QtGui.QStandardItem(str(bg)) 227 self.model.setItem(W.W_BACKGROUND, temp) 217 228 218 229 def action(self): -
src/sas/qtgui/Perspectives/Corfunc/CorfuncUtils.py
rf7b73d5 re4a3302 8 8 'W_BACKGROUND', 9 9 'W_TRANSFORM', 10 'W_GUINIERA', 11 'W_GUINIERB', 12 'W_PORODK', 13 'W_PORODSIGMA', 10 14 )
Note: See TracChangeset
for help on using the changeset viewer.