Changeset b2c8aef in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Oct 24, 2017 5:54:06 AM (7 years ago)
- Children:
- 7b536da
- Parents:
- 59183b7
- git-author:
- Adam Washington <adam.washington@…> (10/24/17 05:48:52)
- git-committer:
- Adam Washington <adam.washington@…> (10/24/17 05:54:06)
- Location:
- src/sas/qtgui/Perspectives/Corfunc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
r59183b7 rb2c8aef 11 11 from sas.qtgui.Plotting.PlotterData import Data1D 12 12 import sas.qtgui.Utilities.GuiUtils as GuiUtils 13 from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator 13 14 14 15 # local … … 32 33 self.model = QtGui.QStandardItemModel(self) 33 34 self.communicate = GuiUtils.Communicate() 35 self._calculator = CorfuncCalculator() 34 36 35 37 # Connect buttons to slots. … … 48 50 self.transformBtn.clicked.connect(self.action) 49 51 52 self.calculateBgBtn.clicked.connect(self.calculateBackground) 53 50 54 self.hilbertBtn.clicked.connect(self.action) 51 55 self.fourierBtn.clicked.connect(self.action) 56 57 self.model.itemChanged.connect(self.modelChanged) 52 58 53 59 def setupModel(self): … … 63 69 QtGui.QStandardItem("Fourier")) 64 70 71 def modelChanged(self, item): 72 if item.row() == W.W_QMIN: 73 value = float(self.model.item(W.W_QMIN).text()) 74 self.qMin.setValue(value) 75 self._calculator.lowerq = value 76 elif item.row() == W.W_QMAX: 77 value = float(self.model.item(W.W_QMAX).text()) 78 self.qMax1.setValue(value) 79 self._calculator.upperq = (value, self._calculator.upperq[1]) 80 elif item.row() == W.W_QCUTOFF: 81 value = float(self.model.item(W.W_QCUTOFF).text()) 82 self.qMax2.setValue(value) 83 self._calculator.upperq = (self._calculator.upperq[0], value) 84 elif item.row() == W.W_BACKGROUND: 85 value = float(self.model.item(W.W_BACKGROUND).text()) 86 self.bg.setValue(float(value)) 87 else: 88 print("{} Changed".format(item)) 89 90 65 91 def setupMapper(self): 66 92 self.mapper = QtGui.QDataWidgetMapper(self) … … 75 101 self.mapper.toFirst() 76 102 103 def calculateBackground(self): 104 bg = self._calculator.compute_background() 105 print(bg) 106 self.model.setItem(W.W_BACKGROUND, QtGui.QStandardItem(str(bg))) 77 107 78 108 def action(self): … … 102 132 self._model_item = data_item[0] 103 133 data = GuiUtils.dataFromItem(self._model_item) 134 self._calculator.lowerq = 1e-3 135 self._calculator.upperq = (2e-1, 3e-1) 136 self._calculator.set_data(data) 104 137 105 138 # self.model.item(WIDGETS.W_FILENAME).setData(QtCoreQVariant(self._model_item.text())) -
src/sas/qtgui/Perspectives/Corfunc/UI/CorfuncPanel.ui
r6d96bf9 rb2c8aef 38 38 <string>Values with q < qmin will be used for Guinier back extrapolation</string> 39 39 </property> 40 <property name="decimals"> 41 <number>4</number> 42 </property> 43 <property name="singleStep"> 44 <double>0.001000000000000</double> 45 </property> 40 46 </widget> 41 47 </item> … … 52 58 <string>Values with Uppder < q < Cutoff will be used for Porod forward extrapolation</string> 53 59 </property> 60 <property name="decimals"> 61 <number>4</number> 62 </property> 63 <property name="singleStep"> 64 <double>0.001000000000000</double> 65 </property> 54 66 </widget> 55 67 </item> … … 65 77 <property name="toolTip"> 66 78 <string>Values with Uppder < q < Cutoff will be used for Porod forward extrapolation</string> 79 </property> 80 <property name="decimals"> 81 <number>4</number> 82 </property> 83 <property name="singleStep"> 84 <double>0.001000000000000</double> 67 85 </property> 68 86 </widget> … … 82 100 <property name="geometry"> 83 101 <rect> 84 <x> 410</x>85 <y> 220</y>102 <x>120</x> 103 <y>130</y> 86 104 <width>160</width> 87 105 <height>80</height> … … 222 240 <bool>true</bool> 223 241 </property> 224 </widget> 225 </item> 226 <item> 227 <widget class="QPushButton" name="calculateBackground"> 242 <property name="decimals"> 243 <number>4</number> 244 </property> 245 </widget> 246 </item> 247 <item> 248 <widget class="QPushButton" name="calculateBgBtn"> 228 249 <property name="text"> 229 250 <string>Calculate Background</string> … … 255 276 <layout class="QHBoxLayout" name="horizontalLayout"> 256 277 <item> 278 <widget class="QPushButton" name="extrapolateBtn"> 279 <property name="text"> 280 <string>Extrapolate</string> 281 </property> 282 </widget> 283 </item> 284 <item> 285 <widget class="QPushButton" name="transformBtn"> 286 <property name="text"> 287 <string>Transform</string> 288 </property> 289 </widget> 290 </item> 291 <item> 257 292 <widget class="QPushButton" name="extractBtn"> 258 293 <property name="text"> 259 294 <string>Extract</string> 260 </property>261 </widget>262 </item>263 <item>264 <widget class="QPushButton" name="transformBtn">265 <property name="text">266 <string>Transform</string>267 </property>268 </widget>269 </item>270 <item>271 <widget class="QPushButton" name="extrapolateBtn">272 <property name="text">273 <string>Extrapolate</string>274 295 </property> 275 296 </widget>
Note: See TracChangeset
for help on using the changeset viewer.