Changeset 22e6043 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Oct 24, 2017 8:47:09 AM (7 years ago)
- Children:
- f159d1b
- Parents:
- 7b536da
- Location:
- src/sas/qtgui/Perspectives/Corfunc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
r7b536da r22e6043 17 17 # from InvariantDetails import DetailsDialog 18 18 from CorfuncUtils import WIDGETS as W 19 20 from matplotlib.backends import qt_compat 21 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 22 from matplotlib.figure import Figure 23 24 25 class MyMplCanvas(FigureCanvas): 26 """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.).""" 27 def __init__(self, parent=None, width=5, height=4, dpi=100): 28 self.fig = Figure(figsize=(width, height), dpi=dpi) 29 self.axes = self.fig.add_subplot(111) 30 # # We want the axes cleared every time plot() is called 31 # self.axes.hold(False) 32 self.axes.set_xscale("log") 33 self.axes.set_yscale("log") 34 35 # self.compute_initial_figure() 36 37 FigureCanvas.__init__(self, self.fig) 38 # self.reparent(parent, QPoint(0, 0)) 39 40 # FigureCanvas.setSizePolicy(self, 41 # QSizePolicy.Expanding, 42 # QSizePolicy.Expanding) 43 # FigureCanvas.updateGeometry(self) 44 45 def sizeHint(self): 46 w, h = self.get_width_height() 47 return QSize(w, h) 48 49 def minimumSizeHint(self): 50 return QSize(10, 10) 19 51 20 52 … … 34 66 self.communicate = GuiUtils.Communicate() 35 67 self._calculator = CorfuncCalculator() 68 69 self._canvas = MyMplCanvas(self) 70 self.verticalLayout_7.addWidget(self._canvas) 36 71 37 72 # Connect buttons to slots. … … 147 182 self._calculator.set_data(data) 148 183 184 self._canvas.axes.plot(data.x, data.y) 185 149 186 # self.model.item(WIDGETS.W_FILENAME).setData(QtCoreQVariant(self._model_item.text())) 150 187 -
src/sas/qtgui/Perspectives/Corfunc/UI/CorfuncPanel.ui
r7b536da r22e6043 14 14 <string>Dialog</string> 15 15 </property> 16 <widget class="QWidget" name="verticalLayoutWidget_3"> 17 <property name="geometry"> 18 <rect> 19 <x>140</x> 20 <y>420</y> 21 <width>160</width> 22 <height>109</height> 23 </rect> 24 </property> 25 <layout class="QVBoxLayout" name="verticalLayout"> 26 <item alignment="Qt::AlignHCenter"> 27 <widget class="QLabel" name="label_3"> 28 <property name="text"> 29 <string>Q Range</string> 30 </property> 31 </widget> 32 </item> 33 <item> 34 <layout class="QFormLayout" name="formLayout"> 35 <item row="0" column="0"> 36 <widget class="QDoubleSpinBox" name="qMin"> 37 <property name="toolTip"> 38 <string>Values with q < qmin will be used for Guinier back extrapolation</string> 39 </property> 40 <property name="decimals"> 41 <number>4</number> 42 </property> 43 <property name="singleStep"> 44 <double>0.001000000000000</double> 45 </property> 46 </widget> 47 </item> 48 <item row="0" column="1"> 49 <widget class="QLabel" name="label"> 50 <property name="text"> 51 <string>Lower</string> 52 </property> 53 </widget> 54 </item> 55 <item row="1" column="0"> 56 <widget class="QDoubleSpinBox" name="qMax1"> 57 <property name="toolTip"> 58 <string>Values with Uppder < q < Cutoff will be used for Porod forward extrapolation</string> 59 </property> 60 <property name="decimals"> 61 <number>4</number> 62 </property> 63 <property name="singleStep"> 64 <double>0.001000000000000</double> 65 </property> 66 </widget> 67 </item> 68 <item row="1" column="1"> 69 <widget class="QLabel" name="label_2"> 70 <property name="text"> 71 <string>Upper</string> 72 </property> 73 </widget> 74 </item> 75 <item row="2" column="0"> 76 <widget class="QDoubleSpinBox" name="qMax2"> 77 <property name="toolTip"> 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> 85 </property> 86 </widget> 87 </item> 88 <item row="2" column="1"> 89 <widget class="QLabel" name="label_4"> 90 <property name="text"> 91 <string>Cutoff</string> 92 </property> 93 </widget> 94 </item> 95 </layout> 96 </item> 97 </layout> 98 </widget> 99 <widget class="QWidget" name="verticalLayoutWidget_2"> 100 <property name="geometry"> 101 <rect> 102 <x>120</x> 103 <y>130</y> 104 <width>160</width> 105 <height>80</height> 106 </rect> 107 </property> 108 <layout class="QVBoxLayout" name="verticalLayout_2"> 109 <item alignment="Qt::AlignHCenter"> 110 <widget class="QLabel" name="label_5"> 111 <property name="text"> 112 <string>Transform Type</string> 113 </property> 114 </widget> 115 </item> 116 <item> 117 <widget class="QRadioButton" name="fourierBtn"> 118 <property name="text"> 119 <string>Fourier</string> 120 </property> 121 </widget> 122 </item> 123 <item> 124 <widget class="QRadioButton" name="hilbertBtn"> 125 <property name="text"> 126 <string>Hilbert</string> 127 </property> 128 </widget> 129 </item> 130 </layout> 131 </widget> 132 <widget class="QWidget" name="horizontalLayoutWidget"> 133 <property name="geometry"> 134 <rect> 135 <x>270</x> 136 <y>320</y> 137 <width>453</width> 138 <height>81</height> 139 </rect> 140 </property> 141 <layout class="QHBoxLayout" name="horizontalLayout_2"> 142 <item> 143 <layout class="QVBoxLayout" name="verticalLayout_3"> 144 <item alignment="Qt::AlignHCenter"> 145 <widget class="QLabel" name="label_8"> 146 <property name="text"> 147 <string>Guinier</string> 148 </property> 149 </widget> 150 </item> 151 <item> 152 <layout class="QFormLayout" name="formLayout_2"> 153 <item row="0" column="0"> 154 <widget class="QDoubleSpinBox" name="guinierA"> 155 <property name="readOnly"> 156 <bool>true</bool> 157 </property> 158 <property name="decimals"> 159 <number>7</number> 160 </property> 161 </widget> 162 </item> 163 <item row="0" column="1"> 164 <widget class="QLabel" name="label_6"> 165 <property name="text"> 166 <string>A</string> 167 </property> 168 </widget> 169 </item> 170 <item row="1" column="0"> 171 <widget class="QDoubleSpinBox" name="guinierB"> 172 <property name="readOnly"> 173 <bool>true</bool> 174 </property> 175 <property name="decimals"> 176 <number>7</number> 177 </property> 178 <property name="minimum"> 179 <double>-1000000.000000000000000</double> 180 </property> 181 <property name="maximum"> 182 <double>1000000.000000000000000</double> 183 </property> 184 </widget> 185 </item> 186 <item row="1" column="1"> 187 <widget class="QLabel" name="label_7"> 188 <property name="text"> 189 <string>B</string> 190 </property> 191 </widget> 192 </item> 193 </layout> 194 </item> 195 </layout> 196 </item> 197 <item> 198 <layout class="QVBoxLayout" name="verticalLayout_4"> 199 <item alignment="Qt::AlignHCenter"> 200 <widget class="QLabel" name="label_9"> 201 <property name="text"> 202 <string>Porod</string> 203 </property> 204 </widget> 205 </item> 206 <item> 207 <layout class="QFormLayout" name="formLayout_3"> 208 <item row="0" column="0"> 209 <widget class="QDoubleSpinBox" name="porodK"> 210 <property name="readOnly"> 211 <bool>true</bool> 212 </property> 213 <property name="decimals"> 214 <number>7</number> 215 </property> 216 </widget> 217 </item> 218 <item row="0" column="1"> 219 <widget class="QLabel" name="label_10"> 220 <property name="text"> 221 <string>K</string> 222 </property> 223 </widget> 224 </item> 225 <item row="1" column="0"> 226 <widget class="QDoubleSpinBox" name="porodSigma"> 227 <property name="readOnly"> 228 <bool>true</bool> 229 </property> 230 <property name="decimals"> 231 <number>7</number> 232 </property> 233 </widget> 234 </item> 235 <item row="1" column="1"> 236 <widget class="QLabel" name="label_11"> 237 <property name="text"> 238 <string> Ï </string> 239 </property> 240 </widget> 241 </item> 242 </layout> 243 </item> 244 </layout> 245 </item> 246 <item> 247 <layout class="QVBoxLayout" name="verticalLayout_5"> 248 <item alignment="Qt::AlignHCenter"> 249 <widget class="QLabel" name="label_12"> 250 <property name="text"> 251 <string>Background</string> 252 </property> 253 </widget> 254 </item> 255 <item> 256 <widget class="QDoubleSpinBox" name="bg"> 257 <property name="readOnly"> 258 <bool>true</bool> 259 </property> 260 <property name="decimals"> 261 <number>4</number> 262 </property> 263 </widget> 264 </item> 265 <item> 266 <widget class="QPushButton" name="calculateBgBtn"> 267 <property name="text"> 268 <string>Calculate Background</string> 269 </property> 270 </widget> 271 </item> 272 </layout> 273 </item> 274 </layout> 275 </widget> 276 <widget class="QWidget" name="verticalLayoutWidget_7"> 277 <property name="geometry"> 278 <rect> 279 <x>390</x> 280 <y>480</y> 281 <width>321</width> 282 <height>80</height> 283 </rect> 284 </property> 285 <layout class="QVBoxLayout" name="verticalLayout_6"> 286 <item alignment="Qt::AlignHCenter"> 287 <widget class="QLabel" name="label_13"> 288 <property name="text"> 289 <string>Controls</string> 290 </property> 291 </widget> 292 </item> 293 <item> 294 <layout class="QHBoxLayout" name="horizontalLayout"> 295 <item> 296 <widget class="QPushButton" name="extrapolateBtn"> 297 <property name="text"> 298 <string>Extrapolate</string> 299 </property> 300 </widget> 301 </item> 302 <item> 303 <widget class="QPushButton" name="transformBtn"> 304 <property name="text"> 305 <string>Transform</string> 306 </property> 307 </widget> 308 </item> 309 <item> 310 <widget class="QPushButton" name="extractBtn"> 311 <property name="text"> 312 <string>Extract</string> 313 </property> 314 </widget> 315 </item> 316 </layout> 317 </item> 318 </layout> 319 </widget> 16 <layout class="QGridLayout" name="gridLayout"> 17 <item row="0" column="0"> 18 <layout class="QVBoxLayout" name="verticalLayout_7"> 19 <item> 20 <layout class="QHBoxLayout" name="horizontalLayout_2"> 21 <item> 22 <layout class="QVBoxLayout" name="verticalLayout_3"> 23 <item alignment="Qt::AlignHCenter"> 24 <widget class="QLabel" name="label_8"> 25 <property name="text"> 26 <string>Guinier</string> 27 </property> 28 </widget> 29 </item> 30 <item> 31 <layout class="QFormLayout" name="formLayout_2"> 32 <item row="0" column="0"> 33 <widget class="QDoubleSpinBox" name="guinierA"> 34 <property name="readOnly"> 35 <bool>true</bool> 36 </property> 37 <property name="decimals"> 38 <number>7</number> 39 </property> 40 </widget> 41 </item> 42 <item row="0" column="1"> 43 <widget class="QLabel" name="label_6"> 44 <property name="text"> 45 <string>A</string> 46 </property> 47 </widget> 48 </item> 49 <item row="1" column="0"> 50 <widget class="QDoubleSpinBox" name="guinierB"> 51 <property name="readOnly"> 52 <bool>true</bool> 53 </property> 54 <property name="decimals"> 55 <number>7</number> 56 </property> 57 <property name="minimum"> 58 <double>-1000000.000000000000000</double> 59 </property> 60 <property name="maximum"> 61 <double>1000000.000000000000000</double> 62 </property> 63 </widget> 64 </item> 65 <item row="1" column="1"> 66 <widget class="QLabel" name="label_7"> 67 <property name="text"> 68 <string>B</string> 69 </property> 70 </widget> 71 </item> 72 </layout> 73 </item> 74 </layout> 75 </item> 76 <item> 77 <layout class="QVBoxLayout" name="verticalLayout_4"> 78 <item alignment="Qt::AlignHCenter"> 79 <widget class="QLabel" name="label_9"> 80 <property name="text"> 81 <string>Porod</string> 82 </property> 83 </widget> 84 </item> 85 <item> 86 <layout class="QFormLayout" name="formLayout_3"> 87 <item row="0" column="0"> 88 <widget class="QDoubleSpinBox" name="porodK"> 89 <property name="readOnly"> 90 <bool>true</bool> 91 </property> 92 <property name="decimals"> 93 <number>7</number> 94 </property> 95 </widget> 96 </item> 97 <item row="0" column="1"> 98 <widget class="QLabel" name="label_10"> 99 <property name="text"> 100 <string>K</string> 101 </property> 102 </widget> 103 </item> 104 <item row="1" column="0"> 105 <widget class="QDoubleSpinBox" name="porodSigma"> 106 <property name="readOnly"> 107 <bool>true</bool> 108 </property> 109 <property name="decimals"> 110 <number>7</number> 111 </property> 112 </widget> 113 </item> 114 <item row="1" column="1"> 115 <widget class="QLabel" name="label_11"> 116 <property name="text"> 117 <string> Ï </string> 118 </property> 119 </widget> 120 </item> 121 </layout> 122 </item> 123 </layout> 124 </item> 125 <item> 126 <layout class="QVBoxLayout" name="verticalLayout_5"> 127 <item alignment="Qt::AlignHCenter"> 128 <widget class="QLabel" name="label_12"> 129 <property name="text"> 130 <string>Background</string> 131 </property> 132 </widget> 133 </item> 134 <item> 135 <widget class="QDoubleSpinBox" name="bg"> 136 <property name="readOnly"> 137 <bool>true</bool> 138 </property> 139 <property name="decimals"> 140 <number>4</number> 141 </property> 142 </widget> 143 </item> 144 <item> 145 <widget class="QPushButton" name="calculateBgBtn"> 146 <property name="text"> 147 <string>Calculate Background</string> 148 </property> 149 </widget> 150 </item> 151 </layout> 152 </item> 153 </layout> 154 </item> 155 <item> 156 <layout class="QHBoxLayout" name="horizontalLayout_3"> 157 <item> 158 <layout class="QVBoxLayout" name="verticalLayout_2"> 159 <item alignment="Qt::AlignHCenter"> 160 <widget class="QLabel" name="label_5"> 161 <property name="text"> 162 <string>Transform Type</string> 163 </property> 164 </widget> 165 </item> 166 <item> 167 <widget class="QRadioButton" name="fourierBtn"> 168 <property name="text"> 169 <string>Fourier</string> 170 </property> 171 </widget> 172 </item> 173 <item> 174 <widget class="QRadioButton" name="hilbertBtn"> 175 <property name="text"> 176 <string>Hilbert</string> 177 </property> 178 </widget> 179 </item> 180 </layout> 181 </item> 182 <item> 183 <layout class="QVBoxLayout" name="verticalLayout"> 184 <item alignment="Qt::AlignHCenter"> 185 <widget class="QLabel" name="label_3"> 186 <property name="text"> 187 <string>Q Range</string> 188 </property> 189 </widget> 190 </item> 191 <item> 192 <layout class="QFormLayout" name="formLayout"> 193 <item row="0" column="0"> 194 <widget class="QDoubleSpinBox" name="qMin"> 195 <property name="toolTip"> 196 <string>Values with q < qmin will be used for Guinier back extrapolation</string> 197 </property> 198 <property name="decimals"> 199 <number>4</number> 200 </property> 201 <property name="singleStep"> 202 <double>0.001000000000000</double> 203 </property> 204 </widget> 205 </item> 206 <item row="0" column="1"> 207 <widget class="QLabel" name="label"> 208 <property name="text"> 209 <string>Lower</string> 210 </property> 211 </widget> 212 </item> 213 <item row="1" column="0"> 214 <widget class="QDoubleSpinBox" name="qMax1"> 215 <property name="toolTip"> 216 <string>Values with Uppder < q < Cutoff will be used for Porod forward extrapolation</string> 217 </property> 218 <property name="decimals"> 219 <number>4</number> 220 </property> 221 <property name="singleStep"> 222 <double>0.001000000000000</double> 223 </property> 224 </widget> 225 </item> 226 <item row="1" column="1"> 227 <widget class="QLabel" name="label_2"> 228 <property name="text"> 229 <string>Upper</string> 230 </property> 231 </widget> 232 </item> 233 <item row="2" column="0"> 234 <widget class="QDoubleSpinBox" name="qMax2"> 235 <property name="toolTip"> 236 <string>Values with Uppder < q < Cutoff will be used for Porod forward extrapolation</string> 237 </property> 238 <property name="decimals"> 239 <number>4</number> 240 </property> 241 <property name="singleStep"> 242 <double>0.001000000000000</double> 243 </property> 244 </widget> 245 </item> 246 <item row="2" column="1"> 247 <widget class="QLabel" name="label_4"> 248 <property name="text"> 249 <string>Cutoff</string> 250 </property> 251 </widget> 252 </item> 253 </layout> 254 </item> 255 </layout> 256 </item> 257 <item> 258 <layout class="QVBoxLayout" name="verticalLayout_6"> 259 <item alignment="Qt::AlignHCenter"> 260 <widget class="QLabel" name="label_13"> 261 <property name="text"> 262 <string>Controls</string> 263 </property> 264 </widget> 265 </item> 266 <item> 267 <layout class="QHBoxLayout" name="horizontalLayout"> 268 <item> 269 <widget class="QPushButton" name="extrapolateBtn"> 270 <property name="text"> 271 <string>Extrapolate</string> 272 </property> 273 </widget> 274 </item> 275 <item> 276 <widget class="QPushButton" name="transformBtn"> 277 <property name="text"> 278 <string>Transform</string> 279 </property> 280 </widget> 281 </item> 282 <item> 283 <widget class="QPushButton" name="extractBtn"> 284 <property name="text"> 285 <string>Extract</string> 286 </property> 287 </widget> 288 </item> 289 </layout> 290 </item> 291 </layout> 292 </item> 293 </layout> 294 </item> 295 </layout> 296 </item> 297 </layout> 320 298 </widget> 321 299 <resources/>
Note: See TracChangeset
for help on using the changeset viewer.