개정판 3d3b8bf0
issue #1263: unit 변경 시 값은 변경되나 단위 label이 바뀌지 않는 현상 수정
Change-Id: Ic77e3c85290b3e4f795bff5af73fd3799dc2de98
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
2525 | 2525 |
self.update_label_contents() |
2526 | 2526 |
self.change_output_font_color() |
2527 | 2527 |
except Exception as ex: |
2528 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
|
|
2529 |
sys.exc_info()[-1].tb_lineno)
|
|
2528 |
message = f'error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:' \
|
|
2529 |
f'{sys.exc_info()[-1].tb_lineno}'
|
|
2530 | 2530 |
self.addMessage.emit(MessageType.Error, message) |
2531 | 2531 |
|
2532 | 2532 |
def showImageSelectionMessageBox(self): |
... | ... | |
2596 | 2596 |
drawing = app_doc_data.activeDrawing |
2597 | 2597 |
|
2598 | 2598 |
self.setAttributes(drawing) |
2599 |
model = self.tableWidgetHMB.model() |
|
2599 | 2600 |
|
2600 |
columnInfos = app_doc_data.getHMBDisplayNameAndUnitsExpression() |
|
2601 |
|
|
2602 |
rowIndex = 0 |
|
2603 |
for row in range(columnInfos.rowCount()): |
|
2604 |
name = columnInfos.item(row, 0).text() |
|
2605 |
unit = self.convertToUnits(columnInfos.item(row, 1).text()) |
|
2606 |
|
|
2607 |
self.tableWidgetHMB.setItem(rowIndex, 0, |
|
2608 |
set_item_properties(name, Qt.AlignLeft | Qt.AlignVCenter, |
|
2609 |
QColor(51, 153, 102))) |
|
2610 |
# QColor(230, 230, 230))) |
|
2611 |
self.tableWidgetHMB.setItem(rowIndex, 1, |
|
2612 |
set_item_properties(unit, Qt.AlignHCenter | Qt.AlignVCenter, |
|
2613 |
QColor(204, 255, 204))) |
|
2614 |
# QColor(230, 230, 230))) |
|
2601 |
units = app_doc_data.getHMBDisplayNameAndUnitsExpression() ## load unit information from database |
|
2602 |
for row in range(units.rowCount()): |
|
2603 |
name = units.item(row, 0).text() |
|
2604 |
unit = self.convertToUnits(units.item(row, 1).text()) |
|
2615 | 2605 |
|
2616 |
rowIndex += 1 |
|
2606 |
item = model.item(row, 1) |
|
2607 |
item.setText(unit) |
|
2617 | 2608 |
|
2618 | 2609 |
self.tableWidgetHMB.resizeColumnsToContents() |
2619 | 2610 |
self.tableWidgetHMB.resizeRowsToContents() |
... | ... | |
2895 | 2886 |
self.tableWidgetHMB.setColumnCount(0) |
2896 | 2887 |
|
2897 | 2888 |
def load_HMB(self) -> None: |
2898 |
""" |
|
2899 |
display hmb data to table widget |
|
2900 |
@return: |
|
2901 |
""" |
|
2889 |
""" display hmb data to table widget """ |
|
2902 | 2890 |
from CalculationValidation import QCalculationValidation |
2903 | 2891 |
|
2904 | 2892 |
drawing = AppDocData.instance().activeDrawing |
... | ... | |
2909 | 2897 |
if hmbs is not None: |
2910 | 2898 |
model = self.tableWidgetHMB.model() |
2911 | 2899 |
model.setColumnCount(2) |
2912 |
# self.tableWidgetHMB.setColumnCount(2) |
|
2913 | 2900 |
|
2914 | 2901 |
col_names = ['Stream No.\n', 'Unit\n'] |
2915 | 2902 |
_hmbs = sorted(hmbs, key=lambda hmb: hmb.stream_no) |
내보내기 Unified diff