프로젝트

일반

사용자정보

개정판 5403f008

ID5403f00828ae135eed01ce42001a56e299724f10
상위 4211450a
하위 38099e2f

김연진이(가) 약 5년 전에 추가함

issue #1048 :화면/메뉴/툴바 개발

Change-Id: I69dc406ff803d104529cb04f0802de9cfc2a5815

차이점 보기:

HYTOS/HYTOS/Commands/HydroCalculationCommand.py
66 66
        for loop in self.loops:
67 67
            cvdp = []
68 68
            cvdp.append(100000000)
69
            names = []
69 70
            for item in loop.items:
70
                name = str(item)[:3]
71
                if name == 'CV_':
72
                    if item in loop.pressure_drops:
73
                        if loop.pressure_drops[item] > 0:
71
                parent = item.parent
72
                if parent:
73
                    name = str(item).replace('_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
74
                    if name in names:
75
                        continue
76
                    if name[:3] == 'CV_':
77
                        names.append(name)
78
                        if item in loop.pressure_drops:
74 79
                            cvdp.append(loop.pressure_drops[item])
75 80

  
76 81
            cvdp_final = min(cvdp)
77 82

  
83
            names = []
78 84
            for item in loop.items:
79
                name = str(item)[:3]
80
                if name == 'CV_':
81
                    if loop.pressure_drops[item] > 0:
82
                        loop.pressure_drops[item] = cvdp_final
83
                    else:
84
                        loop.extras[item] = cvdp_final / (cvdp_final + loop.total_device_loss + loop.line_total_friction_loss)
85
                parent = item.parent
86
                if parent:
87
                    name = str(item).replace('_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
88
                    if name[:3] == 'CV_':
89
                        if name in names:
90
                            loop.extras[item] = cvdp_final / (
91
                                        cvdp_final + loop.total_device_loss + loop.line_total_friction_loss)
92
                            continue
93
                        else:
94
                            names.append(name)
95
                            loop.pressure_drops[item] = cvdp_final
96

  
85 97

  
86 98
    def search_pump_calc(self):
87 99
        pumpdp = []
HYTOS/HYTOS/CopyStreamData.py
226 226

  
227 227
            app_doc_data = AppDocData.instance()
228 228
            drawing = app_doc_data.activeDrawing
229
            matches = [hmb for hmb in drawing.hmbTable._hmbs if hmb.components_uid == components_uid]
229
            matches = [hmb for hmb in drawing.hmbTable._hmbs if str(hmb.components_uid) == components_uid]
230 230
            if matches:
231 231
                self.ui.tableWidget_StreamData.setItem(0, 2, set_item_properties(matches[0].uid,
232 232
                                                                                 Qt.AlignHCenter | Qt.AlignVCenter))
HYTOS/HYTOS/GeometryData_MixedDialog.py
292 292

  
293 293
        nominal_diameter_uid = self.ui.comboBox_Nominal_Pipe_Size.currentData()
294 294
        schedule_uid = self.ui.comboBox_Schedule_No.currentData()
295
        schedule_no = self.ui.comboBox_Schedule_No.currentText()
295 296

  
296
        if nominal_diameter_uid and schedule_uid:
297
            inside_diameter = AppDocData.instance().getInsideDiameter(nominal_diameter_uid, schedule_uid)
298
            if len(inside_diameter) > 0:
299
                if self.ui.label_Inside_Pipe_Size_Unit.text() == 'mm':
300
                    if inside_diameter[0][1]:
301
                        self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][1]))
302
                else:
303
                    if inside_diameter[0][2]:
304
                        self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][2]))
297
        if schedule_no == 'User Sch.':
298
            self.ui.lineEdit_Inside_Pipe_Size.setReadOnly(False)
299
        else:
300
            self.ui.lineEdit_Inside_Pipe_Size.setReadOnly(True)
301
            if nominal_diameter_uid and schedule_uid:
302
                inside_diameter = AppDocData.instance().getInsideDiameter(nominal_diameter_uid, schedule_uid)
303
                if len(inside_diameter) > 0:
304
                    if self.ui.label_Inside_Pipe_Size_Unit.text() == 'mm':
305
                        if inside_diameter[0][1]:
306
                            self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][1]))
307
                    else:
308
                        if inside_diameter[0][2]:
309
                            self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][2]))
305 310

  
306 311
    def init_units(self):
307 312
        app_doc_data = AppDocData.instance()
HYTOS/HYTOS/MainWindow.py
883 883
                file_name = os.path.join(workspace, app_doc_data.activeDrawing.name + '.xlsx')
884 884
                options = QFileDialog.Options()
885 885
                options |= QFileDialog.DontUseNativeDialog
886
                name, _ = QFileDialog.getSaveFileName(self, self.tr('Report'), file_name, 'Excel(*.xlsx)',
886
                file_name, _ = QFileDialog.getSaveFileName(self, self.tr('Report'), file_name, 'Excel(*.xlsx)',
887 887
                                                      options=options)
888 888

  
889 889
                template = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME, 'Report_Template.xlsx')
890
                if name and os.path.exists(template):
890
                if file_name and os.path.exists(template):
891
                    units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
892

  
891 893
                    wb = openpyxl.load_workbook(template)
892 894

  
893
                    ws = wb.copy_worksheet(wb.get_sheet_by_name('Page'))
894
                    ws.title = 'Page (1)'
895
                    page_no = 1                    
896
                    pages = math.ceil(len(list(app_doc_data.activeDrawing.hmbTable.streamNos())) / 20)
897
                    for page in range(pages):
898
                        ws = wb.copy_worksheet(wb.get_sheet_by_name('Page'))
899
                        ws.title = 'Page ({})'.format(page_no)
900

  
901
                        cal_image = openpyxl.drawing.image.Image(image_path)
902
                        x_scale, y_scale = 1, 1
903
                        cal_image.width *= x_scale
904
                        cal_image.height *= y_scale
905
                        ws.add_image(cal_image, 'C4')
906

  
907
                        """write sheet information"""
908
                        configs = app_doc_data.getConfigs('Sheet')
909
                        for config in configs:
910
                            if config.key == 'JobNo' and config.value:
911
                                ws['Z58'].value = config.value
912
                            elif config.key == 'JobName' and config.value:
913
                                ws['W59'].value = config.value
914
                            elif config.key == 'Description' and config.value:
915
                                ws['W73'].value = config.value
916
                            elif config.key == 'RevStatus' and config.value:
917
                                ws['Y68'].value = config.value
918
                            elif config.key == 'CheckedBy' and config.value:
919
                                ws['Z78'].value = config.value
920
                            elif config.key == 'ApprovedBy' and config.value:
921
                                ws['Z79'].value = config.value
922

  
923
                        configs = app_doc_data.getAppConfigs('app', 'UserName')
924
                        if configs and configs[0].value:
925
                            ws['Z77'].value = configs[0].value
926
                        ws['Z68'].value = str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
927
                        """up to here"""
928

  
929
                        # Output [Pump, Compressor, Control Valve]
930
                        ws['X1'].value = 'Loop_Deviation'
931
                        ws['X1'].font = Font(bold=True, underline='single', size=11)
932
                        ws['X2'].value = 'To Do ...'
933

  
934
                        loops = app_doc_data.activeDrawing.loops
895 935

  
896
                    cal_image = openpyxl.drawing.image.Image(image_path)
897
                    x_scale, y_scale = 1, 1
898
                    cal_image.width *= x_scale
899
                    cal_image.height *= y_scale
900
                    ws.add_image(cal_image, 'C4')
936
                        start_row_no = 4
937
                        start_col_no = 24
938
                        # Pump
939
                        pumps = []
940
                        row_no = start_row_no
941
                        col_no = start_col_no
942
                        for loop in loops:
943
                            for item in loop.items:
944
                                parent = item.parent
945
                                if parent:
946
                                    name = str(item).replace(
947
                                        '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
948
                                    if name in pumps:
949
                                        continue
950
                                    if name[:3] == 'R_P' or name[:3] == 'L_P' or name[:3] == 'V_P':
951
                                        pumps.append(name)
952

  
953
                                        attr = item.parent.attribute
954
                                        ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True,
955
                                                                                            underline='single',
956
                                                                                            size=11)
901 957

  
902
                    units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
958
                                        row_no += 1
959
                                        ws.cell(row_no, col_no, 'Suct.P :')
960
                                        col_no += 2
961
                                        ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
962
                                        col_no += 1
963
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
903 964

  
904
                    """write sheet information"""
905
                    configs = app_doc_data.getConfigs('Sheet')
906
                    for config in configs:
907
                        if config.key == 'JobNo' and config.value:
908
                            ws['Z58'].value = config.value
909
                        elif config.key == 'JobName' and config.value:
910
                            ws['W59'].value = config.value
911
                        elif config.key == 'Description' and config.value:
912
                            ws['W73'].value = config.value
913
                        elif config.key == 'RevStatus' and config.value:
914
                            ws['Y68'].value = config.value
915
                        elif config.key == 'CheckedBy' and config.value:
916
                            ws['Z78'].value = config.value
917
                        elif config.key == 'ApprovedBy' and config.value:
918
                            ws['Z79'].value = config.value
919

  
920
                    configs = app_doc_data.getAppConfigs('app', 'UserName')
921
                    if configs and configs[0].value:
922
                        ws['Z77'].value = configs[0].value
923
                    ws['Z68'].value = str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
924
                    """up to here"""
925

  
926
                    # Output [Pump, Compressor, Control Valve]
927
                    ws['X1'].value = 'Loop_Deviation'
928
                    ws['X1'].font = Font(bold=True, underline='single', size=11)
929
                    ws['X2'].value = 'To Do ...'
930

  
931
                    loops = app_doc_data.activeDrawing.loops
932

  
933
                    start_row_no = 4
934
                    start_col_no = 24
935
                    # Pump
936
                    pumps = []
937
                    row_no = start_row_no
938
                    col_no = start_col_no
939
                    for loop in loops:
940
                        for item in loop.items:
941
                            parent = item.parent
942
                            if parent:
943
                                name = str(item).replace(
944
                                    '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
945
                                if name in pumps:
946
                                    continue
947
                                if name[:3] == 'R_P' or name[:3] == 'L_P' or name[:3] == 'V_P':
948
                                    pumps.append(name)
949

  
950
                                    attr = item.parent.attribute
951
                                    ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
952
                                                                                        size=11)
953

  
954
                                    row_no += 1
955
                                    ws.cell(row_no, col_no, 'Suct.P :')
956
                                    col_no += 2
957
                                    ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
958
                                    col_no += 1
959
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
960

  
961
                                    row_no += 1
962
                                    col_no = 24 if col_no == 27 else 28
963
                                    ws.cell(row_no, col_no, 'Disc.P :')
964
                                    col_no += 2
965
                                    ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
966
                                    col_no += 1
967
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
968

  
969
                                    row_no += 1
970
                                    col_no = 24 if col_no == 27 else 28
971
                                    ws.cell(row_no, col_no, 'Diff.P :')
972
                                    col_no += 2
973
                                    ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
974
                                    col_no += 1
975
                                    ws.cell(row_no, col_no, units['Pressure'])
976

  
977
                                    row_no += 1
978
                                    col_no = 24 if col_no == 27 else 28
979
                                    ws.cell(row_no, col_no, 'Head :')
980
                                    col_no += 2
981
                                    ws.cell(row_no, col_no, round(attr['Head'], 3))
982
                                    col_no += 1
983
                                    ws.cell(row_no, col_no, units['Length'])
984

  
985
                                    row_no += 1
986
                                    col_no = 24 if col_no == 27 else 28
987
                                    ws.cell(row_no, col_no, 'NPSHa :')
988
                                    col_no += 2
989
                                    ws.cell(row_no, col_no, round(attr['NPSHa'], 3))
990
                                    col_no += 1
991
                                    ws.cell(row_no, col_no, units['Length'])
992

  
993
                                    row_no += 1
994
                                    col_no = 24 if col_no == 27 else 28
995
                                    ws.cell(row_no, col_no, 'Vap. P :')
996
                                    col_no += 2
997
                                    ws.cell(row_no, col_no, attr['Vap. P'])
998
                                    col_no += 1
999
                                    ws.cell(row_no, col_no, '{}.a'.format(units['Pressure']))
1000

  
1001
                                    row_no += 1
1002
                                    col_no = 24 if col_no == 27 else 28
1003
                                    ws.cell(row_no, col_no, 'HHP :')
1004
                                    col_no += 2
1005
                                    ws.cell(row_no, col_no, round(attr['HHP'], 3))
1006
                                    col_no += 1
1007
                                    ws.cell(row_no, col_no, units['Power'])
1008

  
1009
                                    col_no = 28 if col_no == 27 else 24
1010
                                    row_no = row_no - 7 if col_no == 28 else row_no + 2
1011

  
1012
                    start_row_no += math.ceil(len(pumps)) * 9
1013

  
1014
                    # Compressor
1015
                    compressors = []
1016
                    row_no = start_row_no
1017
                    col_no = start_col_no
1018
                    for loop in loops:
1019
                        for item in loop.items:
1020
                            parent = item.parent
1021
                            if parent:
1022
                                name = str(item).replace(
1023
                                    '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
1024
                                if name in compressors:
1025
                                    continue
1026
                                if name[:3] == 'R_K' or name[:3] == 'L_K':
1027
                                    compressors.append(name)
1028

  
1029
                                    attr = item.parent.attribute
1030
                                    ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
1031
                                                                                        size=11)
1032

  
1033
                                    row_no += 1
1034
                                    ws.cell(row_no, col_no, 'Suct.P :')
1035
                                    col_no += 2
1036
                                    ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1037
                                    col_no += 1
1038
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1039

  
1040
                                    row_no += 1
1041
                                    col_no = 24 if col_no == 27 else 28
1042
                                    ws.cell(row_no, col_no, 'Disc.P :')
1043
                                    col_no += 2
1044
                                    ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1045
                                    col_no += 1
1046
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1047

  
1048
                                    row_no += 1
1049
                                    col_no = 24 if col_no == 27 else 28
1050
                                    ws.cell(row_no, col_no, 'Diff.P :')
1051
                                    col_no += 2
1052
                                    ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1053
                                    col_no += 1
1054
                                    ws.cell(row_no, col_no, units['Pressure'])
1055

  
1056
                                    row_no += 1
1057
                                    col_no = 24 if col_no == 27 else 28
1058
                                    ws.cell(row_no, col_no, 'HHP :')
1059
                                    col_no += 2
1060
                                    ws.cell(row_no, col_no, round(attr['HHP'], 3))
1061
                                    col_no += 1
1062
                                    ws.cell(row_no, col_no, units['Power'])
1063

  
1064
                                    col_no = 28 if col_no == 27 else 24
1065
                                    row_no = row_no - 4 if col_no == 28 else row_no + 2
1066

  
1067
                    start_row_no += math.ceil(len(compressors)) * 9
1068

  
1069
                    # Control Valve
1070
                    control_valves = []
1071
                    row_no = start_row_no
1072
                    col_no = start_col_no
1073
                    for loop in loops:
1074
                        for item in loop.items:
1075
                            parent = item.parent
1076
                            if parent:
1077
                                name = str(item).replace(
1078
                                    '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
1079
                                if name in control_valves:
1080
                                    continue
1081
                                if name[:3] == 'CV_':
1082
                                    control_valves.append(name)
1083

  
1084
                                    attr = item.parent.attribute
1085
                                    ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
1086
                                                                                        size=11)
1087

  
1088
                                    row_no += 1
1089
                                    ws.cell(row_no, col_no, 'Inlet P :')
1090
                                    col_no += 2
1091
                                    ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1092
                                    col_no += 1
1093
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1094

  
1095
                                    row_no += 1
1096
                                    col_no = 24 if col_no == 27 else 28
1097
                                    ws.cell(row_no, col_no, 'Outlet P :')
1098
                                    col_no += 2
1099
                                    ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1100
                                    col_no += 1
1101
                                    ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1102

  
1103
                                    row_no += 1
1104
                                    col_no = 24 if col_no == 27 else 28
1105
                                    ws.cell(row_no, col_no, 'Diff.P :')
1106
                                    col_no += 2
1107
                                    ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1108
                                    col_no += 1
1109
                                    ws.cell(row_no, col_no, units['Pressure'])
1110

  
1111
                                    row_no += 1
1112
                                    col_no = 24 if col_no == 27 else 28
1113
                                    ws.cell(row_no, col_no, 'dP Ratio :')
1114
                                    col_no += 2
1115
                                    ws.cell(row_no, col_no, round(attr['dP Ratio'] * 100, 2))
1116
                                    col_no += 1
1117
                                    ws.cell(row_no, col_no, '%')
1118

  
1119
                                    col_no = 28 if col_no == 27 else 24
1120
                                    row_no = row_no - 4 if col_no == 28 else row_no + 2
1121

  
1122
                    '''
1123
                    symbols = [item for item in self.graphicsView.scene.items() if type(item) is SymbolSvgItem]
1124
                    if symbols:
1125
                        units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
1126

  
1127
                        pumps = [symbol for symbol in symbols if symbol.has_attribute() and (
1128
                                str(symbol.name)[:3] == 'R_P' or str(symbol.name)[:3] == 'L_P' or str(symbol.name)[
1129
                                                                                                  :3] == 'V_P')]
1130

  
1131
                        compressors = [symbol for symbol in symbols if symbol.has_attribute() and (
1132
                                str(symbol.name)[:3] == 'R_K' or str(symbol.name)[:3] == 'L_K')]
1133

  
1134
                        control_valves = [symbol for symbol in symbols if
1135
                                          symbol.has_attribute() and str(symbol.name)[:3] == 'CV_']
965
                                        row_no += 1
966
                                        col_no = 24 if col_no == 27 else 28
967
                                        ws.cell(row_no, col_no, 'Disc.P :')
968
                                        col_no += 2
969
                                        ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
970
                                        col_no += 1
971
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1136 972

  
1137
                        start_row_no = 4
973
                                        row_no += 1
974
                                        col_no = 24 if col_no == 27 else 28
975
                                        ws.cell(row_no, col_no, 'Diff.P :')
976
                                        col_no += 2
977
                                        ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
978
                                        col_no += 1
979
                                        ws.cell(row_no, col_no, units['Pressure'])
980

  
981
                                        row_no += 1
982
                                        col_no = 24 if col_no == 27 else 28
983
                                        ws.cell(row_no, col_no, 'Head :')
984
                                        col_no += 2
985
                                        ws.cell(row_no, col_no, round(attr['Head'], 3))
986
                                        col_no += 1
987
                                        ws.cell(row_no, col_no, units['Length'])
988

  
989
                                        row_no += 1
990
                                        col_no = 24 if col_no == 27 else 28
991
                                        ws.cell(row_no, col_no, 'NPSHa :')
992
                                        col_no += 2
993
                                        ws.cell(row_no, col_no, round(attr['NPSHa'], 3))
994
                                        col_no += 1
995
                                        ws.cell(row_no, col_no, units['Length'])
996

  
997
                                        row_no += 1
998
                                        col_no = 24 if col_no == 27 else 28
999
                                        ws.cell(row_no, col_no, 'Vap. P :')
1000
                                        col_no += 2
1001
                                        ws.cell(row_no, col_no, attr['Vap. P'])
1002
                                        col_no += 1
1003
                                        ws.cell(row_no, col_no, '{}.a'.format(units['Pressure']))
1004

  
1005
                                        row_no += 1
1006
                                        col_no = 24 if col_no == 27 else 28
1007
                                        ws.cell(row_no, col_no, 'HHP :')
1008
                                        col_no += 2
1009
                                        ws.cell(row_no, col_no, round(attr['HHP'], 3))
1010
                                        col_no += 1
1011
                                        ws.cell(row_no, col_no, units['Power'])
1012

  
1013
                                        col_no = 28 if col_no == 27 else 24
1014
                                        row_no = row_no - 7 if col_no == 28 else row_no + 2
1015

  
1016
                        start_row_no += math.ceil(len(pumps)) * 9
1017

  
1018
                        # Compressor
1019
                        compressors = []
1020
                        row_no = start_row_no
1021
                        col_no = start_col_no
1022
                        for loop in loops:
1023
                            for item in loop.items:
1024
                                parent = item.parent
1025
                                if parent:
1026
                                    name = str(item).replace(
1027
                                        '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
1028
                                    if name in compressors:
1029
                                        continue
1030
                                    if name[:3] == 'R_K' or name[:3] == 'L_K':
1031
                                        compressors.append(name)
1032

  
1033
                                        attr = item.parent.attribute
1034
                                        ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True,
1035
                                                                                            underline='single',
1036
                                                                                            size=11)
1037

  
1038
                                        row_no += 1
1039
                                        ws.cell(row_no, col_no, 'Suct.P :')
1040
                                        col_no += 2
1041
                                        ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1042
                                        col_no += 1
1043
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1138 1044

  
1139
                        if pumps:
1140
                            row_no = start_row_no
1141
                            col_no = 24
1142
                            for pump in pumps:
1143
                                attr = pump.attribute
1144

  
1145
                                ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
1146
                                                                                    size=11)
1147

  
1148
                                row_no += 1
1149
                                ws.cell(row_no, col_no, 'Suct.P :')
1150
                                col_no += 2
1151
                                ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1152
                                col_no += 1
1153
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1154

  
1155
                                row_no += 1
1156
                                col_no = 24 if col_no == 27 else 28
1157
                                ws.cell(row_no, col_no, 'Disc.P :')
1158
                                col_no += 2
1159
                                ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1160
                                col_no += 1
1161
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1162

  
1163
                                row_no += 1
1164
                                col_no = 24 if col_no == 27 else 28
1165
                                ws.cell(row_no, col_no, 'Diff.P :')
1166
                                col_no += 2
1167
                                ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1168
                                col_no += 1
1169
                                ws.cell(row_no, col_no, units['Pressure'])
1170

  
1171
                                row_no += 1
1172
                                col_no = 24 if col_no == 27 else 28
1173
                                ws.cell(row_no, col_no, 'Head :')
1174
                                col_no += 2
1175
                                ws.cell(row_no, col_no, round(attr['Head'], 3))
1176
                                col_no += 1
1177
                                ws.cell(row_no, col_no, units['Length'])
1178

  
1179
                                row_no += 1
1180
                                col_no = 24 if col_no == 27 else 28
1181
                                ws.cell(row_no, col_no, 'NPSHa :')
1182
                                col_no += 2
1183
                                ws.cell(row_no, col_no, round(attr['NPSHa'], 3))
1184
                                col_no += 1
1185
                                ws.cell(row_no, col_no, units['Length'])
1186

  
1187
                                row_no += 1
1188
                                col_no = 24 if col_no == 27 else 28
1189
                                ws.cell(row_no, col_no, 'Vap. P :')
1190
                                col_no += 2
1191
                                ws.cell(row_no, col_no, attr['Vap. P'])
1192
                                col_no += 1
1193
                                ws.cell(row_no, col_no, '{}.a'.format(units['Pressure']))
1194

  
1195
                                row_no += 1
1196
                                col_no = 24 if col_no == 27 else 28
1197
                                ws.cell(row_no, col_no, 'HHP :')
1198
                                col_no += 2
1199
                                ws.cell(row_no, col_no, round(attr['HHP'], 3))
1200
                                col_no += 1
1201
                                ws.cell(row_no, col_no, units['Power'])
1202

  
1203
                                col_no = 28 if col_no == 27 else 24
1204
                                row_no = row_no - 7 if col_no == 28 else row_no + 2
1205

  
1206
                            start_row_no += math.ceil(len(pumps)) * 9
1207
                        if compressors:
1208
                            row_no = start_row_no
1209
                            col_no = 24
1210
                            for compressor in compressors:
1211
                                attr = compressor.attribute
1212

  
1213
                                ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
1214
                                                                                    size=11)
1215

  
1216
                                row_no += 1
1217
                                ws.cell(row_no, col_no, 'Suct.P :')
1218
                                col_no += 2
1219
                                ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1220
                                col_no += 1
1221
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1222

  
1223
                                row_no += 1
1224
                                col_no = 24 if col_no == 27 else 28
1225
                                ws.cell(row_no, col_no, 'Disc.P :')
1226
                                col_no += 2
1227
                                ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1228
                                col_no += 1
1229
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1230

  
1231
                                row_no += 1
1232
                                col_no = 24 if col_no == 27 else 28
1233
                                ws.cell(row_no, col_no, 'Diff.P :')
1234
                                col_no += 2
1235
                                ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1236
                                col_no += 1
1237
                                ws.cell(row_no, col_no, units['Pressure'])
1238

  
1239
                                row_no += 1
1240
                                col_no = 24 if col_no == 27 else 28
1241
                                ws.cell(row_no, col_no, 'HHP :')
1242
                                col_no += 2
1243
                                ws.cell(row_no, col_no, round(attr['HHP'], 3))
1244
                                col_no += 1
1245
                                ws.cell(row_no, col_no, units['Power'])
1246

  
1247
                                col_no = 28 if col_no == 27 else 24
1248
                                row_no = row_no - 4 if col_no == 28 else row_no + 2
1249

  
1250
                            start_row_no += math.ceil(len(compressors)) * 6
1251

  
1252
                        if control_valves:
1253
                            row_no = start_row_no
1254
                            col_no = 24
1255
                            for control_valve in control_valves:
1256
                                attr = control_valve.attribute
1257
                                ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True, underline='single',
1258
                                                                                    size=11)
1259

  
1260
                                row_no += 1
1261
                                ws.cell(row_no, col_no, 'Inlet P :')
1262
                                col_no += 2
1263
                                ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1264
                                col_no += 1
1265
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1266

  
1267
                                row_no += 1
1268
                                col_no = 24 if col_no == 27 else 28
1269
                                ws.cell(row_no, col_no, 'Outlet P :')
1270
                                col_no += 2
1271
                                ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1272
                                col_no += 1
1273
                                ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1274

  
1275
                                row_no += 1
1276
                                col_no = 24 if col_no == 27 else 28
1277
                                ws.cell(row_no, col_no, 'Diff.P :')
1278
                                col_no += 2
1279
                                ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1280
                                col_no += 1
1281
                                ws.cell(row_no, col_no, units['Pressure'])
1282

  
1283
                                row_no += 1
1284
                                col_no = 24 if col_no == 27 else 28
1285
                                ws.cell(row_no, col_no, 'dP Ratio :')
1286
                                col_no += 2
1287
                                ws.cell(row_no, col_no, round(attr['dP Ratio'] * 100, 2))
1288
                                col_no += 1
1289
                                ws.cell(row_no, col_no, '%')
1290

  
1291
                                col_no = 28 if col_no == 27 else 24
1292
                                row_no = row_no - 4 if col_no == 28 else row_no + 2
1293
                    '''
1294

  
1295
                    # write hmb unit
1296
                    ws['B54'].value = '-'
1297
                    ws['B55'].value = units['Pipe_Diameter']
1298
                    ws['B56'].value = units['Flowrate_Mass']
1299
                    ws['B57'].value = units['Flowrate_Volume']
1300
                    ws['B58'].value = units['Density']
1301
                    ws['B59'].value = units['Viscosity']
1302
                    ws['B60'].value = units['Temperature']  # Hidden
1303
                    ws['B61'].value = ''  # Hidden
1304
                    ws['B62'].value = ''  # Hidden
1305
                    ws['B63'].value = ''  # Hidden
1306
                    ws['B64'].value = units['Pipe_Diameter']  # Hidden
1307
                    ws['B65'].value = units['Pipe_Diameter']  # Hidden
1308
                    ws['B66'].value = ''  # Hidden
1309
                    ws['B67'].value = units['Length']
1310
                    ws['B68'].value = units['Length']
1311
                    ws['B69'].value = units['Roughness']
1312
                    ws['B70'].value = units['Velocity']  # Hidden
1313
                    ws['B71'].value = '{}/100{})'.format(units['Pressure'], units['Length'])  # Hidden
1314
                    ws['B73'].value= units['Velocity']
1315
                    ws['B74'].value = ''  # Hidden
1316
                    ws['B75'].value = ''  # Hidden
1317
                    ws['B76'].value = '{}/100{}'.format(units['Pressure'], units['Length'])
1318
                    ws['B77'].value = units['Pressure']
1319
                    ws['B78'].value = units['Pressure']
1320
                    ws['B79'].value = '{}(g)'.format(units['Pressure'])
1045
                                        row_no += 1
1046
                                        col_no = 24 if col_no == 27 else 28
1047
                                        ws.cell(row_no, col_no, 'Disc.P :')
1048
                                        col_no += 2
1049
                                        ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1050
                                        col_no += 1
1051
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1052

  
1053
                                        row_no += 1
1054
                                        col_no = 24 if col_no == 27 else 28
1055
                                        ws.cell(row_no, col_no, 'Diff.P :')
1056
                                        col_no += 2
1057
                                        ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1058
                                        col_no += 1
1059
                                        ws.cell(row_no, col_no, units['Pressure'])
1060

  
1061
                                        row_no += 1
1062
                                        col_no = 24 if col_no == 27 else 28
1063
                                        ws.cell(row_no, col_no, 'HHP :')
1064
                                        col_no += 2
1065
                                        ws.cell(row_no, col_no, round(attr['HHP'], 3))
1066
                                        col_no += 1
1067
                                        ws.cell(row_no, col_no, units['Power'])
1068

  
1069
                                        col_no = 28 if col_no == 27 else 24
1070
                                        row_no = row_no - 4 if col_no == 28 else row_no + 2
1071

  
1072
                        start_row_no += math.ceil(len(compressors)) * 9
1073

  
1074
                        # Control Valve
1075
                        control_valves = []
1076
                        row_no = start_row_no
1077
                        col_no = start_col_no
1078
                        for loop in loops:
1079
                            for item in loop.items:
1080
                                parent = item.parent
1081
                                if parent:
1082
                                    name = str(item).replace(
1083
                                        '_{}'.format(str(item).split('_')[len(str(item).split('_')) - 1]), '')
1084
                                    if name in control_valves:
1085
                                        continue
1086
                                    if name[:3] == 'CV_':
1087
                                        control_valves.append(name)
1088

  
1089
                                        attr = item.parent.attribute
1090
                                        ws.cell(row_no, col_no, attr['Tag_No']).font = Font(bold=True,
1091
                                                                                            underline='single',
1092
                                                                                            size=11)
1093

  
1094
                                        row_no += 1
1095
                                        ws.cell(row_no, col_no, 'Inlet P :')
1096
                                        col_no += 2
1097
                                        ws.cell(row_no, col_no, round(attr['Suct.P'], 3))
1098
                                        col_no += 1
1099
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1100

  
1101
                                        row_no += 1
1102
                                        col_no = 24 if col_no == 27 else 28
1103
                                        ws.cell(row_no, col_no, 'Outlet P :')
1104
                                        col_no += 2
1105
                                        ws.cell(row_no, col_no, round(attr['Disc.P'], 3))
1106
                                        col_no += 1
1107
                                        ws.cell(row_no, col_no, '{}.g'.format(units['Pressure']))
1108

  
1109
                                        row_no += 1
1110
                                        col_no = 24 if col_no == 27 else 28
1111
                                        ws.cell(row_no, col_no, 'Diff.P :')
1112
                                        col_no += 2
1113
                                        ws.cell(row_no, col_no, round(attr['Diff.P'], 3))
1114
                                        col_no += 1
1115
                                        ws.cell(row_no, col_no, units['Pressure'])
1321 1116

  
1117
                                        row_no += 1
1118
                                        col_no = 24 if col_no == 27 else 28
1119
                                        ws.cell(row_no, col_no, 'dP Ratio :')
1120
                                        col_no += 2
1121
                                        ws.cell(row_no, col_no, round(attr['dP Ratio'] * 100, 2))
1122
                                        col_no += 1
1123
                                        ws.cell(row_no, col_no, '%')
1124

  
1125
                                        col_no = 28 if col_no == 27 else 24
1126
                                        row_no = row_no - 4 if col_no == 28 else row_no + 2
1127

  
1128
                        # write hmb unit
1129
                        ws['B54'].value = '-'
1130
                        ws['B55'].value = units['Pipe_Diameter']
1131
                        ws['B56'].value = units['Flowrate_Mass']
1132
                        ws['B57'].value = units['Flowrate_Volume']
1133
                        ws['B58'].value = units['Density']
1134
                        ws['B59'].value = units['Viscosity']
1135
                        ws['B60'].value = units['Temperature']  # Hidden
1136
                        ws['B61'].value = ''  # Hidden
1137
                        ws['B62'].value = ''  # Hidden
1138
                        ws['B63'].value = ''  # Hidden
1139
                        ws['B64'].value = units['Pipe_Diameter']  # Hidden
1140
                        ws['B65'].value = units['Pipe_Diameter']  # Hidden
1141
                        ws['B66'].value = ''  # Hidden
1142
                        ws['B67'].value = units['Length']
1143
                        ws['B68'].value = units['Length']
1144
                        ws['B69'].value = units['Roughness']
1145
                        ws['B70'].value = units['Velocity']  # Hidden
1146
                        ws['B71'].value = '{}/100{})'.format(units['Pressure'], units['Length'])  # Hidden
1147
                        ws['B73'].value = units['Velocity']
1148
                        ws['B74'].value = ''  # Hidden
1149
                        ws['B75'].value = ''  # Hidden
1150
                        ws['B76'].value = '{}/100{}'.format(units['Pressure'], units['Length'])
1151
                        ws['B77'].value = units['Pressure']
1152
                        ws['B78'].value = units['Pressure']
1153
                        ws['B79'].value = '{}(g)'.format(units['Pressure'])
1154

  
1155
                        page_no += 1
1156

  
1157
                    current_ws = wb.get_sheet_by_name('Page (1)')
1322 1158
                    # write hmb data
1323 1159
                    drawing = app_doc_data.activeDrawing
1324 1160
                    hmbs = drawing.hmbTable._hmbs
1325 1161
                    if hmbs is not None:
1162
                        stream_count = 1
1326 1163
                        col_no = 3
1327 1164
                        for hmb in hmbs:
1328
                            row_no = 54
1165
                            ws = self.get_work_sheet(wb, stream_count)
1166
                            if ws != current_ws:
1167
                                current_ws = ws
1168
                                col_no = 3
1169

  
1170
                            row_no = 53
1171
                            ws.cell(row_no, col_no, hmb.stream_no)
1172
                            row_no += 1
1329 1173
                            ws.cell(row_no, col_no, hmb.phase_type)
1330 1174
                            row_no += 1
1331 1175
                            ws.cell(row_no, col_no, hmb.inside_pipe_size)
......
1377 1221
                            ws.cell(row_no, col_no, hmb.pressure_pipe_end_point)
1378 1222

  
1379 1223
                            col_no += 1
1380

  
1224
                            stream_count += 1
1381 1225
                    # two_phase
1382 1226
                    if hmbs is not None:
1383 1227
                        for hmb in hmbs:
1384 1228
                            if hmb.phase_type == 'Mixed':
1385
                                lines = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringStreamlineItem and item.uid == hmb.components_uid]
1229
                                lines = [item for item in self.graphicsView.scene.items() if type(
1230
                                    item) is QEngineeringStreamlineItem and item.uid == hmb.components_uid]
1386 1231
                                if lines:
1387 1232
                                    ws = wb.copy_worksheet(wb.get_sheet_by_name('Two_phase'))
1388 1233
                                    ws.title = 'Two Phase {}'.format(str(lines[0]))
......
1421 1266
                                        col_no = 3
1422 1267
                                        ws.cell(row_no, col_no, str(geometry[0]))  # Element
1423 1268
                                        col_no += 1
1424
                                        ws.cell(row_no, col_no, float(geometry[3]) if is_float(geometry[3]) else None)  # ID
1269
                                        ws.cell(row_no, col_no,
1270
                                                float(geometry[3]) if is_float(geometry[3]) else None)  # ID
1425 1271
                                        col_no += 1
1426
                                        ws.cell(row_no, col_no, float(geometry[4]) if is_float(geometry[4]) else None)  # Roughness
1272
                                        ws.cell(row_no, col_no,
1273
                                                float(geometry[4]) if is_float(geometry[4]) else None)  # Roughness
1427 1274
                                        col_no += 1
1428
                                        ws.cell(row_no, col_no, float(geometry[5]) if is_float(geometry[5]) else None)  # Length
1275
                                        ws.cell(row_no, col_no,
1276
                                                float(geometry[5]) if is_float(geometry[5]) else None)  # Length
1429 1277
                                        col_no += 1
1430
                                        ws.cell(row_no, col_no, float(geometry[6]) if is_float(geometry[6]) else None)  # Angle
1278
                                        ws.cell(row_no, col_no,
1279
                                                float(geometry[6]) if is_float(geometry[6]) else None)  # Angle
1431 1280
                                        col_no += 1
1432
                                        ws.cell(row_no, col_no, float(geometry[7]) if is_float(geometry[7]) else None)  # R/D
1281
                                        ws.cell(row_no, col_no,
1282
                                                float(geometry[7]) if is_float(geometry[7]) else None)  # R/D
1433 1283
                                        col_no += 1
1434
                                        ws.cell(row_no, col_no, float(geometry[9]) if is_float(geometry[9]) else None)  # K
1284
                                        ws.cell(row_no, col_no,
1285
                                                float(geometry[9]) if is_float(geometry[9]) else None)  # K
1435 1286

  
1436 1287
                                        row_no += 1
1437 1288

  
......
1442 1293
                                            col_no = 12
1443 1294
                                            ws.cell(row_no, col_no, str(data.element[no]))  # Element
1444 1295
                                            col_no += 1
1445
                                            ws.cell(row_no, col_no, data.inside_diameter[no] if no in data.inside_diameter else None)
1296
                                            ws.cell(row_no, col_no, data.inside_diameter[
1297
                                                no] if no in data.inside_diameter else None)
1446 1298
                                            col_no += 1
1447 1299
                                            ws.cell(row_no, col_no, data.length[no] if no in data.length else None)
1448 1300
                                            col_no += 1
......
1450 1302
                                            col_no += 1
1451 1303
                                            ws.cell(row_no, col_no, data.k[no] if no in data.k else None)
1452 1304
                                            col_no += 1
1453
                                            ws.cell(row_no, col_no, data.pressure[no] if no in data.pressure else None)
1305
                                            ws.cell(row_no, col_no,
1306
                                                    data.pressure[no] if no in data.pressure else None)
1454 1307
                                            col_no += 1
1455 1308
                                            ws.cell(row_no, col_no, data.void[no] if no in data.void else None)
1456 1309
                                            col_no += 1
1457
                                            ws.cell(row_no, col_no, data.quality[no] if no in data.quality else None)
1310
                                            ws.cell(row_no, col_no,
1311
                                                    data.quality[no] if no in data.quality else None)
1458 1312
                                            col_no += 1
1459
                                            ws.cell(row_no, col_no, data.mean_den[no] if no in data.mean_den else None)
1313
                                            ws.cell(row_no, col_no,
1314
                                                    data.mean_den[no] if no in data.mean_den else None)
1460 1315
                                            col_no += 1
1461
                                            ws.cell(row_no, col_no, data.v_density[no] if no in data.v_density else None)
1316
                                            ws.cell(row_no, col_no,
1317
                                                    data.v_density[no] if no in data.v_density else None)
1462 1318
                                            col_no += 1
1463
                                            ws.cell(row_no, col_no, data.homo_vel[no] if no in data.homo_vel else None)
1319
                                            ws.cell(row_no, col_no,
1320
                                                    data.homo_vel[no] if no in data.homo_vel else None)
1464 1321
                                            col_no += 1
1465
                                            ws.cell(row_no, col_no, data.max_vel[no] if no in data.max_vel else None)
1322
                                            ws.cell(row_no, col_no,
1323
                                                    data.max_vel[no] if no in data.max_vel else None)
1466 1324
                                            col_no += 1
1467
                                            ws.cell(row_no, col_no, data.ero_vel[no] if no in data.ero_vel else None)
1325
                                            ws.cell(row_no, col_no,
1326
                                                    data.ero_vel[no] if no in data.ero_vel else None)
1468 1327
                                            col_no += 1
1469 1328
                                            ws.cell(row_no, col_no, data.x[no] if no in data.x else None)
1470 1329
                                            col_no += 1
1471 1330
                                            ws.cell(row_no, col_no, data.y[no] if no in data.y else None)
1472 1331
                                            col_no += 1
1473
                                            ws.cell(row_no, col_no, str(data.regime[no]) if no in data.regime else None)
1332
                                            ws.cell(row_no, col_no,
1333
                                                    str(data.regime[no]) if no in data.regime else None)
1474 1334
                                            col_no += 1
1475
                                            ws.cell(row_no, col_no, data.dp_fric[no] if no in data.dp_fric else None)
1335
                                            ws.cell(row_no, col_no,
1336
                                                    data.dp_fric[no] if no in data.dp_fric else None)
1476 1337
                                            col_no += 1
1477
                                            ws.cell(row_no, col_no, data.dp_stat[no] if no in data.dp_stat else None)
1338
                                            ws.cell(row_no, col_no,
1339
                                                    data.dp_stat[no] if no in data.dp_stat else None)
1478 1340
                                            col_no += 1
1479
                                            ws.cell(row_no, col_no, data.dp_momen[no] if no in data.dp_momen else None)
1341
                                            ws.cell(row_no, col_no,
1342
                                                    data.dp_momen[no] if no in data.dp_momen else None)
1480 1343
                                            col_no += 1
1481
                                            ws.cell(row_no, col_no, data.total_length[no] if no in data.total_length else None)
1344
                                            ws.cell(row_no, col_no,
1345
                                                    data.total_length[no] if no in data.total_length else None)
1482 1346

  
1483 1347
                                            row_no += 1
1484 1348

  
1485

  
1486

  
1487

  
1488 1349
                    wb.get_sheet_by_name('Page').sheet_state = 'hidden'
1489 1350
                    wb.get_sheet_by_name('Two_phase').sheet_state = 'hidden'
1490 1351

  
1491
                    name_without_ext, ext = os.path.splitext(name)
1492
                    save_file_name = name if ext.upper() == '.XLSX' else name + '.xlsx'
1352
                    name_without_ext, ext = os.path.splitext(file_name)
1353
                    save_file_name = file_name if ext.upper() == '.XLSX' else name_without_ext + '.xlsx'
1493 1354
                    wb.save(filename=save_file_name)
1494 1355

  
1495 1356
                    os.startfile(save_file_name)
......
1500 1361
                                                           sys.exc_info()[-1].tb_lineno)
1501 1362
            self.addMessage.emit(MessageType.Error, message)
1502 1363

  
1364
    def get_work_sheet(self, work_book, count):
1365
        page_no = math.ceil(count / 20)
1366
        return work_book.get_sheet_by_name('Page ({})'.format(page_no))
1367

  
1503 1368
    def loop_streams_hy(self):
1504 1369
        try:
1505 1370
            pass
HYTOS/HYTOS/MainWindow_UI.py
161 161
        self.menu_3.setObjectName("menu_3")
162 162
        self.menuTool = QtWidgets.QMenu(self.menubar)
163 163
        self.menuTool.setObjectName("menuTool")
164
        self.menuHelp = QtWidgets.QMenu(self.menubar)
165
        self.menuHelp.setObjectName("menuHelp")
164 166
        MainWindow.setMenuBar(self.menubar)
165 167
        self.actionClose = QtWidgets.QAction(MainWindow)
166 168
        icon2 = QtGui.QIcon()
......
462 464
        font.setFamily("맑은 고딕")
463 465
        self.actionSymbol_Editor.setFont(font)
464 466
        self.actionSymbol_Editor.setObjectName("actionSymbol_Editor")
467
        self.actionAbout = QtWidgets.QAction(MainWindow)
468
        icon23 = QtGui.QIcon()
469
        icon23.addPixmap(QtGui.QPixmap(":/images/Question.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
470
        self.actionAbout.setIcon(icon23)
471
        self.actionAbout.setObjectName("actionAbout")
465 472
        self.toolBar.addAction(self.actionNew)
466 473
        self.toolBar.addAction(self.actionOpen)
467 474
        self.toolBar.addAction(self.actionSave)
......
491 498
        self.menuTool.addSeparator()
492 499
        self.menuTool.addAction(self.actionOptions)
493 500
        self.menuTool.addSeparator()
501
        self.menuHelp.addAction(self.actionAbout)
494 502
        self.menubar.addAction(self.menu.menuAction())
495 503
        self.menubar.addAction(self.menu_3.menuAction())
496 504
        self.menubar.addAction(self.menuTool.menuAction())
505
        self.menubar.addAction(self.menuHelp.menuAction())
497 506

  
498 507
        self.retranslateUi(MainWindow)
499 508
        self.tabWidget.setCurrentIndex(0)
......
516 525
        self.menuLanguage.setTitle(_translate("MainWindow", "Language"))
517 526
        self.menu_3.setTitle(_translate("MainWindow", "View"))
518 527
        self.menuTool.setTitle(_translate("MainWindow", "Tools"))
528
        self.menuHelp.setTitle(_translate("MainWindow", "Help"))
519 529
        self.actionClose.setText(_translate("MainWindow", "Exit"))
520 530
        self.actionClose.setToolTip(_translate("MainWindow", "Exit"))
521 531
        self.actionRecognition.setText(_translate("MainWindow", "Recognize Eng. Info."))
......
588 598
        self.actionSymbolEditor.setText(_translate("MainWindow", "Symbol Editor"))
589 599
        self.actionSymbolEditor_2.setText(_translate("MainWindow", "Symbol Editor"))
590 600
        self.actionSymbol_Editor.setText(_translate("MainWindow", "Symbol Editor"))
601
        self.actionAbout.setText(_translate("MainWindow", "About HYTOS"))
591 602
import Resource_rc
HYTOS/HYTOS/StreamDataDialog.py
1127 1127

  
1128 1128
        nominal_diameter_uid = self.ui.comboBox_Nominal_Pipe_Size.currentData()
1129 1129
        schedule_uid = self.ui.comboBox_Schedule_No.currentData()
1130
        schedule_no = self.ui.comboBox_Schedule_No.currentText()
1130 1131

  
1131
        if nominal_diameter_uid and schedule_uid:
1132
            inside_diameter = AppDocData.instance().getInsideDiameter(nominal_diameter_uid, schedule_uid)
1133
            if len(inside_diameter) > 0:
1134
                if self.ui.label_Inside_Pipe_Size_Unit.text() == 'mm':
1135
                    if inside_diameter[0][1]:
1136
                        self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][1]))
1137
                else:
1138
                    if inside_diameter[0][2]:
1139
                        self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][2]))
1132
        if schedule_no == 'User Sch.':
1133
            self.ui.lineEdit_Inside_Pipe_Size.setReadOnly(False)
1134
        else:
1135
            self.ui.lineEdit_Inside_Pipe_Size.setReadOnly(True)
1136
            if nominal_diameter_uid and schedule_uid:
1137
                inside_diameter = AppDocData.instance().getInsideDiameter(nominal_diameter_uid, schedule_uid)
1138
                if len(inside_diameter) > 0:
1139
                    if self.ui.label_Inside_Pipe_Size_Unit.text() == 'mm':
1140
                        if inside_diameter[0][1]:
1141
                            self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][1]))
1142
                    else:
1143
                        if inside_diameter[0][2]:
1144
                            self.ui.lineEdit_Inside_Pipe_Size.setText(str(inside_diameter[0][2]))
1140 1145

  
1141 1146
    def init_nominal_diameter(self):
1142 1147
        from AppDocData import AppDocData
HYTOS/HYTOS/UI/MainWindow.ui
312 312
    <addaction name="actionOptions"/>
313 313
    <addaction name="separator"/>
314 314
   </widget>
315
   <widget class="QMenu" name="menuHelp">
316
    <property name="title">
317
     <string>Help</string>
318
    </property>
319
    <addaction name="actionAbout"/>
320
   </widget>
315 321
   <addaction name="menu"/>
316 322
   <addaction name="menu_3"/>
317 323
   <addaction name="menuTool"/>
324
   <addaction name="menuHelp"/>
318 325
  </widget>
319 326
  <action name="actionClose">
320 327
   <property name="icon">
......
960 967
    </font>
961 968
   </property>
962 969
  </action>
970
  <action name="actionAbout">
971
   <property name="icon">
972
    <iconset resource="../res/Resource.qrc">
973
     <normaloff>:/images/Question.png</normaloff>:/images/Question.png</iconset>
974
   </property>
975
   <property name="text">
976
    <string>About HYTOS</string>
977
   </property>
978
  </action>
963 979
 </widget>
964 980
 <resources>
965 981
  <include location="../res/Resource.qrc"/>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)