hytos / HYTOS / HYTOS / Valve_Manual.py @ 506c5823
이력 | 보기 | 이력해설 | 다운로드 (1.76 KB)
1 | 0b4e00b7 | kim yeonjin | # -*- 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 Valve_Manual_UI |
||
15 | import math |
||
16 | |||
17 | class QValve_Manual(QDialog): |
||
18 | def __init__(self): |
||
19 | QDialog.__init__(self)
|
||
20 | |||
21 | self.ui = Valve_Manual_UI.Ui_Valve_ManualDialog()
|
||
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.setVisible(False) |
||
36 | |||
37 | def set_controls(self, item): |
||
38 | self.ui.label_Img.setVisible(True) |
||
39 | |||
40 | def load_units(self): |
||
41 | from Drawing import Drawing |
||
42 | |||
43 | appDocData = AppDocData.instance() |
||
44 | drawing = appDocData.activeDrawing |
||
45 | if drawing:
|
||
46 | columnDisplayNameList = appDocData.getColumnDisplayNames(drawing.UID, 'Nozzles')
|
||
47 | if len(columnDisplayNameList) > 0: |
||
48 | for columnDisplayName in columnDisplayNameList: |
||
49 | if columnDisplayName[0] == 'Pressure Drop': |
||
50 | self.ui.label_PressureUnit.setText(columnDisplayName[1]) |
||
51 | elif columnDisplayName[0] == 'Elevation': |
||
52 | self.ui.label_ElevationUnit.setText(columnDisplayName[1]) |
||
53 | |||
54 | def accept(self): |
||
55 | QDialog.accept(self)
|
||
56 | |||
57 | def reject(self): |
||
58 | QDialog.reject(self) |