프로젝트

일반

사용자정보

개정판 3206f66d

ID3206f66d5515c10859dfe3885dc0be8e77ba0c71
상위 f37cc1db
하위 1eed6634

김연진이(가) 약 5년 전에 추가함

issue #1212 Mixed 방식 - Angle Dialog 삭제

Change-Id: I73d653d20febf91b4ee6ec6592e705e2942f60b9

차이점 보기:

HYTOS/HYTOS/GeometryData_AngleDialog.py
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 sys
12
import os
13
from AppDocData import AppDocData
14
import GeometryData_Angle_UI
15
import math
16

  
17

  
18
class QGeometryData_AngleDialog(QDialog):
19
    def __init__(self):
20
        QDialog.__init__(self)
21

  
22
        self.ui = GeometryData_Angle_UI.Ui_Dialog()
23
        self.ui.setupUi(self)
24

  
25
        self.angle = None
26

  
27
        self.ui.pushButton_45_Degree.clicked.connect(self.degree_event)
28
        self.ui.pushButton_90_Degree.clicked.connect(self.degree_event)
29
        self.ui.pushButton_180_Degree.clicked.connect(self.degree_event)
30
        self.ui.pushButton_Horizontal.clicked.connect(self.degree_event)
31
        self.ui.pushButton_Vertical_Up.clicked.connect(self.degree_event)
32
        self.ui.pushButton_Vertical_Down.clicked.connect(self.degree_event)
33

  
34
    def show_dialog(self, element):
35
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
36

  
37
        if element == 'Pipe':
38
            self.ui.groupBox_Elbow.setVisible(False)
39
            self.ui.groupBox_Pipe.setVisible(True)
40
        else:
41
            self.ui.groupBox_Elbow.setVisible(True)
42
            self.ui.groupBox_Pipe.setVisible(False)
43

  
44
        self.exec_()
45

  
46
        return self.angle
47

  
48
    def degree_event(self):
49
        if self.sender() == self.ui.pushButton_45_Degree:
50
            self.angle = 45
51
        elif self.sender() == self.ui.pushButton_90_Degree:
52
            self.angle = 90
53
        elif self.sender() == self.ui.pushButton_180_Degree:
54
            self.angle = 180
55
        elif self.sender() == self.ui.pushButton_Horizontal:
56
            self.angle = 0
57
        elif self.sender() == self.ui.pushButton_Vertical_Up:
58
            self.angle = 90
59
        elif self.sender() == self.ui.pushButton_Vertical_Down:
60
            self.angle = -90
61

  
62
        QDialog.accept(self)
63

  
64
    def accept(self):
65
        QDialog.accept(self)
66

  
67
    def reject(self):
68
        QDialog.reject(self)
HYTOS/HYTOS/GeometryData_Angle_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\GeometryData_Angle.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.13.0
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9

  
10
from PyQt5 import QtCore, QtGui, QtWidgets
11

  
12

  
13
class Ui_Dialog(object):
14
    def setupUi(self, Dialog):
15
        Dialog.setObjectName("Dialog")
16
        Dialog.resize(193, 168)
17
        font = QtGui.QFont()
18
        font.setFamily("맑은 고딕")
19
        Dialog.setFont(font)
20
        icon = QtGui.QIcon()
21
        icon.addPixmap(QtGui.QPixmap(":/images/HYTOS.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
22
        Dialog.setWindowIcon(icon)
23
        self.groupBox_Elbow = QtWidgets.QGroupBox(Dialog)
24
        self.groupBox_Elbow.setGeometry(QtCore.QRect(16, 12, 161, 141))
25
        self.groupBox_Elbow.setObjectName("groupBox_Elbow")
26
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_Elbow)
27
        self.gridLayout_2.setObjectName("gridLayout_2")
28
        self.gridLayout = QtWidgets.QGridLayout()
29
        self.gridLayout.setObjectName("gridLayout")
30
        self.pushButton_45_Degree = QtWidgets.QPushButton(self.groupBox_Elbow)
31
        icon1 = QtGui.QIcon()
32
        icon1.addPixmap(QtGui.QPixmap(":/images/2K_Fitting_45_Elbow.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
33
        self.pushButton_45_Degree.setIcon(icon1)
34
        self.pushButton_45_Degree.setObjectName("pushButton_45_Degree")
35
        self.gridLayout.addWidget(self.pushButton_45_Degree, 0, 0, 1, 1)
36
        self.pushButton_90_Degree = QtWidgets.QPushButton(self.groupBox_Elbow)
37
        icon2 = QtGui.QIcon()
38
        icon2.addPixmap(QtGui.QPixmap(":/images/2K_Fitting_90_Elbow.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
39
        self.pushButton_90_Degree.setIcon(icon2)
40
        self.pushButton_90_Degree.setObjectName("pushButton_90_Degree")
41
        self.gridLayout.addWidget(self.pushButton_90_Degree, 1, 0, 1, 1)
42
        self.pushButton_180_Degree = QtWidgets.QPushButton(self.groupBox_Elbow)
43
        icon3 = QtGui.QIcon()
44
        icon3.addPixmap(QtGui.QPixmap(":/images/2K_Fitting_180_Elbow.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
45
        self.pushButton_180_Degree.setIcon(icon3)
46
        self.pushButton_180_Degree.setObjectName("pushButton_180_Degree")
47
        self.gridLayout.addWidget(self.pushButton_180_Degree, 2, 0, 1, 1)
48
        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
49
        self.groupBox_Pipe = QtWidgets.QGroupBox(Dialog)
50
        self.groupBox_Pipe.setGeometry(QtCore.QRect(16, 12, 161, 141))
51
        self.groupBox_Pipe.setObjectName("groupBox_Pipe")
52
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_Pipe)
53
        self.gridLayout_4.setObjectName("gridLayout_4")
54
        self.gridLayout_3 = QtWidgets.QGridLayout()
55
        self.gridLayout_3.setObjectName("gridLayout_3")
56
        self.pushButton_Horizontal = QtWidgets.QPushButton(self.groupBox_Pipe)
57
        self.pushButton_Horizontal.setMinimumSize(QtCore.QSize(0, 24))
58
        self.pushButton_Horizontal.setMaximumSize(QtCore.QSize(16777215, 24))
59
        self.pushButton_Horizontal.setObjectName("pushButton_Horizontal")
60
        self.gridLayout_3.addWidget(self.pushButton_Horizontal, 0, 0, 1, 1)
61
        self.pushButton_Vertical_Up = QtWidgets.QPushButton(self.groupBox_Pipe)
62
        self.pushButton_Vertical_Up.setMinimumSize(QtCore.QSize(0, 24))
63
        self.pushButton_Vertical_Up.setMaximumSize(QtCore.QSize(16777215, 24))
64
        self.pushButton_Vertical_Up.setObjectName("pushButton_Vertical_Up")
65
        self.gridLayout_3.addWidget(self.pushButton_Vertical_Up, 1, 0, 1, 1)
66
        self.pushButton_Vertical_Down = QtWidgets.QPushButton(self.groupBox_Pipe)
67
        self.pushButton_Vertical_Down.setMinimumSize(QtCore.QSize(0, 24))
68
        self.pushButton_Vertical_Down.setMaximumSize(QtCore.QSize(16777215, 24))
69
        self.pushButton_Vertical_Down.setObjectName("pushButton_Vertical_Down")
70
        self.gridLayout_3.addWidget(self.pushButton_Vertical_Down, 2, 0, 1, 1)
71
        self.gridLayout_4.addLayout(self.gridLayout_3, 0, 0, 1, 1)
72

  
73
        self.retranslateUi(Dialog)
74
        QtCore.QMetaObject.connectSlotsByName(Dialog)
75

  
76
    def retranslateUi(self, Dialog):
77
        _translate = QtCore.QCoreApplication.translate
78
        Dialog.setWindowTitle(_translate("Dialog", "Select tha angle"))
79
        self.groupBox_Elbow.setTitle(_translate("Dialog", "Select the Elbow Angle"))
80
        self.pushButton_45_Degree.setText(_translate("Dialog", "45 Degree"))
81
        self.pushButton_90_Degree.setText(_translate("Dialog", "90 Degree"))
82
        self.pushButton_180_Degree.setText(_translate("Dialog", "180 Degree"))
83
        self.groupBox_Pipe.setTitle(_translate("Dialog", "Select the Pipe Angle"))
84
        self.pushButton_Horizontal.setText(_translate("Dialog", "Horizontal"))
85
        self.pushButton_Vertical_Up.setText(_translate("Dialog", "Vertical Up"))
86
        self.pushButton_Vertical_Down.setText(_translate("Dialog", "Vertical Down"))
87
import Resource_rc
HYTOS/HYTOS/GeometryData_MixedDialog.py
68 68
        self.ui.comboBox_Schedule_No.currentIndexChanged.connect(self.getInsideDiameter)
69 69

  
70 70
        # setup angle combobox
71
        model = QtGui.QStandardItemModel()
72
        items = [("Horizontal", '0'), ("Vertical Up", '90'), ("Vertical Down", '-90')]
73
        for label, value in items:
74
            label_item = QtGui.QStandardItem(label)
75
            value_item = QtGui.QStandardItem(value)
76
            model.appendRow([label_item, value_item])
77
        model.setHorizontalHeaderLabels(['Label', 'Value'])
78

  
79
        view = QTableView(self)
80
        view.verticalHeader().hide()
81

  
82
        self.ui.comboBoxAngle.setModel(model)
83
        self.ui.comboBoxAngle.setView(view)
71
        self.set_angle('Pipe')
84 72
        # up to here
85 73

  
86 74
        self.ui.comboBoxAngle.currentIndexChanged.connect(self.on_current_index_changed)
......
158 146
                if element == 'Reducer' or element == 'Expander':
159 147
                    self.angle_input_reducer()
160 148

  
149
    def set_angle(self, element):
150
        try:
151
            model = QtGui.QStandardItemModel()
152

  
153
            if element == 'Pipe':
154
                items = [("Horizontal", '0'), ("Vertical Up", '90'), ("Vertical Down", '-90')]
155
                for label, value in items:
156
                    label_item = QtGui.QStandardItem(label)
157
                    value_item = QtGui.QStandardItem(value)
158
                    model.appendRow([label_item, value_item])
159
            elif element == 'Bend':
160
                items = [("45 Degree", '45'), ("90 Degree", '90'), ("180 Degree", '180')]
161
                for label, value in items:
162
                    label_item = QtGui.QStandardItem(label)
163
                    value_item = QtGui.QStandardItem(value)
164
                    model.appendRow([label_item, value_item])
165
            else:
166
                items = [('', '')]
167

  
168
            model.setHorizontalHeaderLabels(['Label', 'Value'])
169

  
170
            view = QTableView(self)
171
            view.verticalHeader().hide()
172

  
173
            self.ui.comboBoxAngle.setModel(model)
174
            self.ui.comboBoxAngle.setView(view)
175

  
176
        except Exception as ex:
177
            from App import App
178
            from AppDocData import MessageType
179

  
180
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
181
                                                           sys.exc_info()[-1].tb_lineno)
182
            App.mainWnd().addMessage.emit(MessageType.Error, message)
183

  
161 184
    def element_change_event(self, index):
162 185
        try:
163 186
            # self.ui.comboBox_Nominal_Pipe_Size.setCurrentIndex(-1)
......
168 191

  
169 192
            self.ui.lineEdit_Length.setEnabled(True)
170 193
            self.ui.lineEdit_Length.clear()
171
            self.ui.pushButton_Angle.setEnabled(True)
194
            # self.ui.pushButton_Angle.setEnabled(True)
172 195
            self.ui.lineEdit_Angle.setEnabled(True)
173 196
            self.ui.lineEdit_Angle.clear()
174 197
            self.ui.lineEdit_rpd.setEnabled(True)
......
180 203

  
181 204
            if index > -1:
182 205
                element = self.ui.comboBox_Element.itemText(index)
183

  
184 206
                if element == 'Pipe':
185 207
                    self.ui.lineEdit_Angle.setText('0')
186 208
                    self.ui.lineEdit_rpd.setEnabled(False)
......
195 217
                    self.ui.lineEdit_Length.setEnabled(False)
196 218
                    self.ui.lineEdit_rpd.setEnabled(False)
197 219
                else:
198
                    self.ui.pushButton_Angle.setEnabled(False)
220
                    # self.ui.pushButton_Angle.setEnabled(False)
199 221
                    self.ui.lineEdit_Length.setEnabled(False)
200 222
                    self.ui.lineEdit_Angle.setEnabled(False)
201 223
                    self.ui.lineEdit_rpd.setEnabled(False)
202 224
                    self.ui.lineEdit_d1_d2.setEnabled(False)
225

  
226
                self.set_angle(element)
203 227
        except Exception as ex:
204 228
            from App import App
205 229
            from AppDocData import MessageType
HYTOS/HYTOS/Shapes/EngineeringConnectorItem.py
207 207
                        (self.data is None or (self.data.pressure_drop is None or self.data.elevation is None)):
208 208
                    res.extend([self, 'pressure drop or elevation is invalid'])
209 209
            elif parent.category == 'Equipment - [ Rotating ]':
210
                if self.connectedItem and parent.name in ['L_KOMP', 'R_KOMP', 'R_Pump', 'L_Pump', 'V_Pump']:
210
                if self.connectedItem and parent.name.upper() in ['L_KOMP', 'R_KOMP', 'R_PUMP', 'L_PUMP', 'V_PUMP']:
211 211
                    if self.data is None or self.data.elevation is None:
212 212
                        res.extend([self, 'need to check elevation'])
213
                elif self.connectedItem and \
214
                        (self.data is None or (self.data.pressure_drop is None or self.data.elevation is None)):
213
                elif self.connectedItem and parent.name.upper() in ['L_COMP', 'R_COMP']:
214
                    if self.data.pressure is None:
215
                        res.extend([self, 'need to check pressure'])
216
                    elif self.data.elevation is None:
217
                        res.extend([self, 'need to check elevation'])
218
                elif self.connectedItem and (self.data.pressure_drop is None or self.data.elevation is None):
215 219
                    res.extend([self, 'need to check pressure drop and elevation'])
216 220
            elif self.connectedItem and parent.name in ['CV_H', 'CV_V']:
217 221
                if self.data is None or self.data.elevation is None:
HYTOS/HYTOS/StreamDataDialog.py
172 172
                data = self.get_data(row)
173 173

  
174 174
                row_count = self.ui.tableWidget_GeometryData_Mixed.rowCount() - 1
175
                dialog = QGeometryData_MixedDialog()
175
                dialog = QGeometryData_MixedDialog(self)
176 176
                (
177 177
                    isAccepted, element, nominal_pipe_size, schedule_no, inside_pipe_size, roughness, length, angle,
178 178
                    rpd,
HYTOS/HYTOS/UI/GeometryData_Angle.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>Dialog</class>
4
 <widget class="QDialog" name="Dialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>193</width>
10
    <height>168</height>
11
   </rect>
12
  </property>
13
  <property name="font">
14
   <font>
15
    <family>맑은 고딕</family>
16
   </font>
17
  </property>
18
  <property name="windowTitle">
19
   <string>Select tha angle</string>
20
  </property>
21
  <property name="windowIcon">
22
   <iconset resource="../res/Resource.qrc">
23
    <normaloff>:/images/HYTOS.png</normaloff>:/images/HYTOS.png</iconset>
24
  </property>
25
  <widget class="QGroupBox" name="groupBox_Elbow">
26
   <property name="geometry">
27
    <rect>
28
     <x>16</x>
29
     <y>12</y>
30
     <width>161</width>
31
     <height>141</height>
32
    </rect>
33
   </property>
34
   <property name="title">
35
    <string>Select the Elbow Angle</string>
36
   </property>
37
   <layout class="QGridLayout" name="gridLayout_2">
38
    <item row="0" column="0">
39
     <layout class="QGridLayout" name="gridLayout">
40
      <item row="0" column="0">
41
       <widget class="QPushButton" name="pushButton_45_Degree">
42
        <property name="text">
43
         <string>45 Degree</string>
44
        </property>
45
        <property name="icon">
46
         <iconset resource="../res/Resource.qrc">
47
          <normaloff>:/images/2K_Fitting_45_Elbow.png</normaloff>:/images/2K_Fitting_45_Elbow.png</iconset>
48
        </property>
49
       </widget>
50
      </item>
51
      <item row="1" column="0">
52
       <widget class="QPushButton" name="pushButton_90_Degree">
53
        <property name="text">
54
         <string>90 Degree</string>
55
        </property>
56
        <property name="icon">
57
         <iconset resource="../res/Resource.qrc">
58
          <normaloff>:/images/2K_Fitting_90_Elbow.png</normaloff>:/images/2K_Fitting_90_Elbow.png</iconset>
59
        </property>
60
       </widget>
61
      </item>
62
      <item row="2" column="0">
63
       <widget class="QPushButton" name="pushButton_180_Degree">
64
        <property name="text">
65
         <string>180 Degree</string>
66
        </property>
67
        <property name="icon">
68
         <iconset resource="../res/Resource.qrc">
69
          <normaloff>:/images/2K_Fitting_180_Elbow.png</normaloff>:/images/2K_Fitting_180_Elbow.png</iconset>
70
        </property>
71
       </widget>
72
      </item>
73
     </layout>
74
    </item>
75
   </layout>
76
  </widget>
77
  <widget class="QGroupBox" name="groupBox_Pipe">
78
   <property name="geometry">
79
    <rect>
80
     <x>16</x>
81
     <y>12</y>
82
     <width>161</width>
83
     <height>141</height>
84
    </rect>
85
   </property>
86
   <property name="title">
87
    <string>Select the Pipe Angle</string>
88
   </property>
89
   <layout class="QGridLayout" name="gridLayout_4">
90
    <item row="0" column="0">
91
     <layout class="QGridLayout" name="gridLayout_3">
92
      <item row="0" column="0">
93
       <widget class="QPushButton" name="pushButton_Horizontal">
94
        <property name="minimumSize">
95
         <size>
96
          <width>0</width>
97
          <height>24</height>
98
         </size>
99
        </property>
100
        <property name="maximumSize">
101
         <size>
102
          <width>16777215</width>
103
          <height>24</height>
104
         </size>
105
        </property>
106
        <property name="text">
107
         <string>Horizontal</string>
108
        </property>
109
       </widget>
110
      </item>
111
      <item row="1" column="0">
112
       <widget class="QPushButton" name="pushButton_Vertical_Up">
113
        <property name="minimumSize">
114
         <size>
115
          <width>0</width>
116
          <height>24</height>
117
         </size>
118
        </property>
119
        <property name="maximumSize">
120
         <size>
121
          <width>16777215</width>
122
          <height>24</height>
123
         </size>
124
        </property>
125
        <property name="text">
126
         <string>Vertical Up</string>
127
        </property>
128
       </widget>
129
      </item>
130
      <item row="2" column="0">
131
       <widget class="QPushButton" name="pushButton_Vertical_Down">
132
        <property name="minimumSize">
133
         <size>
134
          <width>0</width>
135
          <height>24</height>
136
         </size>
137
        </property>
138
        <property name="maximumSize">
139
         <size>
140
          <width>16777215</width>
141
          <height>24</height>
142
         </size>
143
        </property>
144
        <property name="text">
145
         <string>Vertical Down</string>
146
        </property>
147
       </widget>
148
      </item>
149
     </layout>
150
    </item>
151
   </layout>
152
  </widget>
153
 </widget>
154
 <resources>
155
  <include location="../res/Resource.qrc"/>
156
 </resources>
157
 <connections/>
158
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)