프로젝트

일반

사용자정보

통계
| 개정판:

hytos / HYTOS / HYTOS / Strainer_T.py @ 0b4e00b7

이력 | 보기 | 이력해설 | 다운로드 (1.76 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 Strainer_T_UI
15
import math
16

    
17
class QStrainer_T(QDialog):
18
    def __init__(self):
19
        QDialog.__init__(self)
20

    
21
        self.ui = Strainer_T_UI.Ui_Strainer_T_Dialog()
22
        self.ui.setupUi(self)
23
        self.initialize()
24
        
25
        
26
    def showDialog(self, item):
27
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
28

    
29
        self.ui.lineEdit_TagNo.setFocus()
30
        self.set_controls(item)
31
        self.load_units()
32

    
33
        self.exec_()
34

    
35
    def initialize(self):
36
        self.ui.label_Img.setVisible(False)
37

    
38
    def set_controls(self, item):    
39
        self.ui.label_Img.setVisible(True)
40

    
41
    def load_units(self):
42
        from Drawing import Drawing
43
        
44
        appDocData = AppDocData.instance()
45
        drawing = appDocData.activeDrawing    
46
        if drawing:
47
            columnDisplayNameList = appDocData.getColumnDisplayNames(drawing.UID, 'Nozzles')
48
            if len(columnDisplayNameList) > 0:                
49
                for columnDisplayName in columnDisplayNameList:        
50
                    if columnDisplayName[0] == 'Pressure Drop':
51
                        self.ui.label_PressureUnit.setText(columnDisplayName[1])
52
                    elif columnDisplayName[0] == 'Elevation':
53
                        self.ui.label_ElevationUnit.setText(columnDisplayName[1])
54
        
55
    def accept(self):
56
        QDialog.accept(self)
57

    
58
    def reject(self):
59
        QDialog.reject(self)
클립보드 이미지 추가 (최대 크기: 500 MB)