개정판 d9b600a4
cad spec ongoing
Change-Id: I5b007ea3d2e7d9b0faf823da859faded1afaf8b4
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
895 | 895 |
for conn in symbol.connectors: |
896 | 896 |
dist = originPoint.distance(Point(conn.sceneConnectPoint[0], conn.sceneConnectPoint[1])) |
897 | 897 |
if not conn.connectedItem or not issubclass(type(conn.connectedItem), QEngineeringAbstractItem) or \ |
898 |
[pair for pair in usedItemPairs if symbol in pair and conn.connectedItem in pair] or dist > 2.5 * toler or dist > minD:
|
|
898 |
[pair for pair in usedItemPairs if symbol in pair and conn.connectedItem in pair] or dist > 3 * toler or dist > minD:
|
|
899 | 899 |
continue |
900 | 900 |
|
901 | 901 |
minD = dist |
... | ... | |
907 | 907 |
dist = originPoint.distance(Point(conn.sceneConnectPoint[0], conn.sceneConnectPoint[1])) |
908 | 908 |
if not conn.connectedItem or not issubclass(type(conn.connectedItem), QEngineeringAbstractItem) or \ |
909 | 909 |
conn._connected_at != QEngineeringAbstractItem.CONNECTED_AT_BODY or \ |
910 |
[pair for pair in usedItemPairs if line in pair and conn.connectedItem in pair] or dist > 2.5 * toler or dist > minD:
|
|
910 |
[pair for pair in usedItemPairs if line in pair and conn.connectedItem in pair] or dist > 3 * toler or dist > minD:
|
|
911 | 911 |
continue |
912 | 912 |
|
913 | 913 |
minD = dist |
... | ... | |
926 | 926 |
# connect spec break |
927 | 927 |
usedItemPairs = [] |
928 | 928 |
for spec_break in spec_breaks: |
929 |
up = [attr.AssocItem for attr in spec_break if attr.Attribute == 'UpStream'] |
|
930 |
down = [attr.AssocItem for attr in spec_break if attr.Attribute == 'DownStream'] |
|
931 |
if spec_break.prop('Freeze') or up or down: |
|
929 |
attrs = spec_break.getAttributes() |
|
930 |
up = [attr.AssocItem for attr in attrs if attr.Attribute == 'UpStream'] |
|
931 |
down = [attr.AssocItem for attr in attrs if attr.Attribute == 'DownStream'] |
|
932 |
if spec_break.prop('Freeze') or (up and up[0]) or (down and down[0]): |
|
932 | 933 |
usedItemPairs.append([up, down]) |
933 | 934 |
|
934 | 935 |
for spec_break in spec_breaks: |
935 |
up = [attr.AssocItem for attr in spec_break if attr.Attribute == 'UpStream'] |
|
936 |
down = [attr.AssocItem for attr in spec_break if attr.Attribute == 'DownStream'] |
|
937 |
if spec_break.prop('Freeze') or up or down: |
|
936 |
attrs = spec_break.getAttributes() |
|
937 |
up = [attr.AssocItem for attr in attrs if attr.Attribute == 'UpStream'] |
|
938 |
down = [attr.AssocItem for attr in attrs if attr.Attribute == 'DownStream'] |
|
939 |
if spec_break.prop('Freeze') or (up and up[0]) or (down and down[0]): |
|
938 | 940 |
continue |
939 | 941 |
|
940 | 942 |
originPoint = Point(spec_break.origin[0], spec_break.origin[1]) |
... | ... | |
946 | 948 |
for conn in symbol.connectors: |
947 | 949 |
dist = originPoint.distance(Point(conn.sceneConnectPoint[0], conn.sceneConnectPoint[1])) |
948 | 950 |
if not conn.connectedItem or not issubclass(type(conn.connectedItem), QEngineeringAbstractItem) or \ |
949 |
[pair for pair in usedItemPairs if symbol in pair and conn.connectedItem in pair] or dist > 2.5 * toler or dist > minD:
|
|
951 |
[pair for pair in usedItemPairs if symbol in pair and conn.connectedItem in pair] or dist > 5 * toler or dist > minD: |
|
950 | 952 |
continue |
951 | 953 |
|
952 | 954 |
minD = dist |
... | ... | |
958 | 960 |
dist = originPoint.distance(Point(conn.sceneConnectPoint[0], conn.sceneConnectPoint[1])) |
959 | 961 |
if not conn.connectedItem or not issubclass(type(conn.connectedItem), QEngineeringAbstractItem) or \ |
960 | 962 |
conn._connected_at != QEngineeringAbstractItem.CONNECTED_AT_BODY or \ |
961 |
[pair for pair in usedItemPairs if line in pair and conn.connectedItem in pair] or dist > 2.5 * toler or dist > minD:
|
|
963 |
[pair for pair in usedItemPairs if line in pair and conn.connectedItem in pair] or dist > 5 * toler or dist > minD: |
|
962 | 964 |
continue |
963 | 965 |
|
964 | 966 |
minD = dist |
... | ... | |
972 | 974 |
attrs[key] = str(upItem) |
973 | 975 |
spec_break.add_assoc_item(upItem, key.AttrAt, force=True) |
974 | 976 |
key.AssocItem = upItem |
977 |
key.Freeze = True |
|
975 | 978 |
elif key.Attribute == 'DownStream': |
976 | 979 |
attrs[key] = str(downItem) |
977 | 980 |
spec_break.add_assoc_item(downItem, key.AttrAt, force=True) |
978 | 981 |
key.AssocItem = downItem |
982 |
key.Freeze = True |
|
983 |
spec_break.set_property('Freeze', True) |
|
984 |
spec_break.set_property('Show', True) |
|
979 | 985 |
|
980 | 986 |
usedItemPairs.append([upItem, downItem]) |
981 | 987 |
# up to here |
내보내기 Unified diff