- Timestamp:
- Mar 26, 2019 10:54:57 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl
- Children:
- 5123512
- Parents:
- 5d14851a
- Location:
- src/sas/qtgui/Calculators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/SldPanel.py
r82efbe9 r9f3db13 1 1 # global 2 import numpy as np 2 3 import logging 3 4 from PyQt5 import QtCore … … 120 121 #self.ui.editMolecularFormula.setValidator(GuiUtils.FormulaValidator(self.ui.editMolecularFormula)) 121 122 123 # No need for recalculate 124 self.ui.recalculateButton.setVisible(False) 125 122 126 rx = QtCore.QRegExp("[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?") 123 127 self.ui.editMassDensity.setValidator(QtGui.QRegExpValidator(rx, self.ui.editMassDensity)) … … 143 147 self.model.setItem(key, QtGui.QStandardItem()) 144 148 145 self.model.dataChanged.connect(self.dataChanged)149 #self.model.dataChanged.connect(self.dataChanged) 146 150 147 151 self.ui.editMassDensity.textChanged.connect(self.recalculateSLD) … … 188 192 return ("%-5.3g" % value).strip() 189 193 190 if neutronWavelength :194 if neutronWavelength and float(neutronWavelength) > np.finfo(float).eps: 191 195 results = neutronSldAlgorithm(str(formula), float(density), float(neutronWavelength)) 192 196 … … 214 218 self.ui.editNeutronAbsXs.setEnabled(False) 215 219 216 if xrayWavelength :220 if xrayWavelength and float(xrayWavelength) > np.finfo(float).eps: 217 221 results = xraySldAlgorithm(str(formula), float(density), float(xrayWavelength)) 218 222 -
src/sas/qtgui/Calculators/UI/SldPanel.ui
r82efbe9 r9f3db13 8 8 <y>0</y> 9 9 <width>490</width> 10 <height>4 90</height>10 <height>446</height> 11 11 </rect> 12 12 </property> … … 38 38 </spacer> 39 39 </item> 40 <item row="1" column="0"> 41 <widget class="QGroupBox" name="groupBoxOutput"> 42 <property name="title"> 43 <string>Output</string> 44 </property> 45 <layout class="QGridLayout" name="gridLayoutOutput"> 46 <item row="0" column="1"> 47 <widget class="QLineEdit" name="editNeutronSldReal"> 48 <property name="enabled"> 49 <bool>true</bool> 50 </property> 51 <property name="readOnly"> 52 <bool>true</bool> 53 </property> 54 </widget> 55 </item> 56 <item row="0" column="0"> 57 <widget class="QLabel" name="label_17"> 58 <property name="text"> 59 <string>Neutron SLD</string> 60 </property> 61 </widget> 62 </item> 63 <item row="5" column="0"> 64 <widget class="QLabel" name="label_3"> 65 <property name="text"> 66 <string>Neutron 1/e length</string> 67 </property> 68 </widget> 69 </item> 70 <item row="3" column="1"> 71 <widget class="QLineEdit" name="editNeutronIncXs"> 72 <property name="enabled"> 73 <bool>true</bool> 74 </property> 75 <property name="readOnly"> 76 <bool>true</bool> 77 </property> 78 </widget> 79 </item> 80 <item row="3" column="0"> 81 <widget class="QLabel" name="label_21"> 82 <property name="text"> 83 <string>Neutron Inc. Xs</string> 84 </property> 85 </widget> 86 </item> 87 <item row="0" column="2"> 88 <widget class="QLabel" name="label_18"> 89 <property name="text"> 90 <string>-i</string> 91 </property> 92 </widget> 93 </item> 94 <item row="1" column="2"> 95 <widget class="QLabel" name="label_20"> 96 <property name="text"> 97 <string>-i</string> 98 </property> 99 </widget> 100 </item> 101 <item row="0" column="3"> 102 <widget class="QLineEdit" name="editNeutronSldImag"> 103 <property name="enabled"> 104 <bool>true</bool> 105 </property> 106 <property name="readOnly"> 107 <bool>true</bool> 108 </property> 109 </widget> 110 </item> 111 <item row="5" column="2" colspan="2"> 112 <widget class="QLabel" name="label_4"> 113 <property name="text"> 114 <string>cm</string> 115 </property> 116 </widget> 117 </item> 118 <item row="5" column="1"> 119 <widget class="QLineEdit" name="editNeutronLength"> 120 <property name="enabled"> 121 <bool>true</bool> 122 </property> 123 <property name="readOnly"> 124 <bool>true</bool> 125 </property> 126 </widget> 127 </item> 128 <item row="4" column="2" colspan="2"> 129 <widget class="QLabel" name="label_24"> 130 <property name="text"> 131 <string>1/cm</string> 132 </property> 133 </widget> 134 </item> 135 <item row="4" column="1"> 136 <widget class="QLineEdit" name="editNeutronAbsXs"> 137 <property name="enabled"> 138 <bool>true</bool> 139 </property> 140 <property name="readOnly"> 141 <bool>true</bool> 142 </property> 143 </widget> 144 </item> 145 <item row="4" column="0"> 146 <widget class="QLabel" name="label_23"> 147 <property name="text"> 148 <string>Neutron Abs. Xs</string> 149 </property> 150 </widget> 151 </item> 152 <item row="3" column="2" colspan="2"> 153 <widget class="QLabel" name="label_22"> 154 <property name="text"> 155 <string>1/cm</string> 156 </property> 157 </widget> 158 </item> 159 <item row="1" column="4"> 160 <widget class="QLabel" name="label_6"> 161 <property name="text"> 162 <string>1/à 163 ²</string> 164 </property> 165 </widget> 166 </item> 167 <item row="1" column="0"> 168 <widget class="QLabel" name="label_19"> 169 <property name="text"> 170 <string>X-Ray SLD</string> 171 </property> 172 </widget> 173 </item> 174 <item row="0" column="4"> 175 <widget class="QLabel" name="label_5"> 176 <property name="text"> 177 <string>1/à 178 ²</string> 179 </property> 180 </widget> 181 </item> 182 <item row="2" column="0" colspan="5"> 183 <widget class="QFrame" name="frame"> 184 <property name="minimumSize"> 185 <size> 186 <width>0</width> 187 <height>5</height> 188 </size> 189 </property> 190 <property name="frameShape"> 191 <enum>QFrame::HLine</enum> 192 </property> 193 <property name="frameShadow"> 194 <enum>QFrame::Raised</enum> 195 </property> 196 <property name="lineWidth"> 197 <number>1</number> 198 </property> 199 <property name="midLineWidth"> 200 <number>0</number> 201 </property> 202 </widget> 203 </item> 204 <item row="1" column="1"> 205 <widget class="QLineEdit" name="editXraySldReal"> 206 <property name="enabled"> 207 <bool>true</bool> 208 </property> 209 <property name="readOnly"> 210 <bool>true</bool> 211 </property> 212 </widget> 213 </item> 214 <item row="1" column="3"> 215 <widget class="QLineEdit" name="editXraySldImag"> 216 <property name="enabled"> 217 <bool>true</bool> 218 </property> 219 <property name="readOnly"> 220 <bool>true</bool> 221 </property> 222 </widget> 223 </item> 224 </layout> 225 </widget> 226 </item> 227 <item row="0" column="0"> 228 <widget class="QGroupBox" name="groupBoxInput"> 229 <property name="title"> 230 <string>Input</string> 231 </property> 232 <layout class="QGridLayout" name="gridLayoutInput"> 233 <item row="1" column="0"> 234 <widget class="QLabel" name="label_8"> 235 <property name="text"> 236 <string>Mass Density</string> 237 </property> 238 </widget> 239 </item> 240 <item row="1" column="2"> 241 <widget class="QLabel" name="label_16"> 242 <property name="text"> 243 <string>g/cm³</string> 244 </property> 245 </widget> 246 </item> 247 <item row="0" column="2"> 248 <widget class="QLabel" name="label_10"> 249 <property name="text"> 250 <string>e.g. H2O</string> 251 </property> 252 </widget> 253 </item> 254 <item row="0" column="1"> 255 <widget class="QLineEdit" name="editMolecularFormula"/> 256 </item> 257 <item row="1" column="1"> 258 <widget class="QLineEdit" name="editMassDensity"/> 259 </item> 260 <item row="2" column="2"> 261 <widget class="QLabel" name="label_12"> 262 <property name="text"> 263 <string>à 264 </string> 265 </property> 266 </widget> 267 </item> 268 <item row="0" column="0"> 269 <widget class="QLabel" name="label_9"> 270 <property name="text"> 271 <string>Molecular Formula</string> 272 </property> 273 </widget> 274 </item> 275 <item row="2" column="0"> 276 <widget class="QLabel" name="label_11"> 277 <property name="text"> 278 <string>Neutron Wavelength</string> 279 </property> 280 </widget> 281 </item> 282 <item row="2" column="1"> 283 <widget class="QLineEdit" name="editNeutronWavelength"> 284 <property name="styleSheet"> 285 <string notr="true"/> 286 </property> 287 <property name="readOnly"> 288 <bool>false</bool> 289 </property> 290 </widget> 291 </item> 292 <item row="3" column="1"> 293 <widget class="QLineEdit" name="editXrayWavelength"/> 294 </item> 295 <item row="3" column="0"> 296 <widget class="QLabel" name="label_13"> 297 <property name="text"> 298 <string>X-Ray Wavelength</string> 299 </property> 300 </widget> 301 </item> 302 <item row="3" column="2"> 303 <widget class="QLabel" name="label"> 304 <property name="text"> 305 <string>à 306 </string> 307 </property> 308 </widget> 309 </item> 310 </layout> 311 </widget> 312 </item> 40 313 <item row="4" column="0"> 41 314 <widget class="QWidget" name="widget" native="true"> … … 46 319 </size> 47 320 </property> 48 <widget class="QPushButton" name="recalculateButton"> 49 <property name="geometry"> 50 <rect> 51 <x>0</x> 52 <y>0</y> 53 <width>114</width> 54 <height>32</height> 55 </rect> 56 </property> 57 <property name="text"> 58 <string>Recalculate</string> 59 </property> 60 </widget> 61 <widget class="QPushButton" name="helpButton"> 62 <property name="geometry"> 63 <rect> 64 <x>176</x> 65 <y>0</y> 66 <width>114</width> 67 <height>32</height> 68 </rect> 69 </property> 70 <property name="text"> 71 <string>Help</string> 72 </property> 73 </widget> 74 <widget class="QPushButton" name="closeButton"> 75 <property name="geometry"> 76 <rect> 77 <x>352</x> 78 <y>0</y> 79 <width>114</width> 80 <height>32</height> 81 </rect> 82 </property> 83 <property name="text"> 84 <string>Close</string> 85 </property> 86 </widget> 87 </widget> 88 </item> 89 <item row="0" column="0"> 90 <widget class="QGroupBox" name="groupBoxInput"> 91 <property name="title"> 92 <string>Input</string> 93 </property> 94 <layout class="QGridLayout" name="gridLayoutInput"> 95 <item row="1" column="0"> 96 <widget class="QLabel" name="label_8"> 97 <property name="text"> 98 <string>Mass Density</string> 99 </property> 100 </widget> 101 </item> 102 <item row="1" column="2"> 103 <widget class="QLabel" name="label_16"> 104 <property name="text"> 105 <string>g/cm³</string> 106 </property> 107 </widget> 321 <layout class="QGridLayout" name="gridLayout"> 322 <item row="0" column="0"> 323 <widget class="QPushButton" name="recalculateButton"> 324 <property name="enabled"> 325 <bool>true</bool> 326 </property> 327 <property name="text"> 328 <string>Recalculate</string> 329 </property> 330 </widget> 331 </item> 332 <item row="0" column="1"> 333 <spacer name="horizontalSpacer"> 334 <property name="orientation"> 335 <enum>Qt::Horizontal</enum> 336 </property> 337 <property name="sizeHint" stdset="0"> 338 <size> 339 <width>208</width> 340 <height>20</height> 341 </size> 342 </property> 343 </spacer> 108 344 </item> 109 345 <item row="0" column="2"> 110 <widget class="QLabel" name="label_10"> 111 <property name="text"> 112 <string>e.g. H2O</string> 113 </property> 114 </widget> 115 </item> 116 <item row="0" column="1"> 117 <widget class="QLineEdit" name="editMolecularFormula"/> 118 </item> 119 <item row="1" column="1"> 120 <widget class="QLineEdit" name="editMassDensity"/> 121 </item> 122 <item row="2" column="2"> 123 <widget class="QLabel" name="label_12"> 124 <property name="text"> 125 <string>à 126 </string> 127 </property> 128 </widget> 129 </item> 130 <item row="0" column="0"> 131 <widget class="QLabel" name="label_9"> 132 <property name="text"> 133 <string>Molecular Formula</string> 134 </property> 135 </widget> 136 </item> 137 <item row="2" column="0"> 138 <widget class="QLabel" name="label_11"> 139 <property name="text"> 140 <string>Neutron Wavelength</string> 141 </property> 142 </widget> 143 </item> 144 <item row="2" column="1"> 145 <widget class="QLineEdit" name="editNeutronWavelength"> 146 <property name="styleSheet"> 147 <string notr="true"/> 148 </property> 149 <property name="readOnly"> 150 <bool>false</bool> 151 </property> 152 </widget> 153 </item> 154 <item row="3" column="1"> 155 <widget class="QLineEdit" name="editXrayWavelength"/> 156 </item> 157 <item row="3" column="0"> 158 <widget class="QLabel" name="label_13"> 159 <property name="text"> 160 <string>X-Ray Wavelength</string> 161 </property> 162 </widget> 163 </item> 164 <item row="3" column="2"> 165 <widget class="QLabel" name="label"> 166 <property name="text"> 167 <string>à 168 </string> 169 </property> 170 </widget> 171 </item> 172 </layout> 173 </widget> 174 </item> 175 <item row="1" column="0"> 176 <widget class="QGroupBox" name="groupBoxOutput"> 177 <property name="title"> 178 <string>Output</string> 179 </property> 180 <layout class="QGridLayout" name="gridLayoutOutput"> 181 <item row="0" column="1"> 182 <widget class="QLineEdit" name="editNeutronSldReal"> 183 <property name="enabled"> 184 <bool>true</bool> 185 </property> 186 <property name="readOnly"> 187 <bool>true</bool> 188 </property> 189 </widget> 190 </item> 191 <item row="0" column="0"> 192 <widget class="QLabel" name="label_17"> 193 <property name="text"> 194 <string>Neutron SLD</string> 195 </property> 196 </widget> 197 </item> 198 <item row="5" column="0"> 199 <widget class="QLabel" name="label_3"> 200 <property name="text"> 201 <string>Neutron 1/e length</string> 202 </property> 203 </widget> 204 </item> 205 <item row="3" column="1"> 206 <widget class="QLineEdit" name="editNeutronIncXs"> 207 <property name="enabled"> 208 <bool>true</bool> 209 </property> 210 <property name="readOnly"> 211 <bool>true</bool> 212 </property> 213 </widget> 214 </item> 215 <item row="3" column="0"> 216 <widget class="QLabel" name="label_21"> 217 <property name="text"> 218 <string>Neutron Inc. Xs</string> 219 </property> 220 </widget> 221 </item> 222 <item row="0" column="2"> 223 <widget class="QLabel" name="label_18"> 224 <property name="text"> 225 <string>-i</string> 226 </property> 227 </widget> 228 </item> 229 <item row="1" column="2"> 230 <widget class="QLabel" name="label_20"> 231 <property name="text"> 232 <string>-i</string> 346 <widget class="QPushButton" name="closeButton"> 347 <property name="text"> 348 <string>Close</string> 233 349 </property> 234 350 </widget> 235 351 </item> 236 352 <item row="0" column="3"> 237 <widget class="QLineEdit" name="editNeutronSldImag"> 238 <property name="enabled"> 239 <bool>true</bool> 240 </property> 241 <property name="readOnly"> 242 <bool>true</bool> 243 </property> 244 </widget> 245 </item> 246 <item row="5" column="2" colspan="2"> 247 <widget class="QLabel" name="label_4"> 248 <property name="text"> 249 <string>cm</string> 250 </property> 251 </widget> 252 </item> 253 <item row="5" column="1"> 254 <widget class="QLineEdit" name="editNeutronLength"> 255 <property name="enabled"> 256 <bool>true</bool> 257 </property> 258 <property name="readOnly"> 259 <bool>true</bool> 260 </property> 261 </widget> 262 </item> 263 <item row="4" column="2" colspan="2"> 264 <widget class="QLabel" name="label_24"> 265 <property name="text"> 266 <string>1/cm</string> 267 </property> 268 </widget> 269 </item> 270 <item row="4" column="1"> 271 <widget class="QLineEdit" name="editNeutronAbsXs"> 272 <property name="enabled"> 273 <bool>true</bool> 274 </property> 275 <property name="readOnly"> 276 <bool>true</bool> 277 </property> 278 </widget> 279 </item> 280 <item row="4" column="0"> 281 <widget class="QLabel" name="label_23"> 282 <property name="text"> 283 <string>Neutron Abs. Xs</string> 284 </property> 285 </widget> 286 </item> 287 <item row="3" column="2" colspan="2"> 288 <widget class="QLabel" name="label_22"> 289 <property name="text"> 290 <string>1/cm</string> 291 </property> 292 </widget> 293 </item> 294 <item row="1" column="4"> 295 <widget class="QLabel" name="label_6"> 296 <property name="text"> 297 <string>1/à 298 ²</string> 299 </property> 300 </widget> 301 </item> 302 <item row="1" column="0"> 303 <widget class="QLabel" name="label_19"> 304 <property name="text"> 305 <string>X-Ray SLD</string> 306 </property> 307 </widget> 308 </item> 309 <item row="0" column="4"> 310 <widget class="QLabel" name="label_5"> 311 <property name="text"> 312 <string>1/à 313 ²</string> 314 </property> 315 </widget> 316 </item> 317 <item row="2" column="0" colspan="5"> 318 <widget class="QFrame" name="frame"> 319 <property name="minimumSize"> 320 <size> 321 <width>0</width> 322 <height>5</height> 323 </size> 324 </property> 325 <property name="frameShape"> 326 <enum>QFrame::HLine</enum> 327 </property> 328 <property name="frameShadow"> 329 <enum>QFrame::Raised</enum> 330 </property> 331 <property name="lineWidth"> 332 <number>1</number> 333 </property> 334 <property name="midLineWidth"> 335 <number>0</number> 336 </property> 337 </widget> 338 </item> 339 <item row="1" column="1"> 340 <widget class="QLineEdit" name="editXraySldReal"> 341 <property name="enabled"> 342 <bool>true</bool> 343 </property> 344 <property name="readOnly"> 345 <bool>true</bool> 346 </property> 347 </widget> 348 </item> 349 <item row="1" column="3"> 350 <widget class="QLineEdit" name="editXraySldImag"> 351 <property name="enabled"> 352 <bool>true</bool> 353 </property> 354 <property name="readOnly"> 355 <bool>true</bool> 353 <widget class="QPushButton" name="helpButton"> 354 <property name="text"> 355 <string>Help</string> 356 356 </property> 357 357 </widget>
Note: See TracChangeset
for help on using the changeset viewer.