344 |
344 |
|
345 |
345 |
tooltip = f"<b>{self.uid}</b><br>{self.type}={self.name}_{self.index}"
|
346 |
346 |
self.setToolTip(tooltip)
|
347 |
|
|
348 |
|
self.build_label()
|
349 |
347 |
except Exception as ex:
|
350 |
348 |
from App import App
|
351 |
349 |
|
... | ... | |
878 |
876 |
pos.setX(pos.x() + overlap*0.5)
|
879 |
877 |
sorted_labels[j].setPos(pos)
|
880 |
878 |
|
|
879 |
def update_label_contents(self) -> None:
|
|
880 |
"""update equipment label contents"""
|
|
881 |
|
|
882 |
rect = self.boundingRect()
|
|
883 |
|
|
884 |
app_doc_data = AppDocData.instance()
|
|
885 |
units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
|
|
886 |
|
|
887 |
# clear labels
|
|
888 |
for conn, label in self.desc_labels.items():
|
|
889 |
label.setHtml('')
|
|
890 |
|
|
891 |
if self.category == 'Equipment - [ Pressure Drop ]':
|
|
892 |
if self.type == 'Air Fin Cooler':
|
|
893 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
894 |
if conns:
|
|
895 |
self.desc_labels[conns[0]].setHtml(
|
|
896 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
897 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
898 |
elif self.type == 'Filter':
|
|
899 |
if self.tag_no:
|
|
900 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
901 |
if conns:
|
|
902 |
self.desc_labels[conns[0]].setHtml(
|
|
903 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
904 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
905 |
elif self.type == 'Heat Exchanger':
|
|
906 |
if self.tag_no:
|
|
907 |
nozzles = []
|
|
908 |
for conn in self.connectors:
|
|
909 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
910 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
911 |
nozzles.append(nozzle)
|
|
912 |
|
|
913 |
if len(nozzles) > 0:
|
|
914 |
if self.name == 'HEX_DP':
|
|
915 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
916 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
917 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
918 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
919 |
elif 'N1' in nozzles:
|
|
920 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
921 |
f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
922 |
f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
923 |
elif 'N2' in nozzles:
|
|
924 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
925 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
926 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
927 |
elif self.name == 'HEX_H':
|
|
928 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
929 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
930 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
931 |
f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
932 |
elif 'N1' in nozzles:
|
|
933 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
934 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
935 |
f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
936 |
elif 'N2' in nozzles:
|
|
937 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
938 |
f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
939 |
f"[T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
940 |
elif self.name == 'HEX_K':
|
|
941 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
942 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
943 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
944 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
945 |
elif 'N1' in nozzles:
|
|
946 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
947 |
f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
948 |
f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
949 |
elif 'N2' in nozzles:
|
|
950 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
951 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
952 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
953 |
elif self.name == 'HEX_P':
|
|
954 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
955 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
956 |
f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
957 |
f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
958 |
elif 'N1' in nozzles:
|
|
959 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
960 |
f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
961 |
f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
962 |
elif 'N2' in nozzles:
|
|
963 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
964 |
f"{self.tag_no}<br>[B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
965 |
f"[B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
966 |
elif self.name == 'HEX_V':
|
|
967 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
968 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
969 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
970 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
971 |
elif 'N1' in nozzles:
|
|
972 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
973 |
f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
974 |
f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
975 |
elif 'N2' in nozzles:
|
|
976 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
977 |
f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
978 |
f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
979 |
elif self.type == 'Miscellaneous':
|
|
980 |
if self.name == 'M_Coil':
|
|
981 |
if self.tag_no:
|
|
982 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
983 |
if conns:
|
|
984 |
self.desc_labels[conns[0]].setHtml(
|
|
985 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
986 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
987 |
elif self.name == 'M_DP_E':
|
|
988 |
if self.tag_no:
|
|
989 |
nozzles = []
|
|
990 |
for conn in self.connectors:
|
|
991 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
992 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
993 |
nozzles.append(nozzle)
|
|
994 |
|
|
995 |
if len(nozzles) > 0:
|
|
996 |
if 'N1' in nozzles and 'N2' in nozzles:
|
|
997 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
998 |
f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
999 |
f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
1000 |
elif 'N1' in nozzles:
|
|
1001 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
1002 |
f"{self.tag_no}<br>[V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1003 |
f"[V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
|
|
1004 |
elif 'N2' in nozzles:
|
|
1005 |
self.desc_labels[self.connectors[1]].setHtml(
|
|
1006 |
f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1007 |
f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
|
|
1008 |
elif self.name == 'M_React':
|
|
1009 |
if self.tag_no:
|
|
1010 |
nozzles = []
|
|
1011 |
for conn in self.connectors:
|
|
1012 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1013 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1014 |
nozzles.append(nozzle)
|
|
1015 |
|
|
1016 |
if len(nozzles) > 0:
|
|
1017 |
if ('N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles) and (
|
|
1018 |
'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles):
|
|
1019 |
if 'N1' in nozzles:
|
|
1020 |
top_index = 0
|
|
1021 |
elif 'N2' in nozzles:
|
|
1022 |
top_index = 1
|
|
1023 |
elif 'N6' in nozzles:
|
|
1024 |
top_index = 5
|
|
1025 |
|
|
1026 |
if 'N3' in nozzles:
|
|
1027 |
btm_index = 2
|
|
1028 |
elif 'N4' in nozzles:
|
|
1029 |
btm_index = 3
|
|
1030 |
elif 'N5' in nozzles:
|
|
1031 |
btm_index = 4
|
|
1032 |
|
|
1033 |
self.desc_labels[self.connectors[top_index]].setHtml(
|
|
1034 |
f"[DP] : {convert_to_fixed_point(self.connectors[top_index].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1035 |
f"[Top] : {convert_to_fixed_point(self.connectors[top_index].data.elevation)} {units['Length']}<br>"
|
|
1036 |
f"[Btm] : {convert_to_fixed_point(self.connectors[btm_index].data.elevation)} {units['Length']}")
|
|
1037 |
elif 'N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles:
|
|
1038 |
if 'N1' in nozzles:
|
|
1039 |
index = 0
|
|
1040 |
elif 'N2' in nozzles:
|
|
1041 |
index = 1
|
|
1042 |
elif 'N6' in nozzles:
|
|
1043 |
index = 5
|
|
1044 |
|
|
1045 |
self.desc_labels[self.connectors[index]].setHtml(
|
|
1046 |
f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1047 |
f"[Top] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
|
|
1048 |
elif 'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles:
|
|
1049 |
if 'N3' in nozzles:
|
|
1050 |
index = 2
|
|
1051 |
elif 'N4' in nozzles:
|
|
1052 |
index = 3
|
|
1053 |
elif 'N5' in nozzles:
|
|
1054 |
index = 4
|
|
1055 |
|
|
1056 |
self.desc_labels[self.connectors[index]].setHtml(
|
|
1057 |
f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1058 |
f"[Btm] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
|
|
1059 |
elif self.type == 'Strainer':
|
|
1060 |
if self.tag_no:
|
|
1061 |
conns = [conn for conn in self.connectors
|
|
1062 |
if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
|
|
1063 |
if conns:
|
|
1064 |
self.desc_labels[conns[0]].setHtml(
|
|
1065 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} {units['Pressure']}<br>"
|
|
1066 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1067 |
elif self.category == 'Equipment - [ Pressurized ]':
|
|
1068 |
if self.type == 'Battery Limit':
|
|
1069 |
if self.tag_no:
|
|
1070 |
conns = [conn for conn in self.connectors
|
|
1071 |
if conn.data and conn.data.pressure is not None and conn.data.elevation is not None]
|
|
1072 |
if conns:
|
|
1073 |
self.desc_labels[conns[0]].setHtml(
|
|
1074 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure)} {units['Pressure']}(g)<br>"
|
|
1075 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1076 |
elif self.type == 'Column':
|
|
1077 |
if self.tag_no:
|
|
1078 |
for conn in self.connectors:
|
|
1079 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1080 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1081 |
self.desc_labels[conn].setHtml(
|
|
1082 |
f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
|
|
1083 |
f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
|
|
1084 |
elif self.type == 'Drum':
|
|
1085 |
if self.tag_no:
|
|
1086 |
for conn in self.connectors:
|
|
1087 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1088 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1089 |
self.desc_labels[conn].setHtml(
|
|
1090 |
f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
|
|
1091 |
f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
|
|
1092 |
elif self.type == 'Miscellaneous':
|
|
1093 |
if self.tag_no:
|
|
1094 |
for conn in self.connectors:
|
|
1095 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1096 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1097 |
if conn.data:
|
|
1098 |
self.desc_labels[conn].setHtml(
|
|
1099 |
f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
|
|
1100 |
f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
|
|
1101 |
elif self.type == 'Tank':
|
|
1102 |
if self.tag_no:
|
|
1103 |
for conn in self.connectors:
|
|
1104 |
if conn.data and conn.connectedItem and \
|
|
1105 |
(conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1106 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1107 |
self.desc_labels[conn].setHtml(
|
|
1108 |
f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
|
|
1109 |
f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
|
|
1110 |
elif self.category == 'Equipment - [ Rotating ]':
|
|
1111 |
if self.type == 'Compressor':
|
|
1112 |
if self.name in ('L_Comp', 'R_Comp'):
|
|
1113 |
if self.tag_no:
|
|
1114 |
for conn in self.connectors:
|
|
1115 |
if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
|
|
1116 |
nozzle = str(conn).rsplit('_', 1)[1]
|
|
1117 |
self.desc_labels[conn].setHtml(
|
|
1118 |
f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
|
|
1119 |
f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
|
|
1120 |
elif self.name in ('L_Komp', 'R_Komp'):
|
|
1121 |
if self.tag_no:
|
|
1122 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
1123 |
if conns:
|
|
1124 |
self.desc_labels[conns[0]].setHtml(
|
|
1125 |
f"{self.tag_no}<br>"
|
|
1126 |
f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
1127 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1128 |
elif self.type == 'Pump':
|
|
1129 |
if self.tag_no:
|
|
1130 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
1131 |
if conns:
|
|
1132 |
self.desc_labels[conns[0]].setHtml(
|
|
1133 |
f"{self.tag_no}<br>"
|
|
1134 |
f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
1135 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1136 |
elif self.category == 'Instrument':
|
|
1137 |
if self.type == 'Flowmeter':
|
|
1138 |
if self.tag_no:
|
|
1139 |
data = self.connectors[0].data
|
|
1140 |
if data:
|
|
1141 |
self.desc_labels[self.connectors[0]].setHtml(
|
|
1142 |
f"{self.tag_no}<br>{convert_to_fixed_point(data.pressure_drop)} "
|
|
1143 |
f"{units['Pressure']}<br>{convert_to_fixed_point(data.elevation)} {units['Length']}")
|
|
1144 |
elif self.type == 'Line Splitter':
|
|
1145 |
if self.tag_no:
|
|
1146 |
conns = [conn for conn in self.connectors
|
|
1147 |
if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
|
|
1148 |
if conns:
|
|
1149 |
self.desc_labels[conns[0]].setHtml(
|
|
1150 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
|
|
1151 |
f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1152 |
elif self.type == 'Reducer':
|
|
1153 |
if self.tag_no:
|
|
1154 |
conns = [conn for conn in self.connectors
|
|
1155 |
if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
|
|
1156 |
if conns:
|
|
1157 |
self.desc_labels[conns[0]].setHtml(
|
|
1158 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
|
|
1159 |
f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1160 |
elif self.type == 'Valve':
|
|
1161 |
if self.tag_no and self.name in ('CV_H', 'CV_V'):
|
|
1162 |
conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
|
|
1163 |
if conns:
|
|
1164 |
self.desc_labels[conns[0]].setHtml(
|
|
1165 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
|
|
1166 |
f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1167 |
elif self.tag_no and self.name in ('MV_H', 'MV_V'):
|
|
1168 |
conns = [conn for conn in self.connectors
|
|
1169 |
if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
|
|
1170 |
if conns:
|
|
1171 |
self.desc_labels[conns[0]].setHtml(
|
|
1172 |
f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
|
|
1173 |
f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
|
|
1174 |
|
|
1175 |
font_size = None
|
|
1176 |
configs = app_doc_data.getAppConfigs('option', 'TagFontSize')
|
|
1177 |
if configs and len(configs) == 1:
|
|
1178 |
font_size = configs[0].value
|
|
1179 |
|
|
1180 |
font_color = None
|
|
1181 |
configs = app_doc_data.getAppConfigs('option', 'TagFontColor')
|
|
1182 |
if configs and len(configs) == 1:
|
|
1183 |
font_color = configs[0].value
|
|
1184 |
|
|
1185 |
for conn, label in self.desc_labels.items():
|
|
1186 |
if font_size: label.set_font_size(font_size)
|
|
1187 |
if font_color: label.set_font_color(font_color)
|
|
1188 |
|
881 |
1189 |
def rect(self):
|
882 |
1190 |
"""return bounding box of symbol"""
|
883 |
1191 |
return self.sceneBoundingRect()
|
... | ... | |
1266 |
1574 |
|
1267 |
1575 |
dialog = QAirFinCooler()
|
1268 |
1576 |
if dialog.show_dialog(self):
|
1269 |
|
self.build_label()
|
|
1577 |
self.update_label_contents()
|
1270 |
1578 |
self.validate()
|
1271 |
1579 |
|
1272 |
1580 |
def show_Filter(self):
|
... | ... | |
1274 |
1582 |
|
1275 |
1583 |
dialog = QFilter()
|
1276 |
1584 |
if dialog.show_dialog(self):
|
1277 |
|
self.build_label()
|
|
1585 |
self.update_label_contents()
|
1278 |
1586 |
self.validate()
|
1279 |
1587 |
|
1280 |
1588 |
def show_Coil(self):
|
... | ... | |
1282 |
1590 |
|
1283 |
1591 |
dialog = QCoil()
|
1284 |
1592 |
if dialog.show_dialog(self):
|
1285 |
|
self.build_label()
|
|
1593 |
self.update_label_contents()
|
1286 |
1594 |
self.validate()
|
1287 |
1595 |
|
1288 |
1596 |
def show_DP_Equipment(self):
|
... | ... | |
1290 |
1598 |
|
1291 |
1599 |
dialog = QDP_Equipment()
|
1292 |
1600 |
if dialog.show_dialog(self):
|
1293 |
|
self.build_label()
|
|
1601 |
self.update_label_contents()
|
1294 |
1602 |
self.validate()
|
1295 |
1603 |
|
1296 |
1604 |
def show_Reactor(self):
|
... | ... | |
1298 |
1606 |
|
1299 |
1607 |
dialog = QReactor()
|
1300 |
1608 |
if dialog.show_dialog(self):
|
1301 |
|
self.build_label()
|
|
1609 |
self.update_label_contents()
|
1302 |
1610 |
self.validate()
|
1303 |
1611 |
|
1304 |
1612 |
def show_Strainer_T(self):
|
... | ... | |
1306 |
1614 |
|
1307 |
1615 |
dialog = QStrainer_T()
|
1308 |
1616 |
if dialog.show_dialog(self):
|
1309 |
|
self.build_label()
|
|
1617 |
self.update_label_contents()
|
1310 |
1618 |
self.validate()
|
1311 |
1619 |
|
1312 |
1620 |
def show_Strainer_Y(self):
|
... | ... | |
1314 |
1622 |
|
1315 |
1623 |
dialog = QStrainer_Y()
|
1316 |
1624 |
if dialog.show_dialog(self):
|
1317 |
|
self.build_label()
|
|
1625 |
self.update_label_contents()
|
1318 |
1626 |
self.validate()
|
1319 |
1627 |
|
1320 |
1628 |
def show_BatteryLimit(self):
|
... | ... | |
1322 |
1630 |
|
1323 |
1631 |
dialog = QBatteryLimit()
|
1324 |
1632 |
if dialog.show_dialog(self):
|
1325 |
|
self.build_label()
|
|
1633 |
self.update_label_contents()
|
1326 |
1634 |
self.validate()
|
1327 |
1635 |
|
1328 |
1636 |
def show_Tray(self):
|
... | ... | |
1330 |
1638 |
|
1331 |
1639 |
dialog = QTray()
|
1332 |
1640 |
if dialog.show_dialog(self):
|
1333 |
|
self.build_label()
|
|
1641 |
self.update_label_contents()
|
1334 |
1642 |
self.validate()
|
1335 |
1643 |
|
1336 |
1644 |
def show_SinglePacked(self):
|
... | ... | |
1338 |
1646 |
|
1339 |
1647 |
dialog = QSinglePacked()
|
1340 |
1648 |
if dialog.show_dialog(self):
|
1341 |
|
self.build_label()
|
|
1649 |
self.update_label_contents()
|
1342 |
1650 |
self.validate()
|
1343 |
1651 |
|
1344 |
1652 |
def show_DualPacked(self):
|
... | ... | |
1346 |
1654 |
|
1347 |
1655 |
dialog = QDualPacked()
|
1348 |
1656 |
if dialog.show_dialog(self):
|
1349 |
|
self.build_label()
|
|
1657 |
self.update_label_contents()
|
1350 |
1658 |
self.validate()
|
1351 |
1659 |
|
1352 |
1660 |
def show_Drum_Horizontal(self):
|
... | ... | |
1354 |
1662 |
|
1355 |
1663 |
dialog = QDrum_Horizontal()
|
1356 |
1664 |
if dialog.show_dialog(self):
|
1357 |
|
self.build_label()
|
|
1665 |
self.update_label_contents()
|
1358 |
1666 |
self.validate()
|
1359 |
1667 |
|
1360 |
1668 |
def show_Drum_Vertical(self):
|
... | ... | |
1362 |
1670 |
|
1363 |
1671 |
dialog = QDrum_Vertical()
|
1364 |
1672 |
if dialog.show_dialog(self):
|
1365 |
|
self.build_label()
|
|
1673 |
self.update_label_contents()
|
1366 |
1674 |
self.validate()
|
1367 |
1675 |
|
1368 |
1676 |
def show_PlateHeatExchanger(self):
|
... | ... | |
1370 |
1678 |
|
1371 |
1679 |
dialog = QPlateHeatExchanger()
|
1372 |
1680 |
if dialog.show_dialog(self):
|
1373 |
|
self.build_label()
|
|
1681 |
self.update_label_contents()
|
1374 |
1682 |
self.validate()
|
1375 |
1683 |
|
1376 |
1684 |
def show_Equipment(self):
|
... | ... | |
1378 |
1686 |
|
1379 |
1687 |
dialog = QEquipment()
|
1380 |
1688 |
if dialog.show_dialog(self):
|
1381 |
|
self.build_label()
|
|
1689 |
self.update_label_contents()
|
1382 |
1690 |
self.validate()
|
1383 |
1691 |
|
1384 |
1692 |
def show_Ball(self):
|
... | ... | |
1386 |
1694 |
|
1387 |
1695 |
dialog = QBall()
|
1388 |
1696 |
if dialog.show_dialog(self):
|
1389 |
|
self.build_label()
|
|
1697 |
self.update_label_contents()
|
1390 |
1698 |
self.validate()
|
1391 |
1699 |
|
1392 |
1700 |
def show_ShlTubHeatExchanger(self):
|
... | ... | |
1394 |
1702 |
|
1395 |
1703 |
dialog = QShlTubHeatExchanger()
|
1396 |
1704 |
if dialog.show_dialog(self):
|
1397 |
|
self.build_label()
|
|
1705 |
self.update_label_contents()
|
1398 |
1706 |
self.validate()
|
1399 |
1707 |
|
1400 |
1708 |
def show_ConeRoof(self):
|
... | ... | |
1402 |
1710 |
|
1403 |
1711 |
dialog = QConeRoof()
|
1404 |
1712 |
if dialog.show_dialog(self):
|
1405 |
|
self.build_label()
|
|
1713 |
self.update_label_contents()
|
1406 |
1714 |
self.validate()
|
1407 |
1715 |
|
1408 |
1716 |
def show_DomeRoof(self):
|
... | ... | |
1410 |
1718 |
|
1411 |
1719 |
dialog = QDomeRoof()
|
1412 |
1720 |
if dialog.show_dialog(self):
|
1413 |
|
self.build_label()
|
|
1721 |
self.update_label_contents()
|
1414 |
1722 |
self.validate()
|
1415 |
1723 |
|
1416 |
1724 |
def show_Compressor(self):
|
... | ... | |
1418 |
1726 |
|
1419 |
1727 |
dialog = QCompressor()
|
1420 |
1728 |
if dialog.show_dialog(self):
|
1421 |
|
self.build_label()
|
|
1729 |
self.update_label_contents()
|
1422 |
1730 |
self.validate()
|
1423 |
1731 |
|
1424 |
1732 |
def show_Kompressor(self):
|
... | ... | |
1426 |
1734 |
|
1427 |
1735 |
dialog = QKompressor()
|
1428 |
1736 |
if dialog.show_dialog(self):
|
1429 |
|
self.build_label()
|
|
1737 |
self.update_label_contents()
|
1430 |
1738 |
self.validate()
|
1431 |
1739 |
|
1432 |
1740 |
def show_Pump(self):
|
... | ... | |
1434 |
1742 |
|
1435 |
1743 |
dialog = QPump()
|
1436 |
1744 |
if dialog.show_dialog(self):
|
1437 |
|
self.build_label()
|
|
1745 |
self.update_label_contents()
|
1438 |
1746 |
self.validate()
|
1439 |
1747 |
|
1440 |
1748 |
def show_ValveControl(self):
|
... | ... | |
1442 |
1750 |
|
1443 |
1751 |
dialog = QValve_Control()
|
1444 |
1752 |
if dialog.show_dialog(self):
|
1445 |
|
self.build_label()
|
|
1753 |
self.update_label_contents()
|
1446 |
1754 |
self.validate()
|
1447 |
1755 |
|
1448 |
1756 |
def show_ValveManual(self):
|
... | ... | |
1450 |
1758 |
|
1451 |
1759 |
dialog = QValve_Manual()
|
1452 |
1760 |
if dialog.show_dialog(self):
|
1453 |
|
self.build_label()
|
|
1761 |
self.update_label_contents()
|
1454 |
1762 |
self.validate()
|
1455 |
1763 |
|
1456 |
1764 |
def show_LineSplitter(self):
|
... | ... | |
1458 |
1766 |
|
1459 |
1767 |
dialog = QLineSplitter()
|
1460 |
1768 |
if dialog.show_dialog(self):
|
1461 |
|
self.build_label()
|
|
1769 |
self.update_label_contents()
|
1462 |
1770 |
self.validate()
|
1463 |
1771 |
|
1464 |
1772 |
def show_Flowmeter(self):
|
... | ... | |
1466 |
1774 |
|
1467 |
1775 |
dialog = QFlowmeter()
|
1468 |
1776 |
if dialog.show_dialog(self):
|
1469 |
|
self.build_label()
|
|
1777 |
self.update_label_contents()
|
1470 |
1778 |
self.validate()
|
1471 |
1779 |
|
1472 |
1780 |
def show_Reducer(self):
|
... | ... | |
1474 |
1782 |
|
1475 |
1783 |
dialog = QReducer()
|
1476 |
1784 |
if dialog.show_dialog(self):
|
1477 |
|
self.build_label()
|
|
1785 |
self.update_label_contents()
|
1478 |
1786 |
self.validate()
|
1479 |
1787 |
|
1480 |
1788 |
@staticmethod
|
... | ... | |
1718 |
2026 |
self.connectors.append(connector)
|
1719 |
2027 |
|
1720 |
2028 |
# set label
|
1721 |
|
label = QEngineeringEqpDescTextItem('eqp name<br>pressure drop<br>elevation', self)
|
|
2029 |
label = QEngineeringEqpDescTextItem('', self)
|
1722 |
2030 |
self.desc_labels[connector] = label
|
1723 |
2031 |
|
1724 |
|
'''
|
1725 |
|
'''
|
1726 |
|
|
1727 |
2032 |
def refreshConnector(self):
|
1728 |
2033 |
for connector in self.connectors:
|
1729 |
2034 |
connector.buildItem()
|