summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuchita Lad2024-11-11 17:51:47 +0530
committerSuchita Lad2024-11-11 17:51:47 +0530
commitd1a11cefd5676db6cdb265f7790f601d53f6a338 (patch)
tree041504a5d19853c71dcdf4a610dd8be989e8fcec
parent707bd058811641119d5d15a7e82f8adda13273af (diff)
downloadCommon-Interface-Project-d1a11cefd5676db6cdb265f7790f601d53f6a338.tar.gz
Common-Interface-Project-d1a11cefd5676db6cdb265f7790f601d53f6a338.tar.bz2
Common-Interface-Project-d1a11cefd5676db6cdb265f7790f601d53f6a338.zip
switch sourcepoint and targetpoint
-rwxr-xr-xblocks/Xcos/MxGraphParser.py14
-rw-r--r--blocks/eda-frontend/public/splitblock.xsl16
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js32
3 files changed, 38 insertions, 24 deletions
diff --git a/blocks/Xcos/MxGraphParser.py b/blocks/Xcos/MxGraphParser.py
index a3da90b4..bf28634a 100755
--- a/blocks/Xcos/MxGraphParser.py
+++ b/blocks/Xcos/MxGraphParser.py
@@ -470,16 +470,16 @@ for (attribid, sourceVertex, targetVertex, sourceType, targetType, style, waypoi
port3 = nextattribid
(inputCount, outputCount, nextattribid, nextAttribForSplit) = addPort3ForSplit(outroot, splitblockid, sourceVertex, targetVertex, sourceType, targetType, sourceType2, targetType2, inputCount, outputCount, nextattribid, nextAttribForSplit, array3)
print('nextAttribForSplit3:', nextAttribForSplit)
- newEdgeDict[attribid2][i] = ((nextAttribForSplit, sourceVertex2, port1, sourceType2, targetType, style2, left_array, addSplit2, split_point2))
+ newEdgeDict[attribid2][i] = ((nextAttribForSplit, sourceVertex2, port1, sourceType2, targetType, style2, left_array, addSplit2, split_point, split_point2))
nextAttribForSplit += 1
- newEdgeDict[attribid2].insert(i + 1, (nextAttribForSplit, port2, targetVertex2, sourceType, targetType2, style2, right_array, addSplit2, split_point2))
+ newEdgeDict[attribid2].insert(i + 1, (nextAttribForSplit, port2, targetVertex2, sourceType, targetType2, style2, right_array, addSplit2, split_point, split_point2))
nextAttribForSplit += 1
- for (__, __, __, __, __, __, tmp_array, __, tmp_split_point) in newEdgeDict[attribid2]:
- print('NEWEDGE2:', attribid2, tmp_array, tmp_split_point)
- newEdgeDict[attribid] = [(nextAttribForSplit, port3, targetVertex, sourceType, targetType, style, waypoints, addSplit, split_point)]
+ for (__, __, __, __, __, __, tmp_array, __, tmp_split_point, tmp_split_point2) in newEdgeDict[attribid2]:
+ print('NEWEDGE2:', attribid2, tmp_array, tmp_split_point, tmp_split_point2)
+ newEdgeDict[attribid] = [(nextAttribForSplit, port3, targetVertex, sourceType, targetType, style, waypoints, addSplit, split_point, split_point2)]
nextAttribForSplit += 1
- for (__, __, __, __, __, __, tmp_array, __, tmp_split_point) in newEdgeDict[attribid]:
- print('NEWEDGE3:', attribid, tmp_array, tmp_split_point)
+ for (__, __, __, __, __, __, tmp_array, __, tmp_split_point, tmp_split_point2) in newEdgeDict[attribid]:
+ print('NEWEDGE3:', attribid, tmp_array, tmp_split_point, tmp_split_point2)
print()
for key, newEdges in newEdgeDict.items():
diff --git a/blocks/eda-frontend/public/splitblock.xsl b/blocks/eda-frontend/public/splitblock.xsl
index 7f39baca..0e9710a2 100644
--- a/blocks/eda-frontend/public/splitblock.xsl
+++ b/blocks/eda-frontend/public/splitblock.xsl
@@ -440,8 +440,8 @@
<!-- targetoneblockx, targetoneblocky, sourceoneblockx, sourceoneblocky: find x, y position of other (tgt|src) ports connected to links connected to (src|tgt) ports connected to splitblock (value) {{{ -->
<xsl:variable name="targetonelinkassort">
<xsl:choose>
- <xsl:when test="$targetoneid = $targetonelink/@source">sourcePoint</xsl:when>
- <xsl:when test="$targetoneid = $targetonelink/@target">targetPoint</xsl:when>
+ <xsl:when test="$targetoneid = $targetonelink/@source">targetPoint</xsl:when>
+ <xsl:when test="$targetoneid = $targetonelink/@target">sourcePoint</xsl:when>
<xsl:otherwise>No match found</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -473,8 +473,8 @@
<xsl:variable name="sourceonelinkassort">
<xsl:choose>
- <xsl:when test="$sourceoneid = $sourceonelink/@source">sourcePoint</xsl:when>
- <xsl:when test="$sourceoneid = $sourceonelink/@target">targetPoint</xsl:when>
+ <xsl:when test="$sourceoneid = $sourceonelink/@source">targetPoint</xsl:when>
+ <xsl:when test="$sourceoneid = $sourceonelink/@target">sourcePoint</xsl:when>
<xsl:otherwise>No match found</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -506,8 +506,8 @@
<xsl:variable name="sourcetwolinkassort">
<xsl:choose>
- <xsl:when test="$sourcetwoid = $sourcetwolink/@source">sourcePoint</xsl:when>
- <xsl:when test="$sourcetwoid = $sourcetwolink/@target">targetPoint</xsl:when>
+ <xsl:when test="$sourcetwoid = $sourcetwolink/@source">targetPoint</xsl:when>
+ <xsl:when test="$sourcetwoid = $sourcetwolink/@target">sourcePoint</xsl:when>
<xsl:otherwise>No match found</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -539,8 +539,8 @@
<xsl:variable name="sourcethreelinkassort">
<xsl:choose>
- <xsl:when test="$sourcethreeid = $sourcethreelink/@source">sourcePoint</xsl:when>
- <xsl:when test="$sourcethreeid = $sourcethreelink/@target">targetPoint</xsl:when>
+ <xsl:when test="$sourcethreeid = $sourcethreelink/@source">targetPoint</xsl:when>
+ <xsl:when test="$sourcethreeid = $sourcethreelink/@target">sourcePoint</xsl:when>
<xsl:otherwise>No match found</xsl:otherwise>
</xsl:choose>
</xsl:variable>
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js
index 4adffec8..caf3379c 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js
@@ -672,21 +672,29 @@ function parseXmlToGraph (xmlDoc, graph) {
const tmp = source
source = target
target = tmp
+ console.log('sourceCell:', sourceCell)
const tmpCell = sourceCell
sourceCell = targetCell
targetCell = tmpCell
+ // const tmpsourcePoint = sourcePoint
+ // sourcePoint = targetPoint
+ // targetPoint = tmpsourcePoint
points.reverse()
}
try {
const edge = graph.insertEdge(parent, edgeId, null, sourceCell, targetCell)
+ console.log('Points:', points)
edge.geometry.points = points
const terminalPoint = new mxPoint(Number(cellAttrs.tarx.value), Number(cellAttrs.tary.value))
+ const terminalPoint2 = new mxPoint(Number(cellAttrs.tar2x.value), Number(cellAttrs.tar2y.value))
if (targetCell?.edge === true) {
- edge.geometry.setTerminalPoint(terminalPoint, false)
- } else if (sourceCell?.edge === true) {
+ edge.geometry.setTerminalPoint(terminalPoint2, false)
+ }
+ if (sourceCell?.edge === true) {
edge.geometry.setTerminalPoint(terminalPoint, true)
}
+ console.log('edge:', edge)
} catch (e) {
console.log(sourceCell)
console.log(targetCell)
@@ -731,18 +739,24 @@ function xmlWireConnections () {
if (edge.source === null || edge.target === null) {
continue
}
-
+ console.log('edge.source:', edge, edge.source)
edge.sourceVertex = edge.source.id
edge.targetVertex = edge.target.id
- if (edge.target.edge === true) {
- edge.tarx = edge.geometry.targetPoint.x
- edge.tary = edge.geometry.targetPoint.y
- } else if (edge.source.edge === true) {
+ console.log('outside if', edge.source.edge, edge.target.edge)
+ if (edge.source.edge === true) {
+
edge.tarx = edge.geometry.sourcePoint.x
edge.tary = edge.geometry.sourcePoint.y
- } else {
- edge.node = '.' + edge.source.value
+ console.log('tarx', edge.tarx, edge.tary)
}
+ if (edge.target.edge === true) {
+
+ edge.tar2x = edge.geometry.targetPoint.x
+ edge.tar2y = edge.geometry.targetPoint.y
+ console.log('tar2x', edge.tar2x, edge.tar2y)
+ }
+
+
console.log('Check the wires here', edge.sourceVertex, edge.targetVertex)
}
}