개정판 7c33a27f
issue #1255 : Mixed Type - Regime 처리
Change-Id: Ia5363aed1449c4a5eb3fc702ded3971163c77e00
HYTOS/HYTOS/PressureVariation.py | ||
---|---|---|
14 | 14 |
import PressureVariation_UI |
15 | 15 |
import math |
16 | 16 |
|
17 |
|
|
18 | 17 |
def is_blank(s): |
19 | 18 |
return not (s and s.strip()) |
20 | 19 |
|
... | ... | |
70 | 69 |
self.ui.setupUi(self) |
71 | 70 |
self.units = None |
72 | 71 |
self.item = None |
72 |
|
|
73 | 73 |
self.init_units() |
74 | 74 |
self.initialize() |
75 | 75 |
|
... | ... | |
78 | 78 |
|
79 | 79 |
self.item = item |
80 | 80 |
self.load_data() |
81 |
self.load_regime() |
|
81 | 82 |
|
82 | 83 |
return self.exec_() |
83 | 84 |
|
... | ... | |
173 | 174 |
sys.exc_info()[-1].tb_lineno) |
174 | 175 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
175 | 176 |
|
177 |
def load_regime(self): |
|
178 |
try: |
|
179 |
for row in range(self.ui.tableWidget.rowCount()): |
|
180 |
length = self.ui.tableWidget.item(row, 3).text() |
|
181 |
if is_not_blank(length): |
|
182 |
x = float(self.ui.tableWidget.item(row, 14).text()) |
|
183 |
y = float(self.ui.tableWidget.item(row, 15).text()) |
|
184 |
|
|
185 |
angle = float(self.ui.tableWidget.item(row, 4).text()) |
|
186 |
if angle == 0: |
|
187 |
# Horizontal |
|
188 |
left = 32 + (204 / (7 + 5)) * (math.log10(x) + 5) |
|
189 |
top = 270 - (242 / (5 + 9)) * (math.log10(y) + 9) |
|
190 |
|
|
191 |
label = QtWidgets.QLabel(self.ui.groupBox_4) |
|
192 |
label.setText('■') |
|
193 |
label.setStyleSheet('QLabel {color: blue;}') |
|
194 |
label.setGeometry(QtCore.QRect(left, top, 8, 8)) |
|
195 |
elif angle > 0: |
|
196 |
# Vertical Upward |
|
197 |
left = 35 + (209 / (7 - (-2))) * (math.log10(x) - (-2)) |
|
198 |
top = 269 - (237 / (8 - (-5))) * (math.log10(y) - (-5)) |
|
199 |
|
|
200 |
label = QtWidgets.QLabel(self.ui.groupBox_3) |
|
201 |
label.setText('■') |
|
202 |
label.setStyleSheet('QLabel {color: blue;}') |
|
203 |
label.setGeometry(QtCore.QRect(left, top, 8, 8)) |
|
204 |
elif angle < 0: |
|
205 |
# Vertical Downward |
|
206 |
left = 33 + (198 / (20 - 0)) * (x - 0) |
|
207 |
top = 269 - (241 / (24 - 2)) * (y - 2) |
|
208 |
|
|
209 |
label = QtWidgets.QLabel(self.ui.groupBox_5) |
|
210 |
label.setText('■') |
|
211 |
label.setStyleSheet('QLabel {color: blue;}') |
|
212 |
label.setGeometry(QtCore.QRect(left, top, 8, 8)) |
|
213 |
except Exception as ex: |
|
214 |
from App import App |
|
215 |
from AppDocData import MessageType |
|
216 |
|
|
217 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
218 |
sys.exc_info()[-1].tb_lineno) |
|
219 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
220 |
|
|
176 | 221 |
def load_data(self): |
177 | 222 |
try: |
178 | 223 |
self.ui.listWidget_Status.clear() |
... | ... | |
274 | 319 |
sys.exc_info()[-1].tb_lineno) |
275 | 320 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
276 | 321 |
|
277 |
|
|
278 | 322 |
def accept(self): |
279 | 323 |
QDialog.accept(self) |
280 | 324 |
|
281 |
|
|
282 | 325 |
def reject(self): |
283 | 326 |
QDialog.reject(self) |
HYTOS/HYTOS/PressureVariation_UI.py | ||
---|---|---|
35 | 35 |
self.groupBox.setObjectName("groupBox") |
36 | 36 |
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox) |
37 | 37 |
self.gridLayout_4.setObjectName("gridLayout_4") |
38 |
self.groupBox_5 = QtWidgets.QGroupBox(self.groupBox)
|
|
39 |
self.groupBox_5.setMinimumSize(QtCore.QSize(256, 0))
|
|
40 |
self.groupBox_5.setMaximumSize(QtCore.QSize(256, 16777215))
|
|
38 |
self.groupBox_3 = QtWidgets.QGroupBox(self.groupBox)
|
|
39 |
self.groupBox_3.setMinimumSize(QtCore.QSize(264, 0))
|
|
40 |
self.groupBox_3.setMaximumSize(QtCore.QSize(264, 16777215))
|
|
41 | 41 |
font = QtGui.QFont() |
42 | 42 |
font.setBold(False) |
43 | 43 |
font.setWeight(50) |
44 |
self.groupBox_5.setFont(font)
|
|
45 |
self.groupBox_5.setObjectName("groupBox_5")
|
|
46 |
self.gridLayout_7 = QtWidgets.QGridLayout(self.groupBox_5)
|
|
47 |
self.gridLayout_7.setObjectName("gridLayout_7")
|
|
48 |
self.label_3 = QtWidgets.QLabel(self.groupBox_5)
|
|
49 |
self.label_3.setObjectName("label_3")
|
|
50 |
self.gridLayout_7.addWidget(self.label_3, 0, 0, 1, 1)
|
|
51 |
self.gridLayout_4.addWidget(self.groupBox_5, 0, 2, 1, 1)
|
|
44 |
self.groupBox_3.setFont(font)
|
|
45 |
self.groupBox_3.setObjectName("groupBox_3")
|
|
46 |
self.label_2 = QtWidgets.QLabel(self.groupBox_3)
|
|
47 |
self.label_2.setGeometry(QtCore.QRect(10, 25, 244, 273))
|
|
48 |
self.label_2.setMinimumSize(QtCore.QSize(244, 0))
|
|
49 |
self.label_2.setMaximumSize(QtCore.QSize(244, 16777215))
|
|
50 |
self.label_2.setObjectName("label_2")
|
|
51 |
self.gridLayout_4.addWidget(self.groupBox_3, 0, 1, 1, 1)
|
|
52 | 52 |
self.groupBox_4 = QtWidgets.QGroupBox(self.groupBox) |
53 | 53 |
self.groupBox_4.setMinimumSize(QtCore.QSize(260, 0)) |
54 | 54 |
self.groupBox_4.setMaximumSize(QtCore.QSize(260, 16777215)) |
... | ... | |
57 | 57 |
font.setWeight(50) |
58 | 58 |
self.groupBox_4.setFont(font) |
59 | 59 |
self.groupBox_4.setObjectName("groupBox_4") |
60 |
self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_4) |
|
61 |
self.gridLayout_5.setObjectName("gridLayout_5") |
|
62 | 60 |
self.label = QtWidgets.QLabel(self.groupBox_4) |
61 |
self.label.setGeometry(QtCore.QRect(10, 25, 240, 277)) |
|
63 | 62 |
self.label.setObjectName("label") |
64 |
self.gridLayout_5.addWidget(self.label, 0, 0, 1, 1) |
|
65 | 63 |
self.gridLayout_4.addWidget(self.groupBox_4, 0, 0, 1, 1) |
66 |
self.groupBox_3 = QtWidgets.QGroupBox(self.groupBox) |
|
67 |
self.groupBox_3.setMinimumSize(QtCore.QSize(264, 0)) |
|
68 |
self.groupBox_3.setMaximumSize(QtCore.QSize(264, 16777215)) |
|
69 |
font = QtGui.QFont() |
|
70 |
font.setBold(False) |
|
71 |
font.setWeight(50) |
|
72 |
self.groupBox_3.setFont(font) |
|
73 |
self.groupBox_3.setObjectName("groupBox_3") |
|
74 |
self.gridLayout_6 = QtWidgets.QGridLayout(self.groupBox_3) |
|
75 |
self.gridLayout_6.setObjectName("gridLayout_6") |
|
76 |
self.label_2 = QtWidgets.QLabel(self.groupBox_3) |
|
77 |
self.label_2.setMinimumSize(QtCore.QSize(244, 0)) |
|
78 |
self.label_2.setMaximumSize(QtCore.QSize(244, 16777215)) |
|
79 |
self.label_2.setObjectName("label_2") |
|
80 |
self.gridLayout_6.addWidget(self.label_2, 0, 0, 1, 1) |
|
81 |
self.gridLayout_4.addWidget(self.groupBox_3, 0, 1, 1, 1) |
|
82 | 64 |
self.groupBox_6 = QtWidgets.QGroupBox(self.groupBox) |
83 | 65 |
font = QtGui.QFont() |
84 | 66 |
font.setBold(False) |
... | ... | |
216 | 198 |
self.verticalLayout.addLayout(self.horizontalLayout_2) |
217 | 199 |
self.gridLayout_8.addLayout(self.verticalLayout, 0, 0, 1, 1) |
218 | 200 |
self.gridLayout_4.addWidget(self.groupBox_6, 0, 3, 1, 1) |
201 |
self.groupBox_5 = QtWidgets.QGroupBox(self.groupBox) |
|
202 |
self.groupBox_5.setMinimumSize(QtCore.QSize(256, 0)) |
|
203 |
self.groupBox_5.setMaximumSize(QtCore.QSize(256, 16777215)) |
|
204 |
font = QtGui.QFont() |
|
205 |
font.setBold(False) |
|
206 |
font.setWeight(50) |
|
207 |
self.groupBox_5.setFont(font) |
|
208 |
self.groupBox_5.setObjectName("groupBox_5") |
|
209 |
self.label_3 = QtWidgets.QLabel(self.groupBox_5) |
|
210 |
self.label_3.setGeometry(QtCore.QRect(10, 25, 236, 271)) |
|
211 |
self.label_3.setObjectName("label_3") |
|
212 |
self.gridLayout_4.addWidget(self.groupBox_5, 0, 2, 1, 1) |
|
219 | 213 |
self.gridLayout.addWidget(self.groupBox, 1, 0, 1, 1) |
220 | 214 |
self.groupBox_2 = QtWidgets.QGroupBox(Dialog) |
221 | 215 |
font = QtGui.QFont() |
... | ... | |
254 | 248 |
_translate = QtCore.QCoreApplication.translate |
255 | 249 |
Dialog.setWindowTitle(_translate("Dialog", "Calculation Result")) |
256 | 250 |
self.groupBox.setTitle(_translate("Dialog", "Calculation Result - Regime")) |
257 |
self.groupBox_5.setTitle(_translate("Dialog", "Vertical Downward")) |
|
258 |
self.label_3.setText(_translate("Dialog", "<html><head/><body><p><img src=\":/images/PressureVariation_Vertical_Downward.png\"/></p></body></html>")) |
|
259 |
self.groupBox_4.setTitle(_translate("Dialog", "Horizontal")) |
|
260 |
self.label.setText(_translate("Dialog", "<html><head/><body><p><img src=\":/images/PressureVariation_Horizontal.png\"/></p></body></html>")) |
|
261 | 251 |
self.groupBox_3.setTitle(_translate("Dialog", "Vertical Upward")) |
262 | 252 |
self.label_2.setText(_translate("Dialog", "<html><head/><body><p><img src=\":/images/PressureVariation_Vertical_Upward.png\"/></p></body></html>")) |
253 |
self.groupBox_4.setTitle(_translate("Dialog", "Horizontal")) |
|
254 |
self.label.setText(_translate("Dialog", "<html><head/><body><p><img src=\":/images/PressureVariation_Horizontal.png\"/></p></body></html>")) |
|
263 | 255 |
self.groupBox_6.setTitle(_translate("Dialog", "Calculation Summary")) |
264 | 256 |
self.label_4.setText(_translate("Dialog", "Total Pressure Drop :")) |
265 | 257 |
self.label_Total_Pressure_Drop_Unit.setText(_translate("Dialog", "-")) |
... | ... | |
273 | 265 |
self.label_Valve_Loss_Unit.setText(_translate("Dialog", "-")) |
274 | 266 |
self.label_9.setText(_translate("Dialog", "Nozzle Loss :")) |
275 | 267 |
self.label_Nozzle_Loss_Unit.setText(_translate("Dialog", "-")) |
268 |
self.groupBox_5.setTitle(_translate("Dialog", "Vertical Downward")) |
|
269 |
self.label_3.setText(_translate("Dialog", "<html><head/><body><p><img src=\":/images/PressureVariation_Vertical_Downward.png\"/></p></body></html>")) |
|
276 | 270 |
self.groupBox_2.setTitle(_translate("Dialog", "Calculation Result - pressure drop")) |
277 | 271 |
import Resource_rc |
HYTOS/HYTOS/UI/PressureVariation.ui | ||
---|---|---|
55 | 55 |
<string>Calculation Result - Regime</string> |
56 | 56 |
</property> |
57 | 57 |
<layout class="QGridLayout" name="gridLayout_4"> |
58 |
<item row="0" column="2">
|
|
59 |
<widget class="QGroupBox" name="groupBox_5">
|
|
58 |
<item row="0" column="1">
|
|
59 |
<widget class="QGroupBox" name="groupBox_3">
|
|
60 | 60 |
<property name="minimumSize"> |
61 | 61 |
<size> |
62 |
<width>256</width>
|
|
62 |
<width>264</width>
|
|
63 | 63 |
<height>0</height> |
64 | 64 |
</size> |
65 | 65 |
</property> |
66 | 66 |
<property name="maximumSize"> |
67 | 67 |
<size> |
68 |
<width>256</width>
|
|
68 |
<width>264</width>
|
|
69 | 69 |
<height>16777215</height> |
70 | 70 |
</size> |
71 | 71 |
</property> |
... | ... | |
76 | 76 |
</font> |
77 | 77 |
</property> |
78 | 78 |
<property name="title"> |
79 |
<string>Vertical Downward</string>
|
|
79 |
<string>Vertical Upward</string>
|
|
80 | 80 |
</property> |
81 |
<layout class="QGridLayout" name="gridLayout_7"> |
|
82 |
<item row="0" column="0"> |
|
83 |
<widget class="QLabel" name="label_3"> |
|
84 |
<property name="text"> |
|
85 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Vertical_Downward.png"/></p></body></html></string> |
|
86 |
</property> |
|
87 |
</widget> |
|
88 |
</item> |
|
89 |
</layout> |
|
81 |
<widget class="QLabel" name="label_2"> |
|
82 |
<property name="geometry"> |
|
83 |
<rect> |
|
84 |
<x>10</x> |
|
85 |
<y>25</y> |
|
86 |
<width>244</width> |
|
87 |
<height>273</height> |
|
88 |
</rect> |
|
89 |
</property> |
|
90 |
<property name="minimumSize"> |
|
91 |
<size> |
|
92 |
<width>244</width> |
|
93 |
<height>0</height> |
|
94 |
</size> |
|
95 |
</property> |
|
96 |
<property name="maximumSize"> |
|
97 |
<size> |
|
98 |
<width>244</width> |
|
99 |
<height>16777215</height> |
|
100 |
</size> |
|
101 |
</property> |
|
102 |
<property name="text"> |
|
103 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Vertical_Upward.png"/></p></body></html></string> |
|
104 |
</property> |
|
105 |
</widget> |
|
90 | 106 |
</widget> |
91 | 107 |
</item> |
92 | 108 |
<item row="0" column="0"> |
... | ... | |
112 | 128 |
<property name="title"> |
113 | 129 |
<string>Horizontal</string> |
114 | 130 |
</property> |
115 |
<layout class="QGridLayout" name="gridLayout_5"> |
|
116 |
<item row="0" column="0"> |
|
117 |
<widget class="QLabel" name="label"> |
|
118 |
<property name="text"> |
|
119 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Horizontal.png"/></p></body></html></string> |
|
120 |
</property> |
|
121 |
</widget> |
|
122 |
</item> |
|
123 |
</layout> |
|
124 |
</widget> |
|
125 |
</item> |
|
126 |
<item row="0" column="1"> |
|
127 |
<widget class="QGroupBox" name="groupBox_3"> |
|
128 |
<property name="minimumSize"> |
|
129 |
<size> |
|
130 |
<width>264</width> |
|
131 |
<height>0</height> |
|
132 |
</size> |
|
133 |
</property> |
|
134 |
<property name="maximumSize"> |
|
135 |
<size> |
|
136 |
<width>264</width> |
|
137 |
<height>16777215</height> |
|
138 |
</size> |
|
139 |
</property> |
|
140 |
<property name="font"> |
|
141 |
<font> |
|
142 |
<weight>50</weight> |
|
143 |
<bold>false</bold> |
|
144 |
</font> |
|
145 |
</property> |
|
146 |
<property name="title"> |
|
147 |
<string>Vertical Upward</string> |
|
148 |
</property> |
|
149 |
<layout class="QGridLayout" name="gridLayout_6"> |
|
150 |
<item row="0" column="0"> |
|
151 |
<widget class="QLabel" name="label_2"> |
|
152 |
<property name="minimumSize"> |
|
153 |
<size> |
|
154 |
<width>244</width> |
|
155 |
<height>0</height> |
|
156 |
</size> |
|
157 |
</property> |
|
158 |
<property name="maximumSize"> |
|
159 |
<size> |
|
160 |
<width>244</width> |
|
161 |
<height>16777215</height> |
|
162 |
</size> |
|
163 |
</property> |
|
164 |
<property name="text"> |
|
165 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Vertical_Upward.png"/></p></body></html></string> |
|
166 |
</property> |
|
167 |
</widget> |
|
168 |
</item> |
|
169 |
</layout> |
|
131 |
<widget class="QLabel" name="label"> |
|
132 |
<property name="geometry"> |
|
133 |
<rect> |
|
134 |
<x>10</x> |
|
135 |
<y>25</y> |
|
136 |
<width>240</width> |
|
137 |
<height>277</height> |
|
138 |
</rect> |
|
139 |
</property> |
|
140 |
<property name="text"> |
|
141 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Horizontal.png"/></p></body></html></string> |
|
142 |
</property> |
|
143 |
</widget> |
|
170 | 144 |
</widget> |
171 | 145 |
</item> |
172 | 146 |
<item row="0" column="3"> |
... | ... | |
532 | 506 |
</layout> |
533 | 507 |
</widget> |
534 | 508 |
</item> |
509 |
<item row="0" column="2"> |
|
510 |
<widget class="QGroupBox" name="groupBox_5"> |
|
511 |
<property name="minimumSize"> |
|
512 |
<size> |
|
513 |
<width>256</width> |
|
514 |
<height>0</height> |
|
515 |
</size> |
|
516 |
</property> |
|
517 |
<property name="maximumSize"> |
|
518 |
<size> |
|
519 |
<width>256</width> |
|
520 |
<height>16777215</height> |
|
521 |
</size> |
|
522 |
</property> |
|
523 |
<property name="font"> |
|
524 |
<font> |
|
525 |
<weight>50</weight> |
|
526 |
<bold>false</bold> |
|
527 |
</font> |
|
528 |
</property> |
|
529 |
<property name="title"> |
|
530 |
<string>Vertical Downward</string> |
|
531 |
</property> |
|
532 |
<widget class="QLabel" name="label_3"> |
|
533 |
<property name="geometry"> |
|
534 |
<rect> |
|
535 |
<x>10</x> |
|
536 |
<y>25</y> |
|
537 |
<width>236</width> |
|
538 |
<height>271</height> |
|
539 |
</rect> |
|
540 |
</property> |
|
541 |
<property name="text"> |
|
542 |
<string><html><head/><body><p><img src=":/images/PressureVariation_Vertical_Downward.png"/></p></body></html></string> |
|
543 |
</property> |
|
544 |
</widget> |
|
545 |
</widget> |
|
546 |
</item> |
|
535 | 547 |
</layout> |
536 | 548 |
</widget> |
537 | 549 |
</item> |
내보내기 Unified diff