source: sasview/src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py @ 4992ff2

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 4992ff2 was 4992ff2, checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago

Initial, in-progress version. Not really working atm. SASVIEW-787

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