개정판 ebc7f56e
- issue #1208 Fitting Crane K값 소수 2째자리까지만 표시 : format(value, ".2f")
Change-Id: Ib5eb83487fe9067e7448bd271c56758e58982cb7
HYTOS/HYTOS/FittingsDialog.py | ||
---|---|---|
1267 | 1267 |
|
1268 | 1268 |
self.ui.tableWidget_CraneK_SelectedFitting.item(row, 5) |
1269 | 1269 |
|
1270 |
value = None |
|
1271 |
if self.ui.tableWidget_CraneK_SelectedFitting.item(row, 9).text(): |
|
1272 |
value = float(self.ui.tableWidget_CraneK_SelectedFitting.item(row, 9).text()) |
|
1273 |
else: |
|
1274 |
value = data[5] |
|
1275 |
|
|
1276 |
k = self.get_crane_k_resistance_coefficient(data[4], value, sub_size, angle) |
|
1277 |
self.ui.tableWidget_CraneK_SelectedFitting.item(row, 9).setText(str(k)) |
|
1270 |
k = self.get_crane_k_resistance_coefficient(data[4], data[5], sub_size, angle) |
|
1271 |
cell = set_item_properties(format(k, ".2f"), Qt.AlignRight | Qt.AlignVCenter) |
|
1272 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, cell) |
|
1278 | 1273 |
|
1279 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k) |
|
1280 |
self.ui.tableWidget_CraneK_SelectedFitting.item(row, 11).setText(selected_fitting) |
|
1274 |
selected_fitting = '{} x {} = {}'.format(data[4], count, format(int(count) * k, ".2f")) |
|
1275 |
cell = set_item_properties(selected_fitting, Qt.AlignLeft | Qt.AlignVCenter) |
|
1276 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, cell) |
|
1281 | 1277 |
|
1282 | 1278 |
self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents() |
1283 | 1279 |
except Exception as ex: |
... | ... | |
1447 | 1443 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_item_properties(angle, |
1448 | 1444 |
Qt.AlignHCenter | Qt.AlignVCenter)) |
1449 | 1445 |
k = self.get_crane_k_resistance_coefficient(data[4], data[5], sub_size, angle) |
1450 |
cell = set_item_properties(k, Qt.AlignRight | Qt.AlignVCenter)
|
|
1446 |
cell = set_item_properties(format(k, ".2f"), Qt.AlignRight | Qt.AlignVCenter)
|
|
1451 | 1447 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, cell) |
1452 | 1448 |
|
1453 | 1449 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10, set_item_properties(data[6], |
1454 | 1450 |
Qt.AlignLeft | Qt.AlignVCenter)) |
1455 | 1451 |
|
1456 |
selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k)
|
|
1452 |
selected_fitting = '{} x {} = {}'.format(data[4], count, format(int(count) * k, ".2f"))
|
|
1457 | 1453 |
cell = set_item_properties(selected_fitting, Qt.AlignLeft | Qt.AlignVCenter) |
1458 | 1454 |
self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11, cell) |
1459 | 1455 |
|
내보내기 Unified diff