hytos / HYTOS / HYTOS / ShlTubHeatExchanger.py @ 0b4e00b7
이력 | 보기 | 이력해설 | 다운로드 (3.43 KB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
|
3 |
# Form implementation generated from reading ui file 'ProjectDialog.ui'
|
4 |
#
|
5 |
# Created by: PyQt5 UI code generator 5.6
|
6 |
#
|
7 |
# WARNING! All changes made in this file will be lost!
|
8 |
|
9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
10 |
from PyQt5.QtWidgets import * |
11 |
import os |
12 |
from Project import Project |
13 |
from AppDocData import AppDocData |
14 |
import ShlTubHeatExchanger_UI |
15 |
import math |
16 |
|
17 |
class QShlTubHeatExchanger(QDialog): |
18 |
def __init__(self): |
19 |
QDialog.__init__(self)
|
20 |
|
21 |
self.ui = ShlTubHeatExchanger_UI.Ui_ShlTubHeatExchangerDialog()
|
22 |
self.ui.setupUi(self) |
23 |
self.initialize()
|
24 |
|
25 |
def showDialog(self, item): |
26 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
27 |
|
28 |
self.ui.lineEdit_TagNo.setFocus()
|
29 |
self.set_controls(item)
|
30 |
self.load_units()
|
31 |
|
32 |
self.exec_()
|
33 |
|
34 |
def initialize(self): |
35 |
self.ui.label_Img_Tub1.setVisible(False) |
36 |
self.ui.label_Img_Tub2.setVisible(False) |
37 |
self.ui.label_Img_Tub3.setVisible(False) |
38 |
self.ui.label_Img_Tub4.setVisible(False) |
39 |
self.ui.label_Img_Shl1.setVisible(False) |
40 |
self.ui.label_Img_Shl2.setVisible(False) |
41 |
self.ui.label_Img_Shl3.setVisible(False) |
42 |
|
43 |
self.ui.label_Tub.setVisible(False) |
44 |
self.ui.lineEdit_Tub_Pressure.setEnabled(False) |
45 |
self.ui.lineEdit_Tub_Elevation.setEnabled(False) |
46 |
|
47 |
self.ui.label_Shl.setVisible(False) |
48 |
self.ui.lineEdit_Shl_Pressure.setEnabled(False) |
49 |
self.ui.lineEdit_Shl_Elevation.setEnabled(False) |
50 |
|
51 |
def set_controls(self, item): |
52 |
used_index = [] |
53 |
|
54 |
for connector in item.connectors: |
55 |
if connector.connectedItem:
|
56 |
used_index.append(connector._conn_index) |
57 |
|
58 |
if len(used_index) > 0: |
59 |
if 1 in used_index or 3 in used_index: |
60 |
self.ui.label_Img_Tub1.setVisible(True) |
61 |
self.ui.label_Img_Tub2.setVisible(True) |
62 |
self.ui.label_Img_Tub3.setVisible(True) |
63 |
self.ui.label_Img_Tub4.setVisible(True) |
64 |
|
65 |
self.ui.label_Tub.setVisible(True) |
66 |
self.ui.lineEdit_Tub_Pressure.setEnabled(True) |
67 |
self.ui.lineEdit_Tub_Elevation.setEnabled(True) |
68 |
|
69 |
if 2 in used_index or 4 in used_index: |
70 |
self.ui.label_Img_Shl1.setVisible(True) |
71 |
self.ui.label_Img_Shl2.setVisible(True) |
72 |
self.ui.label_Img_Shl3.setVisible(True) |
73 |
|
74 |
self.ui.label_Shl.setVisible(True) |
75 |
self.ui.lineEdit_Shl_Pressure.setEnabled(True) |
76 |
self.ui.lineEdit_Shl_Elevation.setEnabled(True) |
77 |
|
78 |
def load_units(self): |
79 |
from Drawing import Drawing |
80 |
|
81 |
appDocData = AppDocData.instance() |
82 |
drawing = appDocData.activeDrawing |
83 |
if drawing:
|
84 |
columnDisplayNameList = appDocData.getColumnDisplayNames(drawing.UID, 'Nozzles')
|
85 |
if len(columnDisplayNameList) > 0: |
86 |
for columnDisplayName in columnDisplayNameList: |
87 |
if columnDisplayName[0] == 'Pressure Drop': |
88 |
self.ui.label_PressureUnit.setText(columnDisplayName[1]) |
89 |
elif columnDisplayName[0] == 'Elevation': |
90 |
self.ui.label_ElevationUnit.setText(columnDisplayName[1]) |
91 |
|
92 |
def accept(self): |
93 |
|
94 |
QDialog.accept(self)
|
95 |
|
96 |
def reject(self): |
97 |
QDialog.reject(self)
|