source: sasview/src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py @ 03c372d

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 03c372d was f721030, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 8 years ago

Initial commit of the main window prototype

  • Property mode set to 100755
File size: 1.9 KB
Line 
1import sys
2import os
3from PyQt4 import QtCore
4from PyQt4 import QtGui
5
6# local
7from UI.InvariantDetailsUI import Dialog
8from InvariantUtils import WIDGETS
9
10class DetailsDialog(Dialog):
11    """
12    """
13    def __init__(self, parent):
14        Dialog.__init__(self, parent)
15
16        self.progressBar.setMinimum(0)
17        self.progressBar.setMaximum(100)
18
19        self.progressBar_2.setMinimum(0)
20        self.progressBar_2.setMaximum(100)
21
22        self.progressBar_3.setMinimum(0)
23        self.progressBar_3.setMaximum(100)
24
25    def setModel(self, model):
26        """
27        """
28        self._model = model
29
30    def showDialog(self):
31        """
32        """
33        # Pull out data from the model
34        qstar_total = float(self._model.item(WIDGETS.W_INVARIANT).text())
35        self.lineEdit_3.setText(str(qstar_total))
36        self.lineEdit_4.setText(self._model.item(WIDGETS.W_INVARIANT_ERR).text())
37
38        progress_low_qstar = 0.0
39        progress_high_qstar = 0.0
40        progress_qstar = 100.0
41
42        if self._model.item(WIDGETS.W_ENABLE_LOWQ).text() == "true":
43            qlow = float(self._model.item(WIDGETS.D_LOW_QSTAR).text())
44            self.lineEdit.setText(str(qlow))
45            self.lineEdit_2.setText(self._model.item(WIDGETS.D_LOW_QSTAR_ERR).text())
46            progress_low_qstar = (qlow/qstar_total)*100.0
47
48        if self._model.item(WIDGETS.W_ENABLE_HIGHQ).text() == "true":
49            qhigh = float(self._model.item(WIDGETS.D_LOW_QSTAR).text())
50            self.lineEdit.setText(str(qhigh))
51            self.lineEdit_2.setText(self._model.item(WIDGETS.D_HIGH_QSTAR_ERR).text())
52            progress_high_qstar = (qhigh/qstar_total)*100.0
53
54
55        progress_qstar -= progress_low_qstar + progress_high_qstar
56
57        self.progressBar.setValue(progress_low_qstar)
58        self.progressBar_2.setValue(progress_qstar)           
59        self.progressBar_3.setValue(progress_high_qstar)           
60
61        self.show()
Note: See TracBrowser for help on using the repository browser.