Changeset d2d0441e in sasview
- Timestamp:
- Oct 26, 2017 5:55:59 AM (7 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:
- e32b120
- Parents:
- 6cbf8a5
- Location:
- src/sas/qtgui/Perspectives/PrInversion
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/PrInversion/PrInversionPerspective.py
r6cbf8a5 rd2d0441e 1 from PyQt4 import QtGui 1 from PyQt4 import QtGui, QtCore, QtWebKit 2 2 3 3 # sas-global 4 from sas.sascalc.invariant import invariant 5 from sas.qtgui.Plotting.PlotterData import Data1D 6 import sas.qtgui.Utilities.GuiUtils as GuiUtils 4 #import sas.qtgui.Utilities.GuiUtils as GuiUtils 7 5 8 6 # pr inversion gui elements 9 from sas.qtgui.Perspectives.PrInversion.UI.TabbedPrInversionUI import Ui_PrInversion 7 from sas.qtgui.Perspectives.PrInversion.UI.TabbedPrInversionUI import \ 8 Ui_PrInversion 10 9 11 10 class PrInversionWindow(QtGui.QTabWidget, Ui_PrInversion): … … 21 20 self.setWindowTitle("P(r) Inversion Perspective") 22 21 23 self.parent = parent 22 self._manager = parent 23 24 self._model_item = QtGui.QStandardItem() 25 self._helpView = QtWebKit.QWebView() 24 26 self._data = data 25 27 … … 27 29 self._allow_close = False 28 30 29 self.communicate = self.parent.communicator() 31 # Let's choose the Standard Item Model. 32 self.model = QtGui.QStandardItemModel(self) 33 34 def allowBatch(self): 35 return False 36 37 def setClosable(self, value=True): 38 """ 39 Allow outsiders close this widget 40 """ 41 assert isinstance(value, bool) 42 self._allow_close = value 43 44 def closeEvent(self, event): 45 """ 46 Overwrite QDialog close method to allow for custom widget close 47 """ 48 if self._allow_close: 49 # reset the closability flag 50 self.setClosable(value=False) 51 event.accept() 52 else: 53 event.ignore() 54 # Maybe we should just minimize 55 self.setWindowState(QtCore.Qt.WindowMinimized) -
src/sas/qtgui/Perspectives/PrInversion/UI/TabbedPrInversionUI.ui
r6cbf8a5 rd2d0441e 8 8 <y>0</y> 9 9 <width>588</width> 10 <height>525</height> 11 </rect> 12 </property> 13 <property name="minimumSize"> 14 <size> 15 <width>588</width> 10 16 <height>470</height> 11 </ rect>17 </size> 12 18 </property> 13 19 <property name="windowTitle"> 14 20 <string>P(r) Inversion</string> 15 21 </property> 16 <property name="windowIcon"> 17 <iconset> 18 <normaloff>../../../UI/res/ball.ico</normaloff>../../../UI/res/ball.ico</iconset> 19 </property> 20 <widget class="QTabWidget" name="tabWidget"> 22 <widget class="QTabWidget" name="PrTabWidget"> 21 23 <property name="geometry"> 22 24 <rect> … … 24 26 <y>10</y> 25 27 <width>565</width> 26 <height>4 11</height>28 <height>471</height> 27 29 </rect> 28 30 </property> … … 32 34 <widget class="QWidget" name="tabMain"> 33 35 <attribute name="title"> 34 <string> Invariant</string>36 <string>P(r) Parameters</string> 35 37 </attribute> 36 38 <layout class="QGridLayout" name="gridLayout_9"> 37 <item row=" 0" column="0">38 < widget class="QGroupBox" name="groupBox">39 <property name=" title">40 < string>I(q) data source</string>39 <item row="2" column="0"> 40 <layout class="QVBoxLayout" name="verticalLayout_5" stretch="2,1,1,3"> 41 <property name="bottomMargin"> 42 <number>10</number> 41 43 </property> 42 <layout class="QGridLayout" name="gridLayout_2"> 43 <item row="0" column="0"> 44 <layout class="QHBoxLayout" name="horizontalLayout_4"> 45 <item> 46 <widget class="QLabel" name="label"> 47 <property name="text"> 48 <string>Name:</string> 49 </property> 50 </widget> 51 </item> 52 <item> 53 <widget class="QLineEdit" name="lineEdit"> 54 <property name="enabled"> 55 <bool>true</bool> 56 </property> 57 <property name="frame"> 58 <bool>false</bool> 59 </property> 60 <property name="readOnly"> 61 <bool>false</bool> 62 </property> 63 </widget> 44 <item> 45 <widget class="QGroupBox" name="groupBox"> 46 <property name="title"> 47 <string>I(q) data source</string> 48 </property> 49 <layout class="QGridLayout" name="gridLayout_2"> 50 <item row="0" column="0"> 51 <layout class="QVBoxLayout" name="verticalLayout"> 52 <item> 53 <layout class="QHBoxLayout" name="horizontalLayout_2"> 54 <item> 55 <widget class="QLabel" name="label"> 56 <property name="text"> 57 <string>Data File Name:</string> 58 </property> 59 </widget> 60 </item> 61 <item> 62 <widget class="QLineEdit" name="lineEdit"> 63 <property name="enabled"> 64 <bool>true</bool> 65 </property> 66 <property name="frame"> 67 <bool>false</bool> 68 </property> 69 <property name="readOnly"> 70 <bool>false</bool> 71 </property> 72 </widget> 73 </item> 74 </layout> 75 </item> 76 <item> 77 <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="2,1,0,2,2"> 78 <item> 79 <widget class="QLabel" name="label_5"> 80 <property name="text"> 81 <string>Background Level:</string> 82 </property> 83 </widget> 84 </item> 85 <item> 86 <widget class="QLineEdit" name="lineEdit_4"> 87 <property name="enabled"> 88 <bool>false</bool> 89 </property> 90 <property name="text"> 91 <string>0.0</string> 92 </property> 93 </widget> 94 </item> 95 <item> 96 <widget class="QLabel" name="label_10"> 97 <property name="text"> 98 <string><html><head/><body><p>Ã 99 <span style=" vertical-align:super;">-1</span></p></body></html></string> 100 </property> 101 </widget> 102 </item> 103 <item> 104 <widget class="QRadioButton" name="radioButton_2"> 105 <property name="text"> 106 <string>Estimate</string> 107 </property> 108 </widget> 109 </item> 110 <item> 111 <widget class="QRadioButton" name="radioButton"> 112 <property name="text"> 113 <string>Manual Input</string> 114 </property> 115 </widget> 116 </item> 117 </layout> 118 </item> 119 </layout> 64 120 </item> 65 121 </layout> 66 </item> 67 <item row="1" column="0"> 68 <widget class="QGroupBox" name="groupBox_2"> 69 <property name="title"> 70 <string>Total Q range</string> 122 </widget> 123 </item> 124 <item> 125 <widget class="QGroupBox" name="groupBox_3"> 126 <property name="title"> 127 <string>Total Q range</string> 128 </property> 129 <layout class="QGridLayout" name="gridLayout_3"> 130 <item row="1" column="0"> 131 <layout class="QVBoxLayout" name="verticalLayout_3"> 132 <item> 133 <layout class="QHBoxLayout" name="horizontalLayout_4"> 134 <item> 135 <widget class="QLabel" name="label_7"> 136 <property name="text"> 137 <string>Min:</string> 138 </property> 139 </widget> 140 </item> 141 <item> 142 <widget class="QLineEdit" name="lineEdit_5"> 143 <property name="enabled"> 144 <bool>true</bool> 145 </property> 146 </widget> 147 </item> 148 <item> 149 <widget class="QLabel" name="label_11"> 150 <property name="text"> 151 <string><html><head/><body><p>Ã 152 <span style=" vertical-align:super;">-1</span></p></body></html></string> 153 </property> 154 </widget> 155 </item> 156 <item> 157 <widget class="QLabel" name="label_8"> 158 <property name="text"> 159 <string>Max:</string> 160 </property> 161 </widget> 162 </item> 163 <item> 164 <widget class="QLineEdit" name="lineEdit_6"> 165 <property name="enabled"> 166 <bool>true</bool> 167 </property> 168 </widget> 169 </item> 170 <item> 171 <widget class="QLabel" name="label_9"> 172 <property name="text"> 173 <string><html><head/><body><p>Ã 174 <span style=" vertical-align:super;">-1</span></p></body></html></string> 175 </property> 176 </widget> 177 </item> 178 </layout> 179 </item> 180 </layout> 181 </item> 182 </layout> 183 </widget> 184 </item> 185 <item> 186 <widget class="QGroupBox" name="groupBox_2"> 187 <property name="title"> 188 <string>Slit Parameters</string> 189 </property> 190 <layout class="QGridLayout" name="gridLayout"> 191 <item row="1" column="0"> 192 <layout class="QVBoxLayout" name="verticalLayout_2"> 193 <item> 194 <layout class="QHBoxLayout" name="horizontalLayout"> 195 <item> 196 <widget class="QLabel" name="label_3"> 197 <property name="text"> 198 <string>Height</string> 199 </property> 200 </widget> 201 </item> 202 <item> 203 <widget class="QLineEdit" name="lineEdit_2"> 204 <property name="enabled"> 205 <bool>true</bool> 206 </property> 207 </widget> 208 </item> 209 <item> 210 <widget class="QLabel" name="label_6"> 211 <property name="text"> 212 <string><html><head/><body><p>Ã 213 <span style=" vertical-align:super;">-1</span></p></body></html></string> 214 </property> 215 </widget> 216 </item> 217 <item> 218 <widget class="QLabel" name="label_4"> 219 <property name="text"> 220 <string>Width</string> 221 </property> 222 </widget> 223 </item> 224 <item> 225 <widget class="QLineEdit" name="lineEdit_3"> 226 <property name="enabled"> 227 <bool>true</bool> 228 </property> 229 </widget> 230 </item> 231 <item> 232 <widget class="QLabel" name="label_2"> 233 <property name="text"> 234 <string><html><head/><body><p>Ã 235 <span style=" vertical-align:super;">-1</span></p></body></html></string> 236 </property> 237 </widget> 238 </item> 239 </layout> 240 </item> 241 </layout> 242 </item> 243 </layout> 244 </widget> 245 </item> 246 <item> 247 <widget class="QGroupBox" name="groupBox_5"> 248 <property name="toolTip"> 249 <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 250 <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 251 p, li { white-space: pre-wrap; } 252 </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> 253 <pre style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;><span style=" font-family:'Courier New'; font-size:9pt; color:#000000;">P(r) is found by fitting a set of base functions to I(Q). The minimization involves a regularization term to ensure a smooth P(r). The regularization constant gives the size of that term. The suggested value is the value above which the output P(r) will have only one peak.</span></pre></body></html></string> 254 </property> 255 <property name="title"> 256 <string>Parameters</string> 257 </property> 258 <widget class="QWidget" name="gridLayoutWidget"> 259 <property name="geometry"> 260 <rect> 261 <x>10</x> 262 <y>20</y> 263 <width>511</width> 264 <height>123</height> 265 </rect> 71 266 </property> 72 <layout class="QGridLayout" name="gridLayout"> 267 <layout class="QGridLayout" name="gridLayout_4" rowstretch="0,0,0"> 268 <property name="margin"> 269 <number>4</number> 270 </property> 271 <item row="2" column="1"> 272 <widget class="QLineEdit" name="lineEdit_9"/> 273 </item> 274 <item row="1" column="1"> 275 <widget class="QLineEdit" name="lineEdit_8"/> 276 </item> 277 <item row="0" column="1"> 278 <widget class="QLineEdit" name="lineEdit_7"/> 279 </item> 73 280 <item row="0" column="0"> 74 <layout class="QHBoxLayout" name="horizontalLayout"> 75 <item> 76 <widget class="QLabel" name="label_3"> 77 <property name="text"> 78 <string>Min:</string> 79 </property> 80 </widget> 81 </item> 82 <item> 83 <widget class="QLineEdit" name="lineEdit_2"> 84 <property name="enabled"> 85 <bool>false</bool> 86 </property> 87 </widget> 88 </item> 89 <item> 90 <widget class="QLabel" name="label_4"> 91 <property name="text"> 92 <string>Max:</string> 93 </property> 94 </widget> 95 </item> 96 <item> 97 <widget class="QLineEdit" name="lineEdit_3"> 98 <property name="enabled"> 99 <bool>false</bool> 100 </property> 101 </widget> 102 </item> 103 <item> 104 <widget class="QLabel" name="label_2"> 105 <property name="text"> 106 <string><html><head/><body><p>Ã 107 <span style=" vertical-align:super;">-1</span></p></body></html></string> 108 </property> 109 </widget> 110 </item> 111 </layout> 281 <widget class="QLabel" name="label_12"> 282 <property name="text"> 283 <string>Number of Terms</string> 284 </property> 285 </widget> 286 </item> 287 <item row="2" column="0"> 288 <widget class="QLabel" name="label_14"> 289 <property name="text"> 290 <string>Max distance [Ã 291 ]</string> 292 </property> 293 </widget> 294 </item> 295 <item row="1" column="0"> 296 <widget class="QLabel" name="label_13"> 297 <property name="text"> 298 <string>Regularization constant</string> 299 </property> 300 </widget> 301 </item> 302 <item row="2" column="2" alignment="Qt::AlignHCenter"> 303 <widget class="QPushButton" name="pushButton_4"> 304 <property name="sizePolicy"> 305 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 306 <horstretch>0</horstretch> 307 <verstretch>0</verstretch> 308 </sizepolicy> 309 </property> 310 <property name="toolTip"> 311 <string><html><head/><body><p>Open the D<span style=" vertical-align:sub;">max</span> explorer window.</p></body></html></string> 312 </property> 313 <property name="layoutDirection"> 314 <enum>Qt::LeftToRight</enum> 315 </property> 316 <property name="text"> 317 <string>Explore</string> 318 </property> 319 </widget> 320 </item> 321 <item row="0" column="2"> 322 <widget class="QPushButton" name="pushButton_5"> 323 <property name="enabled"> 324 <bool>false</bool> 325 </property> 326 <property name="text"> 327 <string/> 328 </property> 329 </widget> 330 </item> 331 <item row="1" column="2"> 332 <widget class="QPushButton" name="pushButton_6"> 333 <property name="enabled"> 334 <bool>false</bool> 335 </property> 336 <property name="text"> 337 <string/> 338 </property> 339 </widget> 112 340 </item> 113 341 </layout> 114 342 </widget> 115 </ item>116 </ layout>117 </ widget>343 </widget> 344 </item> 345 </layout> 118 346 </item> 119 347 </layout> … … 121 349 <widget class="QWidget" name="tabOptions"> 122 350 <attribute name="title"> 123 <string>O ptions</string>351 <string>Outputs</string> 124 352 </attribute> 125 <layout class="QGridLayout" name="gridLayout_6"/> 126 </widget> 127 <widget class="QWidget" name="tab"> 128 <attribute name="title"> 129 <string>View on model</string> 130 </attribute> 131 <widget class="QTreeView" name="treeView"> 132 <property name="geometry"> 133 <rect> 134 <x>5</x> 135 <y>11</y> 136 <width>431</width> 137 <height>311</height> 138 </rect> 139 </property> 140 </widget> 353 <layout class="QGridLayout" name="gridLayout_6"> 354 <item row="0" column="0"> 355 <widget class="QGroupBox" name="groupBox_4"> 356 <property name="title"> 357 <string>Outputs</string> 358 </property> 359 <widget class="QWidget" name="verticalLayoutWidget_3"> 360 <property name="geometry"> 361 <rect> 362 <x>10</x> 363 <y>20</y> 364 <width>521</width> 365 <height>281</height> 366 </rect> 367 </property> 368 <layout class="QVBoxLayout" name="verticalLayout_4"> 369 <item> 370 <layout class="QGridLayout" name="gridLayout_5"> 371 <item row="3" column="1"> 372 <widget class="QLineEdit" name="lineEdit_15"> 373 <property name="enabled"> 374 <bool>false</bool> 375 </property> 376 </widget> 377 </item> 378 <item row="5" column="1"> 379 <widget class="QLineEdit" name="lineEdit_17"> 380 <property name="enabled"> 381 <bool>false</bool> 382 </property> 383 </widget> 384 </item> 385 <item row="7" column="1"> 386 <widget class="QLineEdit" name="lineEdit_19"> 387 <property name="enabled"> 388 <bool>false</bool> 389 </property> 390 </widget> 391 </item> 392 <item row="3" column="0"> 393 <widget class="QLabel" name="label_17"> 394 <property name="text"> 395 <string>Background</string> 396 </property> 397 </widget> 398 </item> 399 <item row="8" column="0"> 400 <widget class="QLabel" name="label_29"> 401 <property name="text"> 402 <string>1-sigma positive fraction</string> 403 </property> 404 </widget> 405 </item> 406 <item row="5" column="0"> 407 <widget class="QLabel" name="label_19"> 408 <property name="text"> 409 <string>Chi^2/dof</string> 410 </property> 411 </widget> 412 </item> 413 <item row="2" column="0"> 414 <widget class="QLabel" name="label_16"> 415 <property name="text"> 416 <string>I(Q=0)</string> 417 </property> 418 </widget> 419 </item> 420 <item row="6" column="0"> 421 <widget class="QLabel" name="label_20"> 422 <property name="text"> 423 <string>Oscillations</string> 424 </property> 425 </widget> 426 </item> 427 <item row="1" column="1"> 428 <widget class="QLineEdit" name="lineEdit_13"> 429 <property name="enabled"> 430 <bool>false</bool> 431 </property> 432 </widget> 433 </item> 434 <item row="7" column="0"> 435 <widget class="QLabel" name="label_21"> 436 <property name="text"> 437 <string>Positive Fraction</string> 438 </property> 439 </widget> 440 </item> 441 <item row="6" column="1"> 442 <widget class="QLineEdit" name="lineEdit_18"> 443 <property name="enabled"> 444 <bool>false</bool> 445 </property> 446 </widget> 447 </item> 448 <item row="4" column="0"> 449 <widget class="QLabel" name="label_18"> 450 <property name="text"> 451 <string>Computation TIme</string> 452 </property> 453 </widget> 454 </item> 455 <item row="2" column="1"> 456 <widget class="QLineEdit" name="lineEdit_14"> 457 <property name="enabled"> 458 <bool>false</bool> 459 </property> 460 </widget> 461 </item> 462 <item row="4" column="1"> 463 <widget class="QLineEdit" name="lineEdit_16"> 464 <property name="enabled"> 465 <bool>false</bool> 466 </property> 467 </widget> 468 </item> 469 <item row="1" column="0"> 470 <widget class="QLabel" name="label_15"> 471 <property name="text"> 472 <string>Rg</string> 473 </property> 474 </widget> 475 </item> 476 <item row="3" column="2"> 477 <widget class="QLabel" name="label_26"> 478 <property name="text"> 479 <string>Ã 480 -1</string> 481 </property> 482 </widget> 483 </item> 484 <item row="4" column="2"> 485 <widget class="QLabel" name="label_27"> 486 <property name="text"> 487 <string>secs</string> 488 </property> 489 </widget> 490 </item> 491 <item row="2" column="2"> 492 <widget class="QLabel" name="label_25"> 493 <property name="text"> 494 <string>Ã 495 -1</string> 496 </property> 497 </widget> 498 </item> 499 <item row="1" column="2"> 500 <widget class="QLabel" name="label_24"> 501 <property name="text"> 502 <string>Ã 503 </string> 504 </property> 505 </widget> 506 </item> 507 <item row="8" column="1"> 508 <widget class="QLineEdit" name="lineEdit_12"/> 509 </item> 510 <item row="0" column="2"> 511 <widget class="QLabel" name="label_28"> 512 <property name="text"> 513 <string>Units</string> 514 </property> 515 </widget> 516 </item> 517 <item row="0" column="1"> 518 <widget class="QLabel" name="label_23"> 519 <property name="text"> 520 <string>Calculated Value</string> 521 </property> 522 <property name="alignment"> 523 <set>Qt::AlignCenter</set> 524 </property> 525 </widget> 526 </item> 527 <item row="0" column="0"> 528 <widget class="QLabel" name="label_22"> 529 <property name="text"> 530 <string>Parameter</string> 531 </property> 532 </widget> 533 </item> 534 </layout> 535 </item> 536 </layout> 537 </widget> 538 </widget> 539 </item> 540 </layout> 141 541 </widget> 142 542 </widget> … … 145 545 <rect> 146 546 <x>10</x> 147 <y>4 30</y>547 <y>480</y> 148 548 <width>561</width> 149 549 <height>31</height> … … 151 551 </property> 152 552 <layout class="QHBoxLayout" name="horizontalLayout_8"> 553 <property name="sizeConstraint"> 554 <enum>QLayout::SetMinimumSize</enum> 555 </property> 153 556 <item> 154 557 <widget class="QPushButton" name="pushButton"> … … 187 590 </layout> 188 591 </widget> 189 <zorder>tabWidget</zorder>190 <zorder>layoutWidget</zorder>191 <zorder>horizontalSpacer</zorder>192 592 </widget> 193 593 <resources/>
Note: See TracChangeset
for help on using the changeset viewer.