source: sasview/src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py @ 60af928

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 60af928 was 60af928, checked in by Piotr Rozyczko <rozyczko@…>, 4 years ago

Fitting perspective refactoring for multitab support SASVIEW-345

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