Skip to content

Commit c855660

Browse files
committed
Updated XmlParser for geometry of Splitblock
1 parent 1664348 commit c855660

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

blocks/Xcos/XmlParser.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def mergeLinks(vertex, key1, graph_link, removable_link):
533533
print(f"removable link: k: {k}, link: {r_link_0}")
534534
node = nodeList[r_link_0]
535535
link_data = edgeDict[r_link_0] # small removed link
536-
# print("#LINKDATA#:", link_data)
536+
print("#LINKDATA#:", link_data)
537537
print("#NODEATTRIB#:", node.attrib)
538538

539539
sourceVertex = link_data[1] # small link
@@ -548,26 +548,26 @@ def mergeLinks(vertex, key1, graph_link, removable_link):
548548
link_data2 = edgeDict[sourceVertex] # big removed link
549549

550550
thisVertex = sourceVertex
551-
thisx = link_data[9]['x']
552-
thisy = link_data[9]['y']
551+
thisx = link_data[8]['x']
552+
thisy = link_data[8]['y']
553553

554554
otherVertex = targetVertex
555-
otherx = link_data[8]['x']
556-
othery = link_data[8]['y']
555+
otherx = link_data[9]['x']
556+
othery = link_data[9]['y']
557557

558558
split_point = link_data[8]
559559

560560
elif targetVertex in link:
561561
node2 = nodeList[targetVertex]
562562
link_data2 = edgeDict[targetVertex] # big removed link
563563

564-
otherVertex = sourceVertex
565-
otherx = link_data[9]['x']
566-
othery = link_data[9]['y']
567-
568564
thisVertex = targetVertex
569-
thisx = link_data[8]['x']
570-
thisy = link_data[8]['y']
565+
thisx = link_data[9]['x']
566+
thisy = link_data[9]['y']
567+
568+
otherVertex = sourceVertex
569+
otherx = link_data[8]['x']
570+
othery = link_data[8]['y']
571571

572572
split_point = link_data[9]
573573

@@ -591,8 +591,8 @@ def mergeLinks(vertex, key1, graph_link, removable_link):
591591
tType = IDLIST[otherVertex]
592592
sType2 = IDLIST[sourceVertex2]
593593
tType2 = IDLIST[targetVertex2]
594-
height = 7
595-
width = 7
594+
height = '7.0'
595+
width = '7.0'
596596
# print("LINKDATA:", link_data)
597597
# print("LINKDATA2:", link_data2)
598598
# print("#NODEATTRIB2#:", node2.attrib)

blocks/Xcos/blocks/SplitBlock.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def SplitBlock(outroot, attribid, ordering, geometry, parameters, parent=1, styl
3030
addObjNode(outnode, TYPE_ARRAY, CLASS_LIST, AS_ODSTATE, [])
3131
addObjNode(outnode, TYPE_ARRAY, CLASS_LIST, AS_EQUATIONS, [])
3232
addNode(outnode, 'mxGeometry', **{'as': 'geometry'},
33-
height=geometry['height'], width=geometry['width'],
34-
x=geometry['x'], y=geometry['y'])
33+
x=geometry['x'], y=geometry['y'],
34+
width=geometry['width'], height=geometry['height']
35+
)
3536

3637
return outnode
3738

0 commit comments

Comments
 (0)