개정판 2737caa7
issue #1047 : set_table_widget_item_properties => set_item_properties
Change-Id: I16664e181108ddc3563587c84cae273bc821284c
HYTOS/HYTOS/CopyStreamData.py | ||
---|---|---|
16 | 16 |
import math |
17 | 17 |
|
18 | 18 |
|
19 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
19 |
def set_item_properties(name, alignment, color=None): |
|
20 | 20 |
if name is None: |
21 | 21 |
name = '' |
22 | 22 |
|
... | ... | |
60 | 60 |
def add_stream_data(self, name, value, unit): |
61 | 61 |
row = self.ui.tableWidget_StreamData.rowCount() |
62 | 62 |
self.ui.tableWidget_StreamData.setRowCount(row + 1) |
63 |
self.ui.tableWidget_StreamData.setItem(row, 0, set_table_widget_item_properties(name,
|
|
64 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
65 |
self.ui.tableWidget_StreamData.setItem(row, 1, set_table_widget_item_properties(value,
|
|
66 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
67 |
self.ui.tableWidget_StreamData.setItem(row, 2, set_table_widget_item_properties(unit,
|
|
68 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
63 |
self.ui.tableWidget_StreamData.setItem(row, 0, set_item_properties(name, |
|
64 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
65 |
self.ui.tableWidget_StreamData.setItem(row, 1, set_item_properties(value, |
|
66 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
67 |
self.ui.tableWidget_StreamData.setItem(row, 2, set_item_properties(unit, |
|
68 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
69 | 69 |
|
70 | 70 |
self.ui.tableWidget_StreamData.resizeRowsToContents() |
71 | 71 |
self.ui.tableWidget_StreamData.resizeColumnsToContents() |
... | ... | |
73 | 73 |
def add_stream_no(self, stream_no, components_uid): |
74 | 74 |
row = self.ui.tableWidget_StreamNo.rowCount() |
75 | 75 |
self.ui.tableWidget_StreamNo.setRowCount(row + 1) |
76 |
self.ui.tableWidget_StreamNo.setItem(row, 0, set_table_widget_item_properties(stream_no,
|
|
77 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
78 |
self.ui.tableWidget_StreamNo.setItem(row, 1, set_table_widget_item_properties(components_uid,
|
|
79 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
76 |
self.ui.tableWidget_StreamNo.setItem(row, 0, set_item_properties(stream_no, |
|
77 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
78 |
self.ui.tableWidget_StreamNo.setItem(row, 1, set_item_properties(components_uid, |
|
79 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
80 | 80 |
|
81 | 81 |
self.ui.tableWidget_StreamNo.resizeRowsToContents() |
82 | 82 |
self.ui.tableWidget_StreamNo.resizeColumnsToContents() |
... | ... | |
165 | 165 |
unit = self.convertToUnits(columnInfo[1]) |
166 | 166 |
|
167 | 167 |
self.ui.tableWidget_StreamData.setItem(rowIndex, 0, |
168 |
set_table_widget_item_properties(name,
|
|
169 |
QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter,
|
|
170 |
QColor(51, 153,
|
|
168 |
set_item_properties(name, |
|
169 |
QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter, |
|
170 |
QColor(51, 153, |
|
171 | 171 |
102))) # QColor(230, 230, 230))) |
172 | 172 |
|
173 | 173 |
self.ui.tableWidget_StreamData.setItem(rowIndex, 1, |
174 |
set_table_widget_item_properties(unit,
|
|
175 |
QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter,
|
|
176 |
QColor(204, 255,
|
|
174 |
set_item_properties(unit, |
|
175 |
QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter, |
|
176 |
QColor(204, 255, |
|
177 | 177 |
204))) # QColor(230, 230, 230))) |
178 | 178 |
|
179 | 179 |
rowIndex += 1 |
... | ... | |
228 | 228 |
drawing = app_doc_data.activeDrawing |
229 | 229 |
matches = [hmb for hmb in drawing.hmbTable._hmbs if hmb.components_uid == components_uid] |
230 | 230 |
if matches: |
231 |
self.ui.tableWidget_StreamData.setItem(0, 2, set_table_widget_item_properties(matches[0].uid,
|
|
232 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
233 |
self.ui.tableWidget_StreamData.setItem(1, 2, set_table_widget_item_properties(matches[0].components_uid,
|
|
234 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
235 |
self.ui.tableWidget_StreamData.setItem(2, 2, set_table_widget_item_properties(matches[0].stream_no,
|
|
236 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
237 |
self.ui.tableWidget_StreamData.setItem(3, 2, set_table_widget_item_properties(matches[0].phase_type,
|
|
238 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
239 |
self.ui.tableWidget_StreamData.setItem(4, 2, set_table_widget_item_properties(matches[0].flowrate_mass,
|
|
240 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
231 |
self.ui.tableWidget_StreamData.setItem(0, 2, set_item_properties(matches[0].uid, |
|
232 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
233 |
self.ui.tableWidget_StreamData.setItem(1, 2, set_item_properties(matches[0].components_uid, |
|
234 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
235 |
self.ui.tableWidget_StreamData.setItem(2, 2, set_item_properties(matches[0].stream_no, |
|
236 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
237 |
self.ui.tableWidget_StreamData.setItem(3, 2, set_item_properties(matches[0].phase_type, |
|
238 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
239 |
self.ui.tableWidget_StreamData.setItem(4, 2, set_item_properties(matches[0].flowrate_mass, |
|
240 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
241 | 241 |
self.ui.tableWidget_StreamData.setItem(5, 2, |
242 |
set_table_widget_item_properties(matches[0].flowrate_volume,
|
|
243 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
244 |
self.ui.tableWidget_StreamData.setItem(6, 2, set_table_widget_item_properties(matches[0].density,
|
|
245 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
246 |
self.ui.tableWidget_StreamData.setItem(7, 2, set_table_widget_item_properties(matches[0].viscosity,
|
|
247 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
248 |
self.ui.tableWidget_StreamData.setItem(8, 2, set_table_widget_item_properties(matches[0].temperature,
|
|
249 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
242 |
set_item_properties(matches[0].flowrate_volume, |
|
243 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
244 |
self.ui.tableWidget_StreamData.setItem(6, 2, set_item_properties(matches[0].density, |
|
245 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
246 |
self.ui.tableWidget_StreamData.setItem(7, 2, set_item_properties(matches[0].viscosity, |
|
247 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
248 |
self.ui.tableWidget_StreamData.setItem(8, 2, set_item_properties(matches[0].temperature, |
|
249 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
250 | 250 |
self.ui.tableWidget_StreamData.setItem(9, 2, |
251 |
set_table_widget_item_properties(matches[0].molecular_weight,
|
|
252 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
251 |
set_item_properties(matches[0].molecular_weight, |
|
252 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
253 | 253 |
self.ui.tableWidget_StreamData.setItem(10, 2, |
254 |
set_table_widget_item_properties(matches[0].specific_heat_ratio,
|
|
255 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
254 |
set_item_properties(matches[0].specific_heat_ratio, |
|
255 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
256 | 256 |
self.ui.tableWidget_StreamData.setItem(11, 2, |
257 |
set_table_widget_item_properties(matches[0].compress_factor,
|
|
258 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
257 |
set_item_properties(matches[0].compress_factor, |
|
258 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
259 | 259 |
self.ui.tableWidget_StreamData.setItem(12, 2, |
260 |
set_table_widget_item_properties(matches[0].nominal_pipe_size,
|
|
261 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
260 |
set_item_properties(matches[0].nominal_pipe_size, |
|
261 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
262 | 262 |
self.ui.tableWidget_StreamData.setItem(13, 2, |
263 |
set_table_widget_item_properties(matches[0].inside_pipe_size,
|
|
264 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
263 |
set_item_properties(matches[0].inside_pipe_size, |
|
264 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
265 | 265 |
self.ui.tableWidget_StreamData.setItem(14, 2, |
266 |
set_table_widget_item_properties(matches[0].schedule_no,
|
|
267 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
266 |
set_item_properties(matches[0].schedule_no, |
|
267 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
268 | 268 |
self.ui.tableWidget_StreamData.setItem(15, 2, |
269 |
set_table_widget_item_properties(matches[0].straight_length,
|
|
270 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
269 |
set_item_properties(matches[0].straight_length, |
|
270 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
271 | 271 |
self.ui.tableWidget_StreamData.setItem(16, 2, |
272 |
set_table_widget_item_properties(matches[0].equivalent_length,
|
|
273 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
272 |
set_item_properties(matches[0].equivalent_length, |
|
273 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
274 | 274 |
self.ui.tableWidget_StreamData.setItem(17, 2, |
275 |
set_table_widget_item_properties(
|
|
275 |
set_item_properties( |
|
276 | 276 |
matches[0].equivalent_length_input, |
277 | 277 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
278 | 278 |
self.ui.tableWidget_StreamData.setItem(18, 2, |
279 |
set_table_widget_item_properties(matches[0].fitting_length,
|
|
280 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
279 |
set_item_properties(matches[0].fitting_length, |
|
280 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
281 | 281 |
self.ui.tableWidget_StreamData.setItem(19, 2, |
282 |
set_table_widget_item_properties(matches[0].fitting_K,
|
|
283 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
282 |
set_item_properties(matches[0].fitting_K, |
|
283 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
284 | 284 |
self.ui.tableWidget_StreamData.setItem(20, 2, |
285 |
set_table_widget_item_properties(
|
|
285 |
set_item_properties( |
|
286 | 286 |
matches[0].equivalent_length_cal, |
287 | 287 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
288 | 288 |
self.ui.tableWidget_StreamData.setItem(21, 2, |
289 |
set_table_widget_item_properties(matches[0].roughness,
|
|
290 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
289 |
set_item_properties(matches[0].roughness, |
|
290 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
291 | 291 |
self.ui.tableWidget_StreamData.setItem(22, 2, |
292 |
set_table_widget_item_properties(matches[0].limitation_velocity,
|
|
293 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
292 |
set_item_properties(matches[0].limitation_velocity, |
|
293 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
294 | 294 |
self.ui.tableWidget_StreamData.setItem(23, 2, |
295 |
set_table_widget_item_properties(
|
|
295 |
set_item_properties( |
|
296 | 296 |
matches[0].limitation_pressure_drop, |
297 | 297 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
298 | 298 |
except Exception as ex: |
HYTOS/HYTOS/DiameterEstimation_Liquid.py | ||
---|---|---|
17 | 17 |
import math |
18 | 18 |
|
19 | 19 |
|
20 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
20 |
def set_item_properties(name, alignment, color=None): |
|
21 | 21 |
if name is None: |
22 | 22 |
name = '' |
23 | 23 |
|
... | ... | |
580 | 580 |
row = self.ui.tableWidget.rowCount() |
581 | 581 |
self.ui.tableWidget.setRowCount(row + 1) |
582 | 582 |
|
583 |
self.ui.tableWidget.setItem(row, 0, set_table_widget_item_properties(nd,
|
|
584 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
585 |
self.ui.tableWidget.setItem(row, 1, set_table_widget_item_properties(velocity,
|
|
586 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
587 |
self.ui.tableWidget.setItem(row, 2, set_table_widget_item_properties(pressure_drop,
|
|
588 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
589 |
self.ui.tableWidget.setItem(row, 3, set_table_widget_item_properties(reynolds,
|
|
590 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
591 |
self.ui.tableWidget.setItem(row, 4, set_table_widget_item_properties(friction,
|
|
592 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
583 |
self.ui.tableWidget.setItem(row, 0, set_item_properties(nd, |
|
584 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
585 |
self.ui.tableWidget.setItem(row, 1, set_item_properties(velocity, |
|
586 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
587 |
self.ui.tableWidget.setItem(row, 2, set_item_properties(pressure_drop, |
|
588 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
589 |
self.ui.tableWidget.setItem(row, 3, set_item_properties(reynolds, |
|
590 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
591 |
self.ui.tableWidget.setItem(row, 4, set_item_properties(friction, |
|
592 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
593 | 593 |
|
594 | 594 |
self.ui.tableWidget.resizeRowsToContents() |
595 | 595 |
self.ui.tableWidget.resizeColumnsToContents() |
HYTOS/HYTOS/DiameterEstimation_Vapor.py | ||
---|---|---|
17 | 17 |
import math |
18 | 18 |
|
19 | 19 |
|
20 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
20 |
def set_item_properties(name, alignment, color=None): |
|
21 | 21 |
if name is None: |
22 | 22 |
name = '' |
23 | 23 |
|
... | ... | |
875 | 875 |
row = self.ui.tableWidget.rowCount() |
876 | 876 |
self.ui.tableWidget.setRowCount(row + 1) |
877 | 877 |
|
878 |
self.ui.tableWidget.setItem(row, 0, set_table_widget_item_properties(nd,
|
|
879 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
880 |
self.ui.tableWidget.setItem(row, 1, set_table_widget_item_properties(velocity,
|
|
881 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
882 |
self.ui.tableWidget.setItem(row, 2, set_table_widget_item_properties(pressure_drop,
|
|
883 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
884 |
self.ui.tableWidget.setItem(row, 3, set_table_widget_item_properties(reynolds,
|
|
885 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
886 |
self.ui.tableWidget.setItem(row, 4, set_table_widget_item_properties(friction,
|
|
887 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
878 |
self.ui.tableWidget.setItem(row, 0, set_item_properties(nd, |
|
879 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
880 |
self.ui.tableWidget.setItem(row, 1, set_item_properties(velocity, |
|
881 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
882 |
self.ui.tableWidget.setItem(row, 2, set_item_properties(pressure_drop, |
|
883 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
884 |
self.ui.tableWidget.setItem(row, 3, set_item_properties(reynolds, |
|
885 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
886 |
self.ui.tableWidget.setItem(row, 4, set_item_properties(friction, |
|
887 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
888 | 888 |
|
889 | 889 |
self.ui.tableWidget.resizeRowsToContents() |
890 | 890 |
self.ui.tableWidget.resizeColumnsToContents() |
HYTOS/HYTOS/FittingsDialog.py | ||
---|---|---|
22 | 22 |
import math |
23 | 23 |
|
24 | 24 |
|
25 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
25 |
def set_item_properties(name, alignment, color=None): |
|
26 | 26 |
item = QTableWidgetItem(str(name)) |
27 | 27 |
item.setTextAlignment(alignment) |
28 | 28 |
if color: |
... | ... | |
1190 | 1190 |
|
1191 | 1191 |
def update_2_k_data(self, row, data, count): |
1192 | 1192 |
try: |
1193 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
|
|
1194 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1193 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 5, set_item_properties(count, |
|
1194 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1195 | 1195 |
|
1196 |
k = data[5] |
|
1197 |
|
|
1198 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k) |
|
1199 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(selected_fitting, |
|
1200 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1201 |
|
|
1202 |
# total_k = int(count) * float(k) |
|
1203 |
# self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(total_k, |
|
1204 |
# Qt.AlignRight | Qt.AlignVCenter)) |
|
1196 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * data[5]) |
|
1197 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_item_properties(selected_fitting, |
|
1198 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1205 | 1199 |
|
1206 | 1200 |
self.ui.tableWidget_2K_SelectedFitting.resizeRowsToContents() |
1207 | 1201 |
except Exception as ex: |
... | ... | |
1216 | 1210 |
try: |
1217 | 1211 |
name = self.ui.tableWidget_Equivalent_Length_SelectedFitting.item(row, 4).text() |
1218 | 1212 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 5, |
1219 |
set_table_widget_item_properties(count,
|
|
1220 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1213 |
set_item_properties(count, |
|
1214 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1221 | 1215 |
if angle: |
1222 | 1216 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 6, |
1223 |
set_table_widget_item_properties(angle,
|
|
1224 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1217 |
set_item_properties(angle, |
|
1218 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1225 | 1219 |
|
1226 | 1220 |
selected_fitting = '{} ({}˚) x {}'.format(name, angle, count) if angle else '{} x {}'.format(name, count) |
1227 | 1221 |
|
1228 | 1222 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 7, |
1229 |
set_table_widget_item_properties(
|
|
1223 |
set_item_properties( |
|
1230 | 1224 |
selected_fitting, |
1231 | 1225 |
Qt.AlignLeft | Qt.AlignVCenter)) |
1232 | 1226 |
|
... | ... | |
1241 | 1235 |
|
1242 | 1236 |
def update_crane_k_data(self, row, data, count, sub_size=None, angle=None): |
1243 | 1237 |
try: |
1244 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
|
|
1245 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1238 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 5, set_item_properties(count, |
|
1239 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1246 | 1240 |
if sub_size: |
1247 | 1241 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 7, |
1248 |
set_table_widget_item_properties(sub_size,
|
|
1249 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1242 |
set_item_properties(sub_size, |
|
1243 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1250 | 1244 |
if angle: |
1251 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(angle,
|
|
1252 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1245 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_item_properties(angle, |
|
1246 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1253 | 1247 |
|
1254 | 1248 |
k = self.get_crane_k_resistance_coefficient(data[4], data[5], sub_size, angle) |
1255 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_table_widget_item_properties(k,
|
|
1256 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1249 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_item_properties(k, |
|
1250 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1257 | 1251 |
|
1258 | 1252 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k) |
1259 | 1253 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, |
1260 |
set_table_widget_item_properties(selected_fitting,
|
|
1261 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1254 |
set_item_properties(selected_fitting, |
|
1255 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1262 | 1256 |
|
1263 | 1257 |
# total_k = int(count) * float(k) |
1264 | 1258 |
# self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, |
... | ... | |
1317 | 1311 |
# data[6] = image |
1318 | 1312 |
|
1319 | 1313 |
try: |
1320 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 0, set_table_widget_item_properties(data[0],
|
|
1321 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1322 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 1, set_table_widget_item_properties(data[1],
|
|
1323 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1324 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 2, set_table_widget_item_properties(data[2],
|
|
1325 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1326 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 3, set_table_widget_item_properties(data[3],
|
|
1327 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1328 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 4, set_table_widget_item_properties(data[4],
|
|
1329 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1330 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
|
|
1331 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1314 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 0, set_item_properties(data[0], |
|
1315 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1316 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 1, set_item_properties(data[1], |
|
1317 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1318 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 2, set_item_properties(data[2], |
|
1319 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1320 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 3, set_item_properties(data[3], |
|
1321 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1322 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 4, set_item_properties(data[4], |
|
1323 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1324 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 5, set_item_properties(count, |
|
1325 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1332 | 1326 |
k = data[5] |
1333 | 1327 |
|
1334 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 6, set_table_widget_item_properties(k,
|
|
1335 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1328 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 6, set_item_properties(k, |
|
1329 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1336 | 1330 |
|
1337 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 7, set_table_widget_item_properties(data[6],
|
|
1338 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1331 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 7, set_item_properties(data[6], |
|
1332 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1339 | 1333 |
|
1340 | 1334 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k) |
1341 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(selected_fitting,
|
|
1342 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1335 |
self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_item_properties(selected_fitting, |
|
1336 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1343 | 1337 |
|
1344 | 1338 |
# total_k = int(count) * k |
1345 | 1339 |
# self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(total_k, |
... | ... | |
1364 | 1358 |
|
1365 | 1359 |
try: |
1366 | 1360 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 0, |
1367 |
set_table_widget_item_properties(data[0],
|
|
1368 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1361 |
set_item_properties(data[0], |
|
1362 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1369 | 1363 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 1, |
1370 |
set_table_widget_item_properties(data[1],
|
|
1371 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1364 |
set_item_properties(data[1], |
|
1365 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1372 | 1366 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 2, |
1373 |
set_table_widget_item_properties(data[2],
|
|
1374 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1367 |
set_item_properties(data[2], |
|
1368 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1375 | 1369 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 3, |
1376 |
set_table_widget_item_properties(data[3],
|
|
1377 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1370 |
set_item_properties(data[3], |
|
1371 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1378 | 1372 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 4, |
1379 |
set_table_widget_item_properties(data[4],
|
|
1380 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1373 |
set_item_properties(data[4], |
|
1374 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1381 | 1375 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 5, |
1382 |
set_table_widget_item_properties(count,
|
|
1383 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1376 |
set_item_properties(count, |
|
1377 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1384 | 1378 |
if angle: |
1385 | 1379 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 6, |
1386 |
set_table_widget_item_properties(angle,
|
|
1387 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1380 |
set_item_properties(angle, |
|
1381 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1388 | 1382 |
|
1389 |
selected_fitting = '{} ({}˚) x {}'.format(data[4], angle, count) if angle else '{} x {}'.format(data[4], count) |
|
1383 |
selected_fitting = '{} ({}˚) x {}'.format(data[4], angle, count) if angle else '{} x {}'.format(data[4], |
|
1384 |
count) |
|
1390 | 1385 |
|
1391 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 7, set_table_widget_item_properties(
|
|
1386 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 7, set_item_properties( |
|
1392 | 1387 |
selected_fitting, |
1393 | 1388 |
Qt.AlignLeft | Qt.AlignVCenter)) |
1394 | 1389 |
|
... | ... | |
1410 | 1405 |
# data[5] = k |
1411 | 1406 |
# data[6] = image |
1412 | 1407 |
try: |
1413 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 0, set_table_widget_item_properties(data[0],
|
|
1414 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1415 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 1, set_table_widget_item_properties(data[1],
|
|
1416 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1417 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 2, set_table_widget_item_properties(data[2],
|
|
1418 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1419 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 3, set_table_widget_item_properties(data[3],
|
|
1420 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1421 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 4, set_table_widget_item_properties(data[4],
|
|
1422 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1423 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
|
|
1424 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1425 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 6, set_table_widget_item_properties(self.nps,
|
|
1426 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1408 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 0, set_item_properties(data[0], |
|
1409 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1410 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 1, set_item_properties(data[1], |
|
1411 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1412 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 2, set_item_properties(data[2], |
|
1413 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1414 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 3, set_item_properties(data[3], |
|
1415 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1416 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 4, set_item_properties(data[4], |
|
1417 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1418 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 5, set_item_properties(count, |
|
1419 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1420 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 6, set_item_properties(self.nps, |
|
1421 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1427 | 1422 |
if sub_size: |
1428 | 1423 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 7, |
1429 |
set_table_widget_item_properties(sub_size,
|
|
1430 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1424 |
set_item_properties(sub_size, |
|
1425 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1431 | 1426 |
if angle: |
1432 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(angle,
|
|
1433 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1427 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_item_properties(angle, |
|
1428 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1434 | 1429 |
k = self.get_crane_k_resistance_coefficient(data[4], data[5], sub_size, angle) |
1435 | 1430 |
|
1436 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_table_widget_item_properties(k,
|
|
1437 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1431 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_item_properties(k, |
|
1432 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1438 | 1433 |
|
1439 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10, set_table_widget_item_properties(data[6],
|
|
1440 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1434 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10, set_item_properties(data[6], |
|
1435 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1441 | 1436 |
|
1442 | 1437 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k) |
1443 | 1438 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, |
1444 |
set_table_widget_item_properties(selected_fitting,
|
|
1445 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1439 |
set_item_properties(selected_fitting, |
|
1440 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1446 | 1441 |
|
1447 | 1442 |
# total_k = int(count) * k |
1448 | 1443 |
# self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, |
... | ... | |
1547 | 1542 |
self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(8, QHeaderView.ResizeToContents) |
1548 | 1543 |
|
1549 | 1544 |
self.ui.tableWidget_2K_SelectedFitting.currentItemChanged.connect(self.fitting_2_k_item_selection_changed) |
1545 |
|
|
1550 | 1546 |
def initialize_equivalent_length_selected_fitting(self): |
1551 | 1547 |
|
1552 | 1548 |
self.ui.tableWidget_Equivalent_Length_SelectedFitting.setColumnCount(8) |
... | ... | |
1845 | 1841 |
def controls_2_k_set_names(self): |
1846 | 1842 |
from AppDocData import AppDocData |
1847 | 1843 |
|
1848 |
|
|
1849 | 1844 |
fittings = AppDocData.instance().get_fittings_by_method('2-K') |
1850 | 1845 |
for fitting in fittings: |
1851 | 1846 |
category = fitting[2] |
HYTOS/HYTOS/LineSizingCriteria.py | ||
---|---|---|
17 | 17 |
import math |
18 | 18 |
|
19 | 19 |
|
20 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
20 |
def set_item_properties(name, alignment, color=None): |
|
21 | 21 |
if name is None: |
22 | 22 |
name = '' |
23 | 23 |
|
... | ... | |
751 | 751 |
self.ui.tableWidget.setRowCount(row + 1) |
752 | 752 |
|
753 | 753 |
if separation: |
754 |
self.ui.tableWidget.setItem(row, 0, set_table_widget_item_properties(type,
|
|
755 |
Qt.AlignLeft | Qt.AlignVCenter,
|
|
756 |
QColor(153, 204, 255)))
|
|
757 |
self.ui.tableWidget.setItem(row, 1, set_table_widget_item_properties(velocity,
|
|
758 |
Qt.AlignHCenter | Qt.AlignVCenter,
|
|
759 |
QColor(153, 204, 255)))
|
|
760 |
self.ui.tableWidget.setItem(row, 2, set_table_widget_item_properties(dp_pressure,
|
|
761 |
Qt.AlignHCenter | Qt.AlignVCenter,
|
|
762 |
QColor(153, 204, 255)))
|
|
754 |
self.ui.tableWidget.setItem(row, 0, set_item_properties(type, |
|
755 |
Qt.AlignLeft | Qt.AlignVCenter, |
|
756 |
QColor(153, 204, 255))) |
|
757 |
self.ui.tableWidget.setItem(row, 1, set_item_properties(velocity, |
|
758 |
Qt.AlignHCenter | Qt.AlignVCenter, |
|
759 |
QColor(153, 204, 255))) |
|
760 |
self.ui.tableWidget.setItem(row, 2, set_item_properties(dp_pressure, |
|
761 |
Qt.AlignHCenter | Qt.AlignVCenter, |
|
762 |
QColor(153, 204, 255))) |
|
763 | 763 |
else: |
764 |
self.ui.tableWidget.setItem(row, 0, set_table_widget_item_properties(type,
|
|
765 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
766 |
self.ui.tableWidget.setItem(row, 1, set_table_widget_item_properties(velocity,
|
|
767 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
768 |
self.ui.tableWidget.setItem(row, 2, set_table_widget_item_properties(dp_pressure,
|
|
769 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
764 |
self.ui.tableWidget.setItem(row, 0, set_item_properties(type, |
|
765 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
766 |
self.ui.tableWidget.setItem(row, 1, set_item_properties(velocity, |
|
767 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
768 |
self.ui.tableWidget.setItem(row, 2, set_item_properties(dp_pressure, |
|
769 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
770 | 770 |
|
771 | 771 |
self.ui.tableWidget.resizeRowsToContents() |
772 | 772 |
self.ui.tableWidget.resizeColumnsToContents() |
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
36 | 36 |
import uuid |
37 | 37 |
|
38 | 38 |
|
39 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
39 |
def set_item_properties(name, alignment, color=None): |
|
40 | 40 |
if name is None: |
41 | 41 |
name = '' |
42 | 42 |
|
... | ... | |
377 | 377 |
name = columnInfo[0] |
378 | 378 |
unit = self.convertToUnits(columnInfo[1]) |
379 | 379 |
|
380 |
self.tableWidgetHMB.setItem(rowIndex, 0, |
|
381 |
set_table_widget_item_properties(name, Qt.AlignLeft | Qt.AlignVCenter, |
|
382 |
QColor(51, 153, |
|
383 |
102))) # QColor(230, 230, 230))) |
|
384 |
self.tableWidgetHMB.setItem(rowIndex, 1, |
|
385 |
set_table_widget_item_properties(unit, Qt.AlignHCenter | Qt.AlignVCenter, |
|
386 |
QColor(204, 255, |
|
387 |
204))) # QColor(230, 230, 230))) |
|
380 |
self.tableWidgetHMB.setItem(rowIndex, 0, set_item_properties(name, Qt.AlignLeft | Qt.AlignVCenter, |
|
381 |
QColor(51, 153, 102))) |
|
382 |
self.tableWidgetHMB.setItem(rowIndex, 1, set_item_properties(unit, Qt.AlignHCenter | Qt.AlignVCenter, |
|
383 |
QColor(204, 255, 204))) |
|
388 | 384 |
|
389 | 385 |
rowIndex += 1 |
390 | 386 |
|
... | ... | |
437 | 433 |
column = index.column() - columns[0] |
438 | 434 |
model.setData(model.index(index.row(), index.column()), arr[row][column]) |
439 | 435 |
|
440 |
|
|
441 | 436 |
''' |
442 | 437 |
@brief Drawing 속성의 Units 에서 Key값을 이용하여 Value를 찾음 |
443 | 438 |
@author yeonjin |
... | ... | |
1043 | 1038 |
if name == 'R_P' or name == 'L_P' or name == 'V_P': |
1044 | 1039 |
# Pump |
1045 | 1040 |
self.add_data(tag_no, None, None, True) |
1046 |
self.add_data('Suct.P :', round(attr['Suct.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1047 |
self.add_data('Disc.P :', round(attr['Disc.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1041 |
self.add_data('Suct.P :', round(attr['Suct.P'], 3), |
|
1042 |
'{}.g'.format(units['Pressure'])) |
|
1043 |
self.add_data('Disc.P :', round(attr['Disc.P'], 3), |
|
1044 |
'{}.g'.format(units['Pressure'])) |
|
1048 | 1045 |
self.add_data('Diff.P :', round(attr['Diff.P'], 3), units['Pressure']) |
1049 | 1046 |
self.add_data('Head :', round(attr['Head'], 3), units['Length']) |
1050 | 1047 |
self.add_data('NPSHa :', round(attr['NPSHa'], 3), units['Length']) |
... | ... | |
1053 | 1050 |
elif name == 'R_K' or name == 'L_K': |
1054 | 1051 |
# Compressor |
1055 | 1052 |
self.add_data(tag_no, None, None, True) |
1056 |
self.add_data('Suct.P :', round(attr['Suct.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1057 |
self.add_data('Disc.P :', round(attr['Disc.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1053 |
self.add_data('Suct.P :', round(attr['Suct.P'], 3), |
|
1054 |
'{}.g'.format(units['Pressure'])) |
|
1055 |
self.add_data('Disc.P :', round(attr['Disc.P'], 3), |
|
1056 |
'{}.g'.format(units['Pressure'])) |
|
1058 | 1057 |
self.add_data('Diff.P :', round(attr['Diff.P'], 3), units['Pressure']) |
1059 | 1058 |
self.add_data('HHP :', round(attr['HHP'], 3), units['Power']) |
1060 | 1059 |
elif name == 'CV_': |
1061 | 1060 |
# Control Valve |
1062 | 1061 |
self.add_data(tag_no, None, None, True) |
1063 |
self.add_data('Inlet P :', round(attr['Suct.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1064 |
self.add_data('Outlet P :', round(attr['Disc.P'], 3), '{}.g'.format(units['Pressure'])) |
|
1062 |
self.add_data('Inlet P :', round(attr['Suct.P'], 3), |
|
1063 |
'{}.g'.format(units['Pressure'])) |
|
1064 |
self.add_data('Outlet P :', round(attr['Disc.P'], 3), |
|
1065 |
'{}.g'.format(units['Pressure'])) |
|
1065 | 1066 |
self.add_data('Diff.P :', round(attr['Diff.P'], 3), units['Pressure']) |
1066 | 1067 |
self.add_data('dP Ratio :', round(attr['dP Ratio'], 3), '%') |
1067 | 1068 |
|
... | ... | |
1237 | 1238 |
unit = self.convertToUnits(columnInfo[1]) |
1238 | 1239 |
|
1239 | 1240 |
self.tableWidgetHMB.setItem(rowIndex, 0, |
1240 |
set_table_widget_item_properties(name, Qt.AlignLeft | Qt.AlignVCenter,
|
|
1241 |
QColor(51, 153,
|
|
1242 |
102)))
|
|
1241 |
set_item_properties(name, Qt.AlignLeft | Qt.AlignVCenter, |
|
1242 |
QColor(51, 153, |
|
1243 |
102))) |
|
1243 | 1244 |
# QColor(230, 230, 230))) |
1244 | 1245 |
self.tableWidgetHMB.setItem(rowIndex, 1, |
1245 |
set_table_widget_item_properties(unit, Qt.AlignHCenter | Qt.AlignVCenter,
|
|
1246 |
QColor(204, 255, 204)))
|
|
1246 |
set_item_properties(unit, Qt.AlignHCenter | Qt.AlignVCenter, |
|
1247 |
QColor(204, 255, 204))) |
|
1247 | 1248 |
# QColor(230, 230, 230))) |
1248 | 1249 |
|
1249 | 1250 |
rowIndex += 1 |
... | ... | |
1523 | 1524 |
self.tableWidgetHMB.setColumnCount(columnCount + 1) |
1524 | 1525 |
col_names.append(str(hmb.stream_no)) |
1525 | 1526 |
|
1526 |
self.tableWidgetHMB.setItem(0, columnCount, set_table_widget_item_properties(hmb.uid,
|
|
1527 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1528 |
self.tableWidgetHMB.setItem(1, columnCount, set_table_widget_item_properties(hmb.components_uid,
|
|
1529 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1530 |
self.tableWidgetHMB.setItem(2, columnCount, set_table_widget_item_properties(hmb.stream_no,
|
|
1531 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1532 |
self.tableWidgetHMB.setItem(3, columnCount, set_table_widget_item_properties(hmb.phase_type,
|
|
1533 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1534 |
self.tableWidgetHMB.setItem(4, columnCount, set_table_widget_item_properties(hmb.flowrate_mass,
|
|
1535 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1536 |
self.tableWidgetHMB.setItem(5, columnCount, set_table_widget_item_properties(hmb.flowrate_volume,
|
|
1537 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1538 |
self.tableWidgetHMB.setItem(6, columnCount, set_table_widget_item_properties(hmb.density,
|
|
1539 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1540 |
self.tableWidgetHMB.setItem(7, columnCount, set_table_widget_item_properties(hmb.viscosity,
|
|
1541 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1542 |
self.tableWidgetHMB.setItem(8, columnCount, set_table_widget_item_properties(hmb.temperature,
|
|
1543 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1544 |
self.tableWidgetHMB.setItem(9, columnCount, set_table_widget_item_properties(hmb.molecular_weight,
|
|
1545 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1546 |
self.tableWidgetHMB.setItem(10, columnCount, set_table_widget_item_properties(hmb.specific_heat_ratio,
|
|
1547 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1548 |
self.tableWidgetHMB.setItem(11, columnCount, set_table_widget_item_properties(hmb.compress_factor,
|
|
1549 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1550 |
self.tableWidgetHMB.setItem(12, columnCount, set_table_widget_item_properties(hmb.nominal_pipe_size,
|
|
1551 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1552 |
self.tableWidgetHMB.setItem(13, columnCount, set_table_widget_item_properties(hmb.inside_pipe_size,
|
|
1553 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1554 |
self.tableWidgetHMB.setItem(14, columnCount, set_table_widget_item_properties(hmb.schedule_no,
|
|
1555 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1556 |
self.tableWidgetHMB.setItem(15, columnCount, set_table_widget_item_properties(hmb.straight_length,
|
|
1557 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1558 |
self.tableWidgetHMB.setItem(16, columnCount, set_table_widget_item_properties(hmb.equivalent_length,
|
|
1559 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1527 |
self.tableWidgetHMB.setItem(0, columnCount, set_item_properties(hmb.uid, |
|
1528 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1529 |
self.tableWidgetHMB.setItem(1, columnCount, set_item_properties(hmb.components_uid, |
|
1530 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1531 |
self.tableWidgetHMB.setItem(2, columnCount, set_item_properties(hmb.stream_no, |
|
1532 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1533 |
self.tableWidgetHMB.setItem(3, columnCount, set_item_properties(hmb.phase_type, |
|
1534 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1535 |
self.tableWidgetHMB.setItem(4, columnCount, set_item_properties(hmb.flowrate_mass, |
|
1536 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1537 |
self.tableWidgetHMB.setItem(5, columnCount, set_item_properties(hmb.flowrate_volume, |
|
1538 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1539 |
self.tableWidgetHMB.setItem(6, columnCount, set_item_properties(hmb.density, |
|
1540 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1541 |
self.tableWidgetHMB.setItem(7, columnCount, set_item_properties(hmb.viscosity, |
|
1542 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1543 |
self.tableWidgetHMB.setItem(8, columnCount, set_item_properties(hmb.temperature, |
|
1544 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1545 |
self.tableWidgetHMB.setItem(9, columnCount, set_item_properties(hmb.molecular_weight, |
|
1546 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1547 |
self.tableWidgetHMB.setItem(10, columnCount, set_item_properties(hmb.specific_heat_ratio, |
|
1548 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1549 |
self.tableWidgetHMB.setItem(11, columnCount, set_item_properties(hmb.compress_factor, |
|
1550 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1551 |
self.tableWidgetHMB.setItem(12, columnCount, set_item_properties(hmb.nominal_pipe_size, |
|
1552 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1553 |
self.tableWidgetHMB.setItem(13, columnCount, set_item_properties(hmb.inside_pipe_size, |
|
1554 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1555 |
self.tableWidgetHMB.setItem(14, columnCount, set_item_properties(hmb.schedule_no, |
|
1556 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1557 |
self.tableWidgetHMB.setItem(15, columnCount, set_item_properties(hmb.straight_length, |
|
1558 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1559 |
self.tableWidgetHMB.setItem(16, columnCount, set_item_properties(hmb.equivalent_length, |
|
1560 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1560 | 1561 |
|
1561 | 1562 |
self.tableWidgetHMB.setItem(17, columnCount, |
1562 |
set_table_widget_item_properties(hmb.equivalent_length_input,
|
|
1563 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1564 |
self.tableWidgetHMB.setItem(18, columnCount, set_table_widget_item_properties(hmb.fitting_length,
|
|
1565 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1566 |
self.tableWidgetHMB.setItem(19, columnCount, set_table_widget_item_properties(hmb.fitting_K,
|
|
1567 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1563 |
set_item_properties(hmb.equivalent_length_input, |
|
1564 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1565 |
self.tableWidgetHMB.setItem(18, columnCount, set_item_properties(hmb.fitting_length, |
|
1566 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1567 |
self.tableWidgetHMB.setItem(19, columnCount, set_item_properties(hmb.fitting_K, |
|
1568 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1568 | 1569 |
self.tableWidgetHMB.setItem(20, columnCount, |
1569 |
set_table_widget_item_properties(hmb.equivalent_length_cal,
|
|
1570 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1571 |
self.tableWidgetHMB.setItem(21, columnCount, set_table_widget_item_properties(hmb.roughness,
|
|
1572 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1573 |
self.tableWidgetHMB.setItem(22, columnCount, set_table_widget_item_properties(hmb.limitation_velocity,
|
|
1574 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1570 |
set_item_properties(hmb.equivalent_length_cal, |
|
1571 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1572 |
self.tableWidgetHMB.setItem(21, columnCount, set_item_properties(hmb.roughness, |
|
1573 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1574 |
self.tableWidgetHMB.setItem(22, columnCount, set_item_properties(hmb.limitation_velocity, |
|
1575 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1575 | 1576 |
self.tableWidgetHMB.setItem(23, columnCount, |
1576 |
set_table_widget_item_properties(hmb.limitation_pressure_drop,
|
|
1577 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1578 |
|
|
1579 |
self.tableWidgetHMB.setItem(24, columnCount, set_table_widget_item_properties(None,
|
|
1580 |
Qt.AlignHCenter | Qt.AlignVCenter,
|
|
1581 |
QColor(153, 204, 255)))
|
|
1582 |
|
|
1583 |
self.tableWidgetHMB.setItem(25, columnCount, set_table_widget_item_properties(hmb.velocity,
|
|
1584 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1585 |
self.tableWidgetHMB.setItem(26, columnCount, set_table_widget_item_properties(hmb.reynolds,
|
|
1586 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1587 |
self.tableWidgetHMB.setItem(27, columnCount, set_table_widget_item_properties(hmb.friction_factor,
|
|
1588 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1589 |
self.tableWidgetHMB.setItem(28, columnCount, set_table_widget_item_properties(hmb.pressure_drop,
|
|
1590 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1577 |
set_item_properties(hmb.limitation_pressure_drop, |
|
1578 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1579 |
|
|
1580 |
self.tableWidgetHMB.setItem(24, columnCount, set_item_properties(None, |
|
1581 |
Qt.AlignHCenter | Qt.AlignVCenter, |
|
1582 |
QColor(153, 204, 255))) |
|
1583 |
|
|
1584 |
self.tableWidgetHMB.setItem(25, columnCount, set_item_properties(hmb.velocity, |
|
1585 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1586 |
self.tableWidgetHMB.setItem(26, columnCount, set_item_properties(hmb.reynolds, |
|
1587 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1588 |
self.tableWidgetHMB.setItem(27, columnCount, set_item_properties(hmb.friction_factor, |
|
1589 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1590 |
self.tableWidgetHMB.setItem(28, columnCount, set_item_properties(hmb.pressure_drop, |
|
1591 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1591 | 1592 |
self.tableWidgetHMB.setItem(29, columnCount, |
1592 |
set_table_widget_item_properties(hmb.pressure_drop_friction,
|
|
1593 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1594 |
self.tableWidgetHMB.setItem(30, columnCount, set_table_widget_item_properties(hmb.pressure_drop_static,
|
|
1595 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1593 |
set_item_properties(hmb.pressure_drop_friction, |
|
1594 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1595 |
self.tableWidgetHMB.setItem(30, columnCount, set_item_properties(hmb.pressure_drop_static, |
|
1596 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1596 | 1597 |
self.tableWidgetHMB.setItem(31, columnCount, |
1597 |
set_table_widget_item_properties(hmb.pressure_pipe_end_point,
|
|
1598 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1599 |
self.tableWidgetHMB.setItem(32, columnCount, set_table_widget_item_properties(hmb.power,
|
|
1600 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
1598 |
set_item_properties(hmb.pressure_pipe_end_point, |
|
1599 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1600 |
self.tableWidgetHMB.setItem(32, columnCount, set_item_properties(hmb.power, |
|
1601 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
1601 | 1602 |
|
1602 | 1603 |
if hmb.isDeleted: self.tableWidgetHMB.hideColumn(columnCount) |
1603 | 1604 |
|
... | ... | |
1833 | 1834 |
self.tableWidgetOutput.setRowCount(row + 1) |
1834 | 1835 |
|
1835 | 1836 |
if separation: |
1836 |
self.tableWidgetOutput.setItem(row, 0, set_table_widget_item_properties(name,
|
|
1837 |
Qt.AlignLeft | Qt.AlignVCenter,
|
|
1838 |
QColor(153, 204, 255)))
|
|
1839 |
self.tableWidgetOutput.setItem(row, 1, set_table_widget_item_properties(value,
|
|
1840 |
Qt.AlignHCenter | Qt.AlignVCenter,
|
|
1841 |
QColor(153, 204, 255)))
|
|
1842 |
self.tableWidgetOutput.setItem(row, 2, set_table_widget_item_properties(unit,
|
|
1843 |
Qt.AlignHCenter | Qt.AlignVCenter,
|
|
1844 |
QColor(153, 204, 255)))
|
|
1837 |
self.tableWidgetOutput.setItem(row, 0, set_item_properties(name, |
|
1838 |
Qt.AlignLeft | Qt.AlignVCenter, |
|
1839 |
QColor(153, 204, 255))) |
|
1840 |
self.tableWidgetOutput.setItem(row, 1, set_item_properties(value, |
|
1841 |
Qt.AlignHCenter | Qt.AlignVCenter, |
|
1842 |
QColor(153, 204, 255))) |
|
1843 |
self.tableWidgetOutput.setItem(row, 2, set_item_properties(unit, |
|
1844 |
Qt.AlignHCenter | Qt.AlignVCenter, |
|
1845 |
QColor(153, 204, 255))) |
|
1845 | 1846 |
else: |
1846 |
self.tableWidgetOutput.setItem(row, 0, set_table_widget_item_properties(name,
|
|
1847 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1848 |
self.tableWidgetOutput.setItem(row, 1, set_table_widget_item_properties(value,
|
|
1849 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1850 |
self.tableWidgetOutput.setItem(row, 2, set_table_widget_item_properties(unit,
|
|
1851 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1847 |
self.tableWidgetOutput.setItem(row, 0, set_item_properties(name, |
|
1848 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1849 |
self.tableWidgetOutput.setItem(row, 1, set_item_properties(value, |
|
1850 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1851 |
self.tableWidgetOutput.setItem(row, 2, set_item_properties(unit, |
|
1852 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1852 | 1853 |
|
1853 | 1854 |
self.tableWidgetOutput.resizeRowsToContents() |
1854 | 1855 |
self.tableWidgetOutput.resizeColumnsToContents() |
HYTOS/HYTOS/RoughnessDialog.py | ||
---|---|---|
13 | 13 |
import Roughness_UI |
14 | 14 |
|
15 | 15 |
|
16 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
16 |
def set_item_properties(name, alignment, color=None): |
|
17 | 17 |
if name is None: |
18 | 18 |
name = '' |
19 | 19 |
|
... | ... | |
105 | 105 |
row_count = self.ui.tableWidget_Roughness.rowCount() |
106 | 106 |
self.ui.tableWidget_Roughness.setRowCount(row_count + 1) |
107 | 107 |
|
108 |
self.ui.tableWidget_Roughness.setItem(row_count, 0, set_table_widget_item_properties(roughness[0],
|
|
109 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
110 |
self.ui.tableWidget_Roughness.setItem(row_count, 1, set_table_widget_item_properties(roughness[1],
|
|
111 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
112 |
self.ui.tableWidget_Roughness.setItem(row_count, 2, set_table_widget_item_properties(roughness[2],
|
|
113 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
114 |
self.ui.tableWidget_Roughness.setItem(row_count, 3, set_table_widget_item_properties(roughness[3],
|
|
115 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
116 |
self.ui.tableWidget_Roughness.setItem(row_count, 4, set_table_widget_item_properties(roughness[4],
|
|
117 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
118 |
self.ui.tableWidget_Roughness.setItem(row_count, 5, set_table_widget_item_properties(roughness[5],
|
|
119 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
120 |
self.ui.tableWidget_Roughness.setItem(row_count, 6, set_table_widget_item_properties(self.unit,
|
|
121 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
108 |
self.ui.tableWidget_Roughness.setItem(row_count, 0, set_item_properties(roughness[0], |
|
109 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
110 |
self.ui.tableWidget_Roughness.setItem(row_count, 1, set_item_properties(roughness[1], |
|
111 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
112 |
self.ui.tableWidget_Roughness.setItem(row_count, 2, set_item_properties(roughness[2], |
|
113 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
114 |
self.ui.tableWidget_Roughness.setItem(row_count, 3, set_item_properties(roughness[3], |
|
115 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
116 |
self.ui.tableWidget_Roughness.setItem(row_count, 4, set_item_properties(roughness[4], |
|
117 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
118 |
self.ui.tableWidget_Roughness.setItem(row_count, 5, set_item_properties(roughness[5], |
|
119 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
120 |
self.ui.tableWidget_Roughness.setItem(row_count, 6, set_item_properties(self.unit, |
|
121 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
122 | 122 |
self.ui.tableWidget_Roughness.resizeColumnsToContents() |
123 | 123 |
self.ui.tableWidget_Roughness.resizeRowsToContents() |
124 | 124 |
|
HYTOS/HYTOS/Roughness_HagenDialog.py | ||
---|---|---|
13 | 13 |
import Roughness_Hagen_UI |
14 | 14 |
|
15 | 15 |
|
16 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
16 |
def set_item_properties(name, alignment, color=None): |
|
17 | 17 |
if name is None: |
18 | 18 |
name = '' |
19 | 19 |
|
... | ... | |
77 | 77 |
row_count = self.ui.tableWidget_Roughness.rowCount() |
78 | 78 |
self.ui.tableWidget_Roughness.setRowCount(row_count + 1) |
79 | 79 |
|
80 |
self.ui.tableWidget_Roughness.setItem(row_count, 0, set_table_widget_item_properties(roughness,
|
|
81 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
80 |
self.ui.tableWidget_Roughness.setItem(row_count, 0, set_item_properties(roughness, |
|
81 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
82 | 82 |
self.ui.tableWidget_Roughness.setItem(row_count, 1, |
83 |
set_table_widget_item_properties(dic_roughness[roughness],
|
|
84 |
Qt.AlignHCenter | Qt.AlignVCenter))
|
|
83 |
set_item_properties(dic_roughness[roughness], |
|
84 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
|
85 | 85 |
|
86 | 86 |
self.ui.tableWidget_Roughness.resizeColumnsToContents() |
87 | 87 |
self.ui.tableWidget_Roughness.resizeRowsToContents() |
HYTOS/HYTOS/StreamDataDialog.py | ||
---|---|---|
17 | 17 |
import math |
18 | 18 |
|
19 | 19 |
|
20 |
def set_table_widget_item_properties(name, alignment, color=None):
|
|
20 |
def set_item_properties(name, alignment, color=None): |
|
21 | 21 |
item = QTableWidgetItem(str(name)) |
22 | 22 |
item.setTextAlignment(alignment) |
23 | 23 |
if color: |
... | ... | |
153 | 153 |
|
154 | 154 |
if isAccepted: |
155 | 155 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 0, |
156 |
set_table_widget_item_properties(element,
|
|
157 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
156 |
set_item_properties(element, |
|
157 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
158 | 158 |
|
159 | 159 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 1, |
160 |
set_table_widget_item_properties(nominal_pipe_size,
|
|
161 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
160 |
set_item_properties(nominal_pipe_size, |
|
161 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
162 | 162 |
|
163 | 163 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 2, |
164 |
set_table_widget_item_properties(schedule_no,
|
|
165 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
164 |
set_item_properties(schedule_no, |
|
165 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
166 | 166 |
|
167 | 167 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 3, |
168 |
set_table_widget_item_properties(inside_pipe_size,
|
|
169 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
168 |
set_item_properties(inside_pipe_size, |
|
169 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
170 | 170 |
|
171 | 171 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 4, |
172 |
set_table_widget_item_properties(roughness,
|
|
173 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
172 |
set_item_properties(roughness, |
|
173 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
174 | 174 |
|
175 | 175 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 5, |
176 |
set_table_widget_item_properties(length,
|
|
177 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
176 |
set_item_properties(length, |
|
177 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
178 | 178 |
|
179 | 179 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 6, |
180 |
set_table_widget_item_properties(angle,
|
|
181 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
180 |
set_item_properties(angle, |
|
181 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
182 | 182 |
|
183 | 183 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 7, |
184 |
set_table_widget_item_properties(rpd,
|
|
185 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
184 |
set_item_properties(rpd, |
|
185 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
186 | 186 |
|
187 | 187 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 8, |
188 |
set_table_widget_item_properties(d1_d2,
|
|
189 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
188 |
set_item_properties(d1_d2, |
|
189 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
190 | 190 |
|
191 | 191 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 9, |
192 |
set_table_widget_item_properties(k,
|
|
193 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
192 |
set_item_properties(k, |
|
193 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
194 | 194 |
|
195 | 195 |
self.ui.tableWidget_GeometryData_Mixed.resizeColumnsToContents() |
196 | 196 |
self.ui.tableWidget_GeometryData_Mixed.resizeRowsToContents() |
... | ... | |
220 | 220 |
|
221 | 221 |
if isAccepted: |
222 | 222 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 0, |
223 |
set_table_widget_item_properties(element,
|
|
224 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
223 |
set_item_properties(element, |
|
224 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
225 | 225 |
|
226 | 226 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 1, |
227 |
set_table_widget_item_properties(nominal_pipe_size,
|
|
228 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
227 |
set_item_properties(nominal_pipe_size, |
|
228 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
229 | 229 |
|
230 | 230 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 2, |
231 |
set_table_widget_item_properties(schedule_no,
|
|
232 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
231 |
set_item_properties(schedule_no, |
|
232 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
233 | 233 |
|
234 | 234 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 3, |
235 |
set_table_widget_item_properties(inside_pipe_size,
|
|
236 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
235 |
set_item_properties(inside_pipe_size, |
|
236 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
237 | 237 |
|
238 | 238 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 4, |
239 |
set_table_widget_item_properties(roughness,
|
|
240 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
239 |
set_item_properties(roughness, |
|
240 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
241 | 241 |
|
242 | 242 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 5, |
243 |
set_table_widget_item_properties(length,
|
|
244 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
243 |
set_item_properties(length, |
|
244 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
245 | 245 |
|
246 | 246 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 6, |
247 |
set_table_widget_item_properties(angle,
|
|
248 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
247 |
set_item_properties(angle, |
|
248 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
249 | 249 |
|
250 | 250 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 7, |
251 |
set_table_widget_item_properties(rpd,
|
|
252 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
251 |
set_item_properties(rpd, |
|
252 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
253 | 253 |
|
254 | 254 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 8, |
255 |
set_table_widget_item_properties(d1_d2,
|
|
256 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
255 |
set_item_properties(d1_d2, |
|
256 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
257 | 257 |
|
258 | 258 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row, 9, |
259 |
set_table_widget_item_properties(k,
|
|
260 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
259 |
set_item_properties(k, |
|
260 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
261 | 261 |
|
262 | 262 |
self.ui.tableWidget_GeometryData_Mixed.resizeColumnsToContents() |
263 | 263 |
self.ui.tableWidget_GeometryData_Mixed.resizeRowsToContents() |
... | ... | |
449 | 449 |
table.setRowCount(row_count + 1) |
450 | 450 |
|
451 | 451 |
table.setItem(row_count, 0, |
452 |
set_table_widget_item_properties(row[0], Qt.AlignHCenter | Qt.AlignVCenter)) # No
|
|
452 |
set_item_properties(row[0], Qt.AlignHCenter | Qt.AlignVCenter)) # No |
|
453 | 453 |
table.setItem(row_count, 1, |
454 |
set_table_widget_item_properties(row[1], Qt.AlignLeft | Qt.AlignVCenter)) # Element
|
|
454 |
set_item_properties(row[1], Qt.AlignLeft | Qt.AlignVCenter)) # Element |
|
455 | 455 |
table.setItem(row_count, 2, |
456 |
set_table_widget_item_properties(row[2], Qt.AlignRight | Qt.AlignVCenter)) # Inside Diameter
|
|
456 |
set_item_properties(row[2], Qt.AlignRight | Qt.AlignVCenter)) # Inside Diameter |
|
457 | 457 |
table.setItem(row_count, 3, |
458 |
set_table_widget_item_properties(row[3], Qt.AlignRight | Qt.AlignVCenter)) # Length
|
|
458 |
set_item_properties(row[3], Qt.AlignRight | Qt.AlignVCenter)) # Length |
|
459 | 459 |
table.setItem(row_count, 4, |
460 |
set_table_widget_item_properties(row[4], Qt.AlignRight | Qt.AlignVCenter)) # Angle
|
|
461 |
table.setItem(row_count, 5, set_table_widget_item_properties(row[5], Qt.AlignRight | Qt.AlignVCenter)) # K
|
|
460 |
set_item_properties(row[4], Qt.AlignRight | Qt.AlignVCenter)) # Angle |
|
461 |
table.setItem(row_count, 5, set_item_properties(row[5], Qt.AlignRight | Qt.AlignVCenter)) # K |
|
462 | 462 |
table.setItem(row_count, 6, |
463 |
set_table_widget_item_properties(row[6], Qt.AlignRight | Qt.AlignVCenter)) # Pressure
|
|
463 |
set_item_properties(row[6], Qt.AlignRight | Qt.AlignVCenter)) # Pressure |
|
464 | 464 |
table.setItem(row_count, 7, |
465 |
set_table_widget_item_properties(row[7], Qt.AlignRight | Qt.AlignVCenter)) # Void
|
|
465 |
set_item_properties(row[7], Qt.AlignRight | Qt.AlignVCenter)) # Void |
|
466 | 466 |
table.setItem(row_count, 8, |
467 |
set_table_widget_item_properties(row[8], Qt.AlignRight | Qt.AlignVCenter)) # Quality
|
|
467 |
set_item_properties(row[8], Qt.AlignRight | Qt.AlignVCenter)) # Quality |
|
468 | 468 |
table.setItem(row_count, 9, |
469 |
set_table_widget_item_properties(row[9], Qt.AlignRight | Qt.AlignVCenter)) # Density
|
|
469 |
set_item_properties(row[9], Qt.AlignRight | Qt.AlignVCenter)) # Density |
|
470 | 470 |
table.setItem(row_count, 10, |
471 |
set_table_widget_item_properties(row[10], Qt.AlignRight | Qt.AlignVCenter)) # V.Den
|
|
471 |
set_item_properties(row[10], Qt.AlignRight | Qt.AlignVCenter)) # V.Den |
|
472 | 472 |
table.setItem(row_count, 11, |
473 |
set_table_widget_item_properties(row[11], Qt.AlignRight | Qt.AlignVCenter)) # Mean Vel
|
|
473 |
set_item_properties(row[11], Qt.AlignRight | Qt.AlignVCenter)) # Mean Vel |
|
474 | 474 |
table.setItem(row_count, 12, |
475 |
set_table_widget_item_properties(row[12], Qt.AlignRight | Qt.AlignVCenter)) # Max Vel
|
|
475 |
set_item_properties(row[12], Qt.AlignRight | Qt.AlignVCenter)) # Max Vel |
|
476 | 476 |
table.setItem(row_count, 13, |
477 |
set_table_widget_item_properties(row[13], Qt.AlignRight | Qt.AlignVCenter)) # Ero Vel
|
|
477 |
set_item_properties(row[13], Qt.AlignRight | Qt.AlignVCenter)) # Ero Vel |
|
478 | 478 |
table.setItem(row_count, 14, |
479 |
set_table_widget_item_properties(row[14], Qt.AlignRight | Qt.AlignVCenter)) # X
|
|
479 |
set_item_properties(row[14], Qt.AlignRight | Qt.AlignVCenter)) # X |
|
480 | 480 |
table.setItem(row_count, 15, |
481 |
set_table_widget_item_properties(row[15], Qt.AlignRight | Qt.AlignVCenter)) # Y
|
|
481 |
set_item_properties(row[15], Qt.AlignRight | Qt.AlignVCenter)) # Y |
|
482 | 482 |
table.setItem(row_count, 16, |
483 |
set_table_widget_item_properties(row[16], Qt.AlignLeft | Qt.AlignVCenter)) # Regime
|
|
483 |
set_item_properties(row[16], Qt.AlignLeft | Qt.AlignVCenter)) # Regime |
|
484 | 484 |
table.setItem(row_count, 17, |
485 |
set_table_widget_item_properties(row[17], Qt.AlignRight | Qt.AlignVCenter)) # Friction
|
|
485 |
set_item_properties(row[17], Qt.AlignRight | Qt.AlignVCenter)) # Friction |
|
486 | 486 |
table.setItem(row_count, 18, |
487 |
set_table_widget_item_properties(row[18], Qt.AlignRight | Qt.AlignVCenter)) # Gravity
|
|
487 |
set_item_properties(row[18], Qt.AlignRight | Qt.AlignVCenter)) # Gravity |
|
488 | 488 |
table.setItem(row_count, 19, |
489 |
set_table_widget_item_properties(row[19], Qt.AlignRight | Qt.AlignVCenter)) # Momentum
|
|
489 |
set_item_properties(row[19], Qt.AlignRight | Qt.AlignVCenter)) # Momentum |
|
490 | 490 |
table.setItem(row_count, 20, |
491 |
set_table_widget_item_properties(row[20], Qt.AlignRight | Qt.AlignVCenter)) # Total
|
|
491 |
set_item_properties(row[20], Qt.AlignRight | Qt.AlignVCenter)) # Total |
|
492 | 492 |
|
493 | 493 |
table.resizeColumnsToContents() |
494 | 494 |
table.resizeRowsToContents() |
... | ... | |
570 | 570 |
if isAccepted: |
571 | 571 |
self.ui.tableWidget_GeometryData_Mixed.setRowCount(row_count + 1) |
572 | 572 |
|
573 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 0, set_table_widget_item_properties(element,
|
|
574 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
573 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 0, set_item_properties(element, |
|
574 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
575 | 575 |
|
576 | 576 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 1, |
577 |
set_table_widget_item_properties(nominal_pipe_size,
|
|
578 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
577 |
set_item_properties(nominal_pipe_size, |
|
578 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
579 | 579 |
|
580 | 580 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 2, |
581 |
set_table_widget_item_properties(schedule_no,
|
|
582 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
581 |
set_item_properties(schedule_no, |
|
582 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
583 | 583 |
|
584 | 584 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 3, |
585 |
set_table_widget_item_properties(inside_pipe_size,
|
|
586 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
585 |
set_item_properties(inside_pipe_size, |
|
586 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
587 | 587 |
|
588 | 588 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 4, |
589 |
set_table_widget_item_properties(roughness,
|
|
590 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
589 |
set_item_properties(roughness, |
|
590 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
591 | 591 |
|
592 | 592 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 5, |
593 |
set_table_widget_item_properties(length,
|
|
594 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
593 |
set_item_properties(length, |
|
594 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
595 | 595 |
|
596 | 596 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 6, |
597 |
set_table_widget_item_properties(angle,
|
|
598 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
597 |
set_item_properties(angle, |
|
598 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
599 | 599 |
|
600 | 600 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 7, |
601 |
set_table_widget_item_properties(rpd,
|
|
602 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
601 |
set_item_properties(rpd, |
|
602 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
603 | 603 |
|
604 | 604 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 8, |
605 |
set_table_widget_item_properties(d1_d2,
|
|
606 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
605 |
set_item_properties(d1_d2, |
|
606 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
607 | 607 |
|
608 | 608 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 9, |
609 |
set_table_widget_item_properties(k,
|
|
610 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
609 |
set_item_properties(k, |
|
610 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
611 | 611 |
|
612 | 612 |
self.ui.tableWidget_GeometryData_Mixed.resizeColumnsToContents() |
613 | 613 |
self.ui.tableWidget_GeometryData_Mixed.resizeRowsToContents() |
... | ... | |
1175 | 1175 |
self.ui.tableWidget_GeometryData_Mixed.setRowCount(row_count + 1) |
1176 | 1176 |
|
1177 | 1177 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 0, |
1178 |
set_table_widget_item_properties(row[0],
|
|
1179 |
Qt.AlignLeft | Qt.AlignVCenter))
|
|
1178 |
set_item_properties(row[0], |
|
1179 |
Qt.AlignLeft | Qt.AlignVCenter)) |
|
1180 | 1180 |
|
1181 | 1181 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 1, |
1182 |
set_table_widget_item_properties(row[1],
|
|
1183 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1182 |
set_item_properties(row[1], |
|
1183 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1184 | 1184 |
|
1185 | 1185 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 2, |
1186 |
set_table_widget_item_properties(row[2],
|
|
1187 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1186 |
set_item_properties(row[2], |
|
1187 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1188 | 1188 |
|
1189 | 1189 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 3, |
1190 |
set_table_widget_item_properties(row[3],
|
|
1191 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1190 |
set_item_properties(row[3], |
|
1191 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1192 | 1192 |
|
1193 | 1193 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 4, |
1194 |
set_table_widget_item_properties(row[4],
|
|
1195 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1194 |
set_item_properties(row[4], |
|
1195 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1196 | 1196 |
|
1197 | 1197 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 5, |
1198 |
set_table_widget_item_properties(row[5],
|
|
1199 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1198 |
set_item_properties(row[5], |
|
1199 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1200 | 1200 |
|
1201 | 1201 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 6, |
1202 |
set_table_widget_item_properties(row[6],
|
|
1203 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1202 |
set_item_properties(row[6], |
|
1203 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1204 | 1204 |
|
1205 | 1205 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 7, |
1206 |
set_table_widget_item_properties(row[7],
|
|
1207 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1206 |
set_item_properties(row[7], |
|
1207 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1208 | 1208 |
|
1209 | 1209 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 8, |
1210 |
set_table_widget_item_properties(row[8],
|
|
1211 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1210 |
set_item_properties(row[8], |
|
1211 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1212 | 1212 |
|
1213 | 1213 |
self.ui.tableWidget_GeometryData_Mixed.setItem(row_count, 9, |
1214 |
set_table_widget_item_properties(row[9],
|
|
1215 |
Qt.AlignRight | Qt.AlignVCenter))
|
|
1214 |
set_item_properties(row[9], |
|
1215 |
Qt.AlignRight | Qt.AlignVCenter)) |
|
1216 | 1216 |
|
1217 | 1217 |
self.ui.tableWidget_GeometryData_Mixed.resizeColumnsToContents() |
1218 | 1218 |
self.ui.tableWidget_GeometryData_Mixed.resizeRowsToContents() |
내보내기 Unified diff