개정판 c2a462bc
issue #1062: 속성 수정 후 입력 데이타 유효성을 화면에 표시
Change-Id: Ida2e6dcb10c694cf58720bc296a49fcaf3c80515
HYTOS/HYTOS/Shapes/EngineeringConnectorItem.py | ||
---|---|---|
276 | 276 |
else: |
277 | 277 |
self.connectedItem = None |
278 | 278 |
|
279 |
if self.connectedItem: |
|
280 |
self.setBrush(Qt.red) if self.validate() else self.setBrush(Qt.yellow) |
|
281 |
else: |
|
282 |
self.setBrush(Qt.blue) |
|
279 |
self.update() |
|
283 | 280 |
|
284 | 281 |
def hoverEnterEvent(self, event): |
285 | 282 |
"""highlight connector""" |
... | ... | |
484 | 481 |
def paint(self, painter, options=None, widget=None): |
485 | 482 |
from SymbolSvgItem import SymbolSvgItem |
486 | 483 |
|
484 |
if self.connectedItem: |
|
485 |
self.setBrush(Qt.red) if self.validate() else self.setBrush(Qt.yellow) |
|
486 |
else: |
|
487 |
self.setBrush(Qt.blue) |
|
488 |
|
|
487 | 489 |
QGraphicsEllipseItem.paint(self, painter, options, widget) |
488 | 490 |
if type(self.parentItem()) is SymbolSvgItem: |
489 | 491 |
painter.setFont(self._font) |
HYTOS/HYTOS/Shapes/SymbolSvgItem.py | ||
---|---|---|
629 | 629 |
(connector.connectedItem == item and (connector._connected_at == at if at else True))] |
630 | 630 |
return len(_connectors) > 0 |
631 | 631 |
|
632 |
def next_connected(self, lhs, rhs): |
|
633 |
""" check given two item's are next connected(ex: 0-1, 2-3) """ |
|
634 |
|
|
635 |
lhs_matches = [at for at in range(len(self.connectors)) if self.connectors[at].connectedItem == lhs] |
|
636 |
rhs_matches = [at for at in range(len(self.connectors)) if self.connectors[at].connectedItem == rhs] |
|
637 |
if lhs_matches and rhs_matches: |
|
638 |
return (lhs_matches[0] in [0, 1] and rhs_matches[0] in [0, 1]) or ( |
|
639 |
lhs_matches[0] in [2, 3] and rhs_matches[0] in [2, 3]) |
|
640 |
|
|
641 |
return False |
|
642 |
|
|
643 | 632 |
''' |
644 | 633 |
@brief connect line and symbol is able to be connected and return line |
645 | 634 |
@author humkyung |
... | ... | |
695 | 684 |
return res |
696 | 685 |
|
697 | 686 |
''' |
698 |
@brief disconnect connector item |
|
699 |
@author kyouho |
|
700 |
@date 2018.08.30 |
|
701 |
''' |
|
702 |
|
|
703 |
def disconnectedItemAtConnector(self, connector): |
|
704 |
for conn in self.connectors: |
|
705 |
if conn.isOverlapConnector(connector): |
|
706 |
conn.connectedItem = None |
|
707 |
|
|
708 |
''' |
|
709 | 687 |
@brief get connection point close to given point in tolerance |
710 | 688 |
@author humkyung |
711 | 689 |
@dat |
... | ... | |
983 | 961 |
msg.exec_() |
984 | 962 |
return |
985 | 963 |
|
986 |
matches = [func for func in func_map if func[0][0] == self.category and func[0][1] == self.type and (
|
|
987 |
func[0][2] is None or self.name in func[0][2])] |
|
964 |
matches = [func for func in func_map if func[0][0] == self.category and func[0][1] == self.type and |
|
965 |
(func[0][2] is None or self.name in func[0][2])]
|
|
988 | 966 |
if matches: matches[0][1]() |
989 | 967 |
|
990 | 968 |
def show_AirFinCooler(self): |
... | ... | |
993 | 971 |
dialog = QAirFinCooler() |
994 | 972 |
if dialog.show_dialog(self): |
995 | 973 |
self.build_label() |
974 |
self.update() |
|
996 | 975 |
|
997 | 976 |
def show_Filter(self): |
998 | 977 |
from Filter import QFilter |
... | ... | |
1000 | 979 |
dialog = QFilter() |
1001 | 980 |
if dialog.show_dialog(self): |
1002 | 981 |
self.build_label() |
982 |
self.update() |
|
1003 | 983 |
|
1004 | 984 |
def show_Coil(self): |
1005 | 985 |
from Coil import QCoil |
... | ... | |
1007 | 987 |
dialog = QCoil() |
1008 | 988 |
if dialog.show_dialog(self): |
1009 | 989 |
self.build_label() |
990 |
self.update() |
|
1010 | 991 |
|
1011 | 992 |
def show_DP_Equipment(self): |
1012 | 993 |
from DP_Equipment import QDP_Equipment |
... | ... | |
1014 | 995 |
dialog = QDP_Equipment() |
1015 | 996 |
if dialog.show_dialog(self): |
1016 | 997 |
self.build_label() |
998 |
self.update() |
|
1017 | 999 |
|
1018 | 1000 |
def show_Reactor(self): |
1019 | 1001 |
from Reactor import QReactor |
... | ... | |
1021 | 1003 |
dialog = QReactor() |
1022 | 1004 |
if dialog.show_dialog(self): |
1023 | 1005 |
self.build_label() |
1006 |
self.update() |
|
1024 | 1007 |
|
1025 | 1008 |
def show_Strainer_T(self): |
1026 | 1009 |
from Strainer_T import QStrainer_T |
... | ... | |
1028 | 1011 |
dialog = QStrainer_T() |
1029 | 1012 |
if dialog.show_dialog(self): |
1030 | 1013 |
self.build_label() |
1014 |
self.update() |
|
1031 | 1015 |
|
1032 | 1016 |
def show_Strainer_Y(self): |
1033 | 1017 |
from Strainer_Y import QStrainer_Y |
... | ... | |
1035 | 1019 |
dialog = QStrainer_Y() |
1036 | 1020 |
if dialog.show_dialog(self): |
1037 | 1021 |
self.build_label() |
1022 |
self.update() |
|
1038 | 1023 |
|
1039 | 1024 |
def show_BatteryLimit(self): |
1040 | 1025 |
from BatteryLimit import QBatteryLimit |
... | ... | |
1042 | 1027 |
dialog = QBatteryLimit() |
1043 | 1028 |
if dialog.show_dialog(self): |
1044 | 1029 |
self.build_label() |
1030 |
self.update() |
|
1045 | 1031 |
|
1046 | 1032 |
def show_Tray(self): |
1047 | 1033 |
from Tray import QTray |
... | ... | |
1049 | 1035 |
dialog = QTray() |
1050 | 1036 |
if dialog.show_dialog(self): |
1051 | 1037 |
self.build_label() |
1038 |
self.update() |
|
1052 | 1039 |
|
1053 | 1040 |
def show_SinglePacked(self): |
1054 | 1041 |
from SinglePacked import QSinglePacked |
... | ... | |
1056 | 1043 |
dialog = QSinglePacked() |
1057 | 1044 |
if dialog.show_dialog(self): |
1058 | 1045 |
self.build_label() |
1046 |
self.update() |
|
1059 | 1047 |
|
1060 | 1048 |
def show_DualPacked(self): |
1061 | 1049 |
from DualPacked import QDualPacked |
... | ... | |
1063 | 1051 |
dialog = QDualPacked() |
1064 | 1052 |
if dialog.show_dialog(self): |
1065 | 1053 |
self.build_label() |
1054 |
self.update() |
|
1066 | 1055 |
|
1067 | 1056 |
def show_Drum_Horizontal(self): |
1068 | 1057 |
from Drum_Horizontal import QDrum_Horizontal |
... | ... | |
1070 | 1059 |
dialog = QDrum_Horizontal() |
1071 | 1060 |
if dialog.show_dialog(self): |
1072 | 1061 |
self.build_label() |
1062 |
self.update() |
|
1073 | 1063 |
|
1074 | 1064 |
def show_Drum_Vertical(self): |
1075 | 1065 |
from Drum_Vertical import QDrum_Vertical |
... | ... | |
1077 | 1067 |
dialog = QDrum_Vertical() |
1078 | 1068 |
if dialog.show_dialog(self): |
1079 | 1069 |
self.build_label() |
1070 |
self.update() |
|
1080 | 1071 |
|
1081 | 1072 |
def show_PlateHeatExchanger(self): |
1082 | 1073 |
from PlateHeatExchanger import QPlateHeatExchanger |
... | ... | |
1084 | 1075 |
dialog = QPlateHeatExchanger() |
1085 | 1076 |
if dialog.show_dialog(self): |
1086 | 1077 |
self.build_label() |
1078 |
self.update() |
|
1087 | 1079 |
|
1088 | 1080 |
def show_Equipment(self): |
1089 | 1081 |
from Equipment import QEquipment |
... | ... | |
1091 | 1083 |
dialog = QEquipment() |
1092 | 1084 |
if dialog.show_dialog(self): |
1093 | 1085 |
self.build_label() |
1086 |
self.update() |
|
1094 | 1087 |
|
1095 | 1088 |
def show_Ball(self): |
1096 | 1089 |
from Ball import QBall |
... | ... | |
1098 | 1091 |
dialog = QBall() |
1099 | 1092 |
if dialog.show_dialog(self): |
1100 | 1093 |
self.build_label() |
1094 |
self.update() |
|
1101 | 1095 |
|
1102 | 1096 |
def show_ShlTubHeatExchanger(self): |
1103 | 1097 |
from ShlTubHeatExchanger import QShlTubHeatExchanger |
... | ... | |
1105 | 1099 |
dialog = QShlTubHeatExchanger() |
1106 | 1100 |
if dialog.show_dialog(self): |
1107 | 1101 |
self.build_label() |
1102 |
self.update() |
|
1108 | 1103 |
|
1109 | 1104 |
def show_ConeRoof(self): |
1110 | 1105 |
from ConeRoof import QConeRoof |
... | ... | |
1112 | 1107 |
dialog = QConeRoof() |
1113 | 1108 |
if dialog.show_dialog(self): |
1114 | 1109 |
self.build_label() |
1110 |
self.update() |
|
1115 | 1111 |
|
1116 | 1112 |
def show_DomeRoof(self): |
1117 | 1113 |
from DomeRoof import QDomeRoof |
... | ... | |
1119 | 1115 |
dialog = QDomeRoof() |
1120 | 1116 |
if dialog.show_dialog(self): |
1121 | 1117 |
self.build_label() |
1118 |
self.update() |
|
1122 | 1119 |
|
1123 | 1120 |
def show_Compressor(self): |
1124 | 1121 |
from Compressor import QCompressor |
... | ... | |
1126 | 1123 |
dialog = QCompressor() |
1127 | 1124 |
if dialog.show_dialog(self): |
1128 | 1125 |
self.build_label() |
1126 |
self.update() |
|
1129 | 1127 |
|
1130 | 1128 |
def show_Kompressor(self): |
1131 | 1129 |
from Kompressor import QKompressor |
... | ... | |
1133 | 1131 |
dialog = QKompressor() |
1134 | 1132 |
if dialog.show_dialog(self): |
1135 | 1133 |
self.build_label() |
1134 |
self.update() |
|
1136 | 1135 |
|
1137 | 1136 |
def show_Pump(self): |
1138 | 1137 |
from Pump import QPump |
... | ... | |
1140 | 1139 |
dialog = QPump() |
1141 | 1140 |
if dialog.show_dialog(self): |
1142 | 1141 |
self.build_label() |
1142 |
self.update() |
|
1143 | 1143 |
|
1144 | 1144 |
def show_ValveControl(self): |
1145 | 1145 |
from Valve_Control import QValve_Control |
... | ... | |
1147 | 1147 |
dialog = QValve_Control() |
1148 | 1148 |
if dialog.show_dialog(self): |
1149 | 1149 |
self.build_label() |
1150 |
self.update() |
|
1150 | 1151 |
|
1151 | 1152 |
def show_ValveManual(self): |
1152 | 1153 |
from Valve_Manual import QValve_Manual |
... | ... | |
1154 | 1155 |
dialog = QValve_Manual() |
1155 | 1156 |
if dialog.show_dialog(self): |
1156 | 1157 |
self.build_label() |
1158 |
self.update() |
|
1157 | 1159 |
|
1158 | 1160 |
def show_LineSplitter(self): |
1159 | 1161 |
from LineSplitter import QLineSplitter |
... | ... | |
1161 | 1163 |
dialog = QLineSplitter() |
1162 | 1164 |
if dialog.show_dialog(self): |
1163 | 1165 |
self.build_label() |
1166 |
self.update() |
|
1164 | 1167 |
|
1165 | 1168 |
def show_Flowmeter(self): |
1166 | 1169 |
from Flowmeter import QFlowmeter |
... | ... | |
1168 | 1171 |
dialog = QFlowmeter() |
1169 | 1172 |
if dialog.show_dialog(self): |
1170 | 1173 |
self.build_label() |
1174 |
self.update() |
|
1171 | 1175 |
|
1172 | 1176 |
def show_Reducer(self): |
1173 | 1177 |
from Reducer import QReducer |
... | ... | |
1175 | 1179 |
dialog = QReducer() |
1176 | 1180 |
if dialog.show_dialog(self): |
1177 | 1181 |
self.build_label() |
1182 |
self.update() |
|
1178 | 1183 |
|
1179 | 1184 |
@staticmethod |
1180 | 1185 |
def fromDatabase(componentInfos): |
내보내기 Unified diff