개정판 611d6b1f
issue #1060 : 계산식
Change-Id: I7463225e1674eb4e23e81ffb292c17028425d5d4
HYTOS/HYTOS/Calculation.py | ||
---|---|---|
755 | 755 |
v_rey = tp_massflux * tp_quality * tp_id / v_visco |
756 | 756 |
|
757 | 757 |
roughness_unit = self.units['Roughness'] |
758 |
tp_rough = self.geometry.item(row, 4).text()
|
|
758 |
tp_rough = float(self.geometry.item(row, 4).text())
|
|
759 | 759 |
if roughness_unit == 'm': |
760 | 760 |
tp_rough = tp_rough |
761 | 761 |
elif roughness_unit == 'ft': |
... | ... | |
1232 | 1232 |
def decision_length(self, row): |
1233 | 1233 |
try: |
1234 | 1234 |
length_unit = self.units['Length'] |
1235 |
tp_length = self.geometry.item(row, 5).text()
|
|
1235 |
tp_length = float(self.geometry.item(row, 5).text())
|
|
1236 | 1236 |
if length_unit == 'm': |
1237 | 1237 |
tp_length = tp_length |
1238 | 1238 |
elif length_unit == 'in': |
... | ... | |
1287 | 1287 |
|
1288 | 1288 |
def tp_bend_cal(self, row): |
1289 | 1289 |
try: |
1290 |
tp_rperd = self.geometry.item(row, 7).text()
|
|
1290 |
tp_rperd = float(self.geometry.item(row, 7).text())
|
|
1291 | 1291 |
|
1292 | 1292 |
kval = self.geometry.item(row, 9).text() |
1293 | 1293 |
if is_not_blank(kval): |
1294 |
kval = kval
|
|
1294 |
kval = float(kval)
|
|
1295 | 1295 |
else: |
1296 | 1296 |
roughness_unit = self.units['Roughness'] |
1297 | 1297 |
tp_rough = float(self.geometry.item(row, 4).text()) |
... | ... | |
1377 | 1377 |
try: |
1378 | 1378 |
kval = self.geometry.item(row, 9).text() |
1379 | 1379 |
if is_not_blank(kval): |
1380 |
kval = kval
|
|
1380 |
kval = float(kval)
|
|
1381 | 1381 |
else: |
1382 | 1382 |
element = self.geometry.item(row, 0).text() |
1383 | 1383 |
if element == 'Nozzle In': |
... | ... | |
1498 | 1498 |
v_rey = tp_massflux * tp_quality * tp_id / v_visco |
1499 | 1499 |
|
1500 | 1500 |
roughness_unit = self.units['Roughness'] |
1501 |
tp_rough = self.geometry.item(row, 4).text()
|
|
1501 |
tp_rough = float(self.geometry.item(row, 4).text())
|
|
1502 | 1502 |
if roughness_unit == 'm': |
1503 | 1503 |
tp_rough = tp_rough |
1504 | 1504 |
elif roughness_unit == 'ft': |
... | ... | |
1618 | 1618 |
equivalent_length = 0 |
1619 | 1619 |
|
1620 | 1620 |
for row in range(self.geometry.rowCount()): |
1621 |
length = self.geometry.item(row, 5).text()
|
|
1621 |
length = float(self.geometry.item(row, 5).text())
|
|
1622 | 1622 |
if length: |
1623 | 1623 |
equivalent_length += float(length) |
1624 | 1624 |
|
... | ... | |
2271 | 2271 |
reynolds = ida * velocity * (density * 16.0185) / viscosity |
2272 | 2272 |
|
2273 | 2273 |
# 'MACH 넘버 자리이므로 미입력 처리 |
2274 |
self._hmb.reynolds = None
|
|
2274 |
self._hmb.reynolds = '-'
|
|
2275 | 2275 |
|
2276 | 2276 |
# ********** 4. Friction Factor 구하기 *********** |
2277 | 2277 |
# 'roughness 를 m로 바꿔줌 |
... | ... | |
2493 | 2493 |
reynolds = ida * velocity * (density * 16.0185) / viscosity |
2494 | 2494 |
|
2495 | 2495 |
# 'MACH 넘버 자리이므로 미입력 처리 |
2496 |
self._hmb.reynolds = None
|
|
2496 |
self._hmb.reynolds = '-'
|
|
2497 | 2497 |
|
2498 | 2498 |
# ''****************** 3. roughness 가져오기 ****************** ****************** |
2499 | 2499 |
rough = self._hmb.roughness # '무차원 상수이다 |
HYTOS/HYTOS/HMBTable.py | ||
---|---|---|
10 | 10 |
''' |
11 | 11 |
|
12 | 12 |
|
13 |
def isfloat(s): |
|
14 |
try: |
|
15 |
if s: |
|
16 |
float(s) |
|
17 |
return True |
|
18 |
else: |
|
19 |
return False |
|
20 |
except ValueError: |
|
21 |
return False |
|
22 |
|
|
23 |
|
|
13 | 24 |
class HMBData: |
14 | 25 |
def __init__(self, uid=None): |
15 | 26 |
self._uid = None |
... | ... | |
112 | 123 |
|
113 | 124 |
@property |
114 | 125 |
def flowrate_mass(self): |
115 |
return self._flowrate_mass |
|
126 |
return float(self._flowrate_mass) if isfloat(self._flowrate_mass) else self._flowrate_mass
|
|
116 | 127 |
|
117 | 128 |
@flowrate_mass.setter |
118 | 129 |
def flowrate_mass(self, value): |
... | ... | |
120 | 131 |
|
121 | 132 |
@property |
122 | 133 |
def flowrate_volume(self): |
123 |
return self._flowrate_volume |
|
134 |
return float(self._flowrate_volume) if isfloat(self._flowrate_volume) else self._flowrate_volume
|
|
124 | 135 |
|
125 | 136 |
@flowrate_volume.setter |
126 | 137 |
def flowrate_volume(self, value): |
... | ... | |
128 | 139 |
|
129 | 140 |
@property |
130 | 141 |
def density(self): |
131 |
return self._density |
|
142 |
return float(self._density) if isfloat(self._density) else self._density
|
|
132 | 143 |
|
133 | 144 |
@density.setter |
134 | 145 |
def density(self, value): |
... | ... | |
136 | 147 |
|
137 | 148 |
@property |
138 | 149 |
def viscosity(self): |
139 |
return self._viscosity |
|
150 |
return float(self._viscosity) if isfloat(self._viscosity) else self._viscosity
|
|
140 | 151 |
|
141 | 152 |
@viscosity.setter |
142 | 153 |
def viscosity(self, value): |
... | ... | |
144 | 155 |
|
145 | 156 |
@property |
146 | 157 |
def temperature(self): |
147 |
return self._temperature |
|
158 |
return float(self._temperature) if isfloat(self._temperature) else self._temperature
|
|
148 | 159 |
|
149 | 160 |
@temperature.setter |
150 | 161 |
def temperature(self, value): |
... | ... | |
152 | 163 |
|
153 | 164 |
@property |
154 | 165 |
def molecular_weight(self): |
155 |
return self._molecular_weight |
|
166 |
return float(self._molecular_weight) if isfloat(self._molecular_weight) else self._molecular_weight
|
|
156 | 167 |
|
157 | 168 |
@molecular_weight.setter |
158 | 169 |
def molecular_weight(self, value): |
... | ... | |
160 | 171 |
|
161 | 172 |
@property |
162 | 173 |
def specific_heat_ratio(self): |
163 |
return self._specific_heat_ratio |
|
174 |
return float(self._specific_heat_ratio) if isfloat(self._specific_heat_ratio) else self._specific_heat_ratio
|
|
164 | 175 |
|
165 | 176 |
@specific_heat_ratio.setter |
166 | 177 |
def specific_heat_ratio(self, value): |
... | ... | |
168 | 179 |
|
169 | 180 |
@property |
170 | 181 |
def compress_factor(self): |
171 |
return self._compress_factor |
|
182 |
return float(self._compress_factor) if isfloat(self._compress_factor) else self._compress_factor
|
|
172 | 183 |
|
173 | 184 |
@compress_factor.setter |
174 | 185 |
def compress_factor(self, value): |
... | ... | |
176 | 187 |
|
177 | 188 |
@property |
178 | 189 |
def nominal_pipe_size(self): |
179 |
return self._nominal_pipe_size |
|
190 |
return float(self._nominal_pipe_size) if isfloat(self._nominal_pipe_size) else self._nominal_pipe_size
|
|
180 | 191 |
|
181 | 192 |
@nominal_pipe_size.setter |
182 | 193 |
def nominal_pipe_size(self, value): |
... | ... | |
184 | 195 |
|
185 | 196 |
@property |
186 | 197 |
def inside_pipe_size(self): |
187 |
return self._inside_pipe_size |
|
198 |
return float(self._inside_pipe_size) if isfloat(self._inside_pipe_size) else self._inside_pipe_size
|
|
188 | 199 |
|
189 | 200 |
@inside_pipe_size.setter |
190 | 201 |
def inside_pipe_size(self, value): |
... | ... | |
192 | 203 |
|
193 | 204 |
@property |
194 | 205 |
def schedule_no(self): |
195 |
return self._schedule_no |
|
206 |
return float(self._schedule_no) if isfloat(self._schedule_no) else self._schedule_no
|
|
196 | 207 |
|
197 | 208 |
@schedule_no.setter |
198 | 209 |
def schedule_no(self, value): |
... | ... | |
201 | 212 |
|
202 | 213 |
@property |
203 | 214 |
def straight_length(self): |
204 |
return self._straight_length |
|
215 |
return float(self._straight_length) if isfloat(self._straight_length) else self._straight_length
|
|
205 | 216 |
|
206 | 217 |
@straight_length.setter |
207 | 218 |
def straight_length(self, value): |
... | ... | |
209 | 220 |
|
210 | 221 |
@property |
211 | 222 |
def equivalent_length(self): |
212 |
return self._equivalent_length |
|
223 |
return float(self._equivalent_length) if isfloat(self._equivalent_length) else self._equivalent_length
|
|
213 | 224 |
|
214 | 225 |
@equivalent_length.setter |
215 | 226 |
def equivalent_length(self, value): |
... | ... | |
217 | 228 |
|
218 | 229 |
@property |
219 | 230 |
def equivalent_length_input(self): |
220 |
return self._equivalent_length_input |
|
231 |
return float(self._equivalent_length_input) if isfloat(self._equivalent_length_input) else self._equivalent_length_input
|
|
221 | 232 |
|
222 | 233 |
@equivalent_length_input.setter |
223 | 234 |
def equivalent_length_input(self, value): |
... | ... | |
225 | 236 |
|
226 | 237 |
@property |
227 | 238 |
def fitting_length(self): |
228 |
return self._fitting_length |
|
239 |
return float(self._fitting_length) if isfloat(self._fitting_length) else self._fitting_length
|
|
229 | 240 |
|
230 | 241 |
@fitting_length.setter |
231 | 242 |
def fitting_length(self, value): |
... | ... | |
233 | 244 |
|
234 | 245 |
@property |
235 | 246 |
def fitting_K(self): |
236 |
return self._fitting_K |
|
247 |
return float(self._fitting_K) if isfloat(self._fitting_K) else self._fitting_K
|
|
237 | 248 |
|
238 | 249 |
@fitting_K.setter |
239 | 250 |
def fitting_K(self, value): |
... | ... | |
241 | 252 |
|
242 | 253 |
@property |
243 | 254 |
def equivalent_length_cal(self): |
244 |
return self._equivalent_length_cal |
|
255 |
return float(self._equivalent_length_cal) if isfloat(self._equivalent_length_cal) else self._equivalent_length_cal
|
|
245 | 256 |
|
246 | 257 |
@equivalent_length_cal.setter |
247 | 258 |
def equivalent_length_cal(self, value): |
... | ... | |
249 | 260 |
|
250 | 261 |
@property |
251 | 262 |
def roughness(self): |
252 |
return self._roughness |
|
263 |
return float(self._roughness) if isfloat(self._roughness) else self._roughness
|
|
253 | 264 |
|
254 | 265 |
@roughness.setter |
255 | 266 |
def roughness(self, value): |
... | ... | |
257 | 268 |
|
258 | 269 |
@property |
259 | 270 |
def limitation_velocity(self): |
260 |
return self._limitation_velocity |
|
271 |
return float(self._limitation_velocity) if isfloat(self._limitation_velocity) else self._limitation_velocity
|
|
261 | 272 |
|
262 | 273 |
@limitation_velocity.setter |
263 | 274 |
def limitation_velocity(self, value): |
... | ... | |
265 | 276 |
|
266 | 277 |
@property |
267 | 278 |
def limitation_pressure_drop(self): |
268 |
return self._limitation_pressure_drop |
|
279 |
return float(self._limitation_pressure_drop) if isfloat(self._limitation_pressure_drop) else self._limitation_pressure_drop
|
|
269 | 280 |
|
270 | 281 |
@limitation_pressure_drop.setter |
271 | 282 |
def limitation_pressure_drop(self, value): |
... | ... | |
273 | 284 |
|
274 | 285 |
@property |
275 | 286 |
def velocity(self): |
276 |
return self._velocity |
|
287 |
return float(self._velocity) if isfloat(self._velocity) else self._velocity
|
|
277 | 288 |
|
278 | 289 |
@velocity.setter |
279 | 290 |
def velocity(self, value): |
... | ... | |
281 | 292 |
|
282 | 293 |
@property |
283 | 294 |
def reynolds(self): |
284 |
return self._reynolds |
|
295 |
return float(self._reynolds) if isfloat(self._reynolds) else self._reynolds
|
|
285 | 296 |
|
286 | 297 |
@reynolds.setter |
287 | 298 |
def reynolds(self, value): |
... | ... | |
289 | 300 |
|
290 | 301 |
@property |
291 | 302 |
def friction_factor(self): |
292 |
return self._friction_factor |
|
303 |
return float(self._friction_factor) if isfloat(self._friction_factor) else self._friction_factor
|
|
293 | 304 |
|
294 | 305 |
@friction_factor.setter |
295 | 306 |
def friction_factor(self, value): |
... | ... | |
297 | 308 |
|
298 | 309 |
@property |
299 | 310 |
def pressure_drop(self): |
300 |
return self._pressure_drop |
|
311 |
return float(self._pressure_drop) if isfloat(self._pressure_drop) else self._pressure_drop
|
|
301 | 312 |
|
302 | 313 |
@pressure_drop.setter |
303 | 314 |
def pressure_drop(self, value): |
... | ... | |
305 | 316 |
|
306 | 317 |
@property |
307 | 318 |
def pressure_drop_friction(self): |
308 |
return self._pressure_drop_friction |
|
319 |
return float(self._pressure_drop_friction) if isfloat(self._pressure_drop_friction) else self._pressure_drop_friction
|
|
309 | 320 |
|
310 | 321 |
@pressure_drop_friction.setter |
311 | 322 |
def pressure_drop_friction(self, value): |
... | ... | |
313 | 324 |
|
314 | 325 |
@property |
315 | 326 |
def pressure_drop_static(self): |
316 |
return self._pressure_drop_static |
|
327 |
return float(self._pressure_drop_static) if isfloat(self._pressure_drop_static) else self._pressure_drop_static
|
|
317 | 328 |
|
318 | 329 |
@pressure_drop_static.setter |
319 | 330 |
def pressure_drop_static(self, value): |
... | ... | |
321 | 332 |
|
322 | 333 |
@property |
323 | 334 |
def pressure_pipe_end_point(self): |
324 |
return self._pressure_pipe_end_point |
|
335 |
return float(self._pressure_pipe_end_point) if isfloat(self._pressure_pipe_end_point) else self._pressure_pipe_end_point
|
|
325 | 336 |
|
326 | 337 |
@pressure_pipe_end_point.setter |
327 | 338 |
def pressure_pipe_end_point(self, value): |
... | ... | |
329 | 340 |
|
330 | 341 |
@property |
331 | 342 |
def power(self): |
332 |
return self._power |
|
343 |
return float(self._power) if isfloat(self._power) else self._power
|
|
333 | 344 |
|
334 | 345 |
@power.setter |
335 | 346 |
def power(self, value): |
HYTOS/HYTOS/Shapes/EngineeringLoopItem.py | ||
---|---|---|
130 | 130 |
res = self.hole_p_cal(i) |
131 | 131 |
if res == 0: |
132 | 132 |
break |
133 |
elif self.items[i].phase_type == 'Vapor': |
|
133 |
elif self.items[i].data.phase_type == 'Vapor':
|
|
134 | 134 |
self.discharge_vapor_factor_length(i) |
135 | 135 |
res = self.hole_p_cal(i) |
136 | 136 |
if res == 0: |
HYTOS/HYTOS/Shapes/EngineeringStreamlineItem.py | ||
---|---|---|
816 | 816 |
res.append((sql, tuple(param))) |
817 | 817 |
index += 1 |
818 | 818 |
# save fittings to database |
819 |
for method in self.fittings: |
|
820 |
cols = ['UID', 'Components_UID', 'Fittings_UID', 'Method', 'Sub_Size', 'Angle', 'Count'] |
|
821 |
values = ['?', '?', '?', '?', '?', '?', '?'] |
|
819 |
if self.fittings: |
|
820 |
for method in self.fittings: |
|
821 |
cols = ['UID', 'Components_UID', 'Fittings_UID', 'Method', 'Sub_Size', 'Angle', 'Count'] |
|
822 |
values = ['?', '?', '?', '?', '?', '?', '?'] |
|
822 | 823 |
|
823 |
for fitting in self.fittings[method]: |
|
824 |
param = [str(uuid.uuid4()), str(uid), fitting.uid, method, fitting.sub_size, fitting.angle, fitting.count] |
|
824 |
for fitting in self.fittings[method]:
|
|
825 |
param = [str(uuid.uuid4()), str(uid), fitting.uid, method, fitting.sub_size, fitting.angle, fitting.count]
|
|
825 | 826 |
|
826 |
sql = 'insert or replace into Fittings_Input({}) values({})'.format(','.join(cols), ','.join(values)) |
|
827 |
res.append((sql, tuple(param))) |
|
827 |
sql = 'insert or replace into Fittings_Input({}) values({})'.format(','.join(cols), ','.join(values))
|
|
828 |
res.append((sql, tuple(param)))
|
|
828 | 829 |
except Exception as ex: |
829 | 830 |
from App import App |
830 | 831 |
from AppDocData import MessageType |
HYTOS/HYTOS/Valve_Control_UI.py | ||
---|---|---|
93 | 93 |
self.lineEdit_Overdesign = QtWidgets.QLineEdit(self.groupBox) |
94 | 94 |
self.lineEdit_Overdesign.setGeometry(QtCore.QRect(262, 123, 100, 21)) |
95 | 95 |
self.lineEdit_Overdesign.setMaximumSize(QtCore.QSize(100, 16777215)) |
96 |
font = QtGui.QFont() |
|
97 |
font.setBold(False) |
|
98 |
font.setWeight(50) |
|
99 |
self.lineEdit_Overdesign.setFont(font) |
|
96 | 100 |
self.lineEdit_Overdesign.setAlignment(QtCore.Qt.AlignCenter) |
97 | 101 |
self.lineEdit_Overdesign.setObjectName("lineEdit_Overdesign") |
98 | 102 |
self.label_OverdesignUnit = QtWidgets.QLabel(self.groupBox) |
... | ... | |
195 | 199 |
self.label_5.setText(_translate("Valve_ControlDialog", "Elevation")) |
196 | 200 |
self.label_ElevationUnit.setText(_translate("Valve_ControlDialog", "-")) |
197 | 201 |
self.label_8.setText(_translate("Valve_ControlDialog", "Overdesign")) |
202 |
self.lineEdit_Overdesign.setText(_translate("Valve_ControlDialog", "0")) |
|
198 | 203 |
self.label_OverdesignUnit.setText(_translate("Valve_ControlDialog", "%")) |
199 | 204 |
self.label.setText(_translate("Valve_ControlDialog", "Tag No.")) |
200 | 205 |
self.label_9.setText(_translate("Valve_ControlDialog", "Type (for Aramco-BP)")) |
내보내기 Unified diff