diff options
author | Sunil Shetye | 2024-10-22 11:09:51 +0530 |
---|---|---|
committer | Sunil Shetye | 2024-10-22 11:09:51 +0530 |
commit | 0edff6e11c3984ce70843a855ba0c5098e8ada8c (patch) | |
tree | a2ff63a6112b71a712cb77ee83d5320fa60f31de | |
parent | 9990dcbe1f4e1e456d6d44cb7759a29e9ad2aaa8 (diff) | |
download | Common-Interface-Project-0edff6e11c3984ce70843a855ba0c5098e8ada8c.tar.gz Common-Interface-Project-0edff6e11c3984ce70843a855ba0c5098e8ada8c.tar.bz2 Common-Interface-Project-0edff6e11c3984ce70843a855ba0c5098e8ada8c.zip |
copy mxGeometry in Ports also
-rwxr-xr-x | blocks/Xcos/MxGraphParser.py | 7 | ||||
-rw-r--r-- | blocks/Xcos/common/AAAAAA.py | 6 | ||||
-rw-r--r-- | blocks/Xcos/ports/CommandPort.py | 7 | ||||
-rw-r--r-- | blocks/Xcos/ports/ControlPort.py | 7 | ||||
-rw-r--r-- | blocks/Xcos/ports/ImplicitInputPort.py | 1 | ||||
-rw-r--r-- | blocks/Xcos/ports/ImplicitOutputPort.py | 1 | ||||
-rw-r--r-- | blocks/eda-frontend/public/splitblock.xsl | 1 | ||||
-rw-r--r-- | blocks/simulationAPI/views.py | 2 |
8 files changed, 17 insertions, 15 deletions
diff --git a/blocks/Xcos/MxGraphParser.py b/blocks/Xcos/MxGraphParser.py index 04ebd868..90cd5240 100755 --- a/blocks/Xcos/MxGraphParser.py +++ b/blocks/Xcos/MxGraphParser.py @@ -118,7 +118,8 @@ for root in model: remainingcells = [] cellslength = len(cells) oldcellslength = 0 - while cellslength > 0 and cellslength != oldcellslength : + print('cellslength=', cellslength) + while cellslength > 0 and cellslength != oldcellslength: for cell in cells: try: attrib = cell.attrib @@ -217,14 +218,13 @@ for root in model: sourceVertex = attrib['sourceVertex'] targetVertex = attrib['targetVertex'] - + try: sourceType = IDLIST[sourceVertex] targetType = IDLIST[targetVertex] except KeyError: remainingcells.append(cell) continue - # switch vertices if required if sourceType in ['ExplicitInputPort', 'ImplicitInputPort', 'ControlPort'] and \ @@ -301,7 +301,6 @@ for root in model: cellslength = len(remainingcells) remainingcells = [] print('cellslength=', cellslength, ', oldcellslength=', oldcellslength) - print('EDGES:') for key, value in edgeDict.items(): diff --git a/blocks/Xcos/common/AAAAAA.py b/blocks/Xcos/common/AAAAAA.py index 10ac6d9f..ba72b127 100644 --- a/blocks/Xcos/common/AAAAAA.py +++ b/blocks/Xcos/common/AAAAAA.py @@ -634,13 +634,13 @@ def generate_id(block_count, port_count, link_count): def style_to_object(style): if not style.endswith(';'): style += ';' - + style_object = {} remaining_style = style while remaining_style: index_of_key_value = remaining_style.find(';') - + index_of_key = remaining_style.find('=') if 0 < index_of_key < index_of_key_value: key = remaining_style[:index_of_key] @@ -653,5 +653,5 @@ def style_to_object(style): style_object[key] = value remaining_style = remaining_style[index_of_key_value + 1:] - + return style_object diff --git a/blocks/Xcos/ports/CommandPort.py b/blocks/Xcos/ports/CommandPort.py index 5f937939..7155f3b7 100644 --- a/blocks/Xcos/ports/CommandPort.py +++ b/blocks/Xcos/ports/CommandPort.py @@ -17,9 +17,10 @@ def CommandPort(outroot, attribid, parentattribid, ordering, geometry, return outnode + def addCommandPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, - sourceType, targetType, inputCount, - outputCount, nextAttrib, nextAttribForSplit, waypoints): + sourceType, targetType, inputCount, + outputCount, nextAttrib, nextAttribForSplit, waypoints): outputCount += 1 geometry = {} geometry['width'] = 8 @@ -27,7 +28,7 @@ def addCommandPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, geometry['x'] = 7 geometry['y'] = -4 CommandPort(outroot, nextAttrib, splitBlock, outputCount, geometry, - forSplitBlock=True) + forSplitBlock=True) nextAttrib += 1 nextAttribForSplit += 1 return (inputCount, outputCount, nextAttrib, nextAttribForSplit) diff --git a/blocks/Xcos/ports/ControlPort.py b/blocks/Xcos/ports/ControlPort.py index b7691324..cf09d8cf 100644 --- a/blocks/Xcos/ports/ControlPort.py +++ b/blocks/Xcos/ports/ControlPort.py @@ -17,9 +17,10 @@ def ControlPort(outroot, attribid, parentattribid, ordering, geometry, return outnode + def addControlPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, - sourceType, targetType, inputCount, - outputCount, nextAttrib, nextAttribForSplit, waypoints): + sourceType, targetType, inputCount, + outputCount, nextAttrib, nextAttribForSplit, waypoints): inputCount += 1 geometry = {} geometry['width'] = 8 @@ -27,7 +28,7 @@ def addControlPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, geometry['x'] = -8 geometry['y'] = -4 ControlPort(outroot, nextAttrib, splitBlock, inputCount, geometry, - forSplitBlock=True) + forSplitBlock=True) nextAttrib += 1 nextAttribForSplit += 1 return (inputCount, outputCount, nextAttrib, nextAttribForSplit) diff --git a/blocks/Xcos/ports/ImplicitInputPort.py b/blocks/Xcos/ports/ImplicitInputPort.py index 680fcc16..fae1f19d 100644 --- a/blocks/Xcos/ports/ImplicitInputPort.py +++ b/blocks/Xcos/ports/ImplicitInputPort.py @@ -23,6 +23,7 @@ def ImplicitInputPort(outroot, attribid, parentattribid, ordering, geometry, return outnode + def addImplicitInputPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, sourceType, targetType, inputCount, outputCount, nextAttrib, nextAttribForSplit, waypoints): diff --git a/blocks/Xcos/ports/ImplicitOutputPort.py b/blocks/Xcos/ports/ImplicitOutputPort.py index de7a81bd..14a394d5 100644 --- a/blocks/Xcos/ports/ImplicitOutputPort.py +++ b/blocks/Xcos/ports/ImplicitOutputPort.py @@ -23,6 +23,7 @@ def ImplicitOutputPort(outroot, attribid, parentattribid, ordering, geometry, return outnode + def addImplicitOutputPortForSplit(outroot, splitBlock, sourceVertex, targetVertex, sourceType, targetType, inputCount, outputCount, nextAttrib, nextAttribForSplit, waypoints): diff --git a/blocks/eda-frontend/public/splitblock.xsl b/blocks/eda-frontend/public/splitblock.xsl index 15cec80b..ef9b3b0d 100644 --- a/blocks/eda-frontend/public/splitblock.xsl +++ b/blocks/eda-frontend/public/splitblock.xsl @@ -444,6 +444,7 @@ <xsl:if test="$parentId != $SPLIT/@id" > <xsl:copy> <xsl:copy-of select="@*"/> + <xsl:copy-of select="node()"/> </xsl:copy> </xsl:if> </xsl:template> diff --git a/blocks/simulationAPI/views.py b/blocks/simulationAPI/views.py index be241666..ee9c6c2a 100644 --- a/blocks/simulationAPI/views.py +++ b/blocks/simulationAPI/views.py @@ -223,7 +223,6 @@ class StreamView(APIView): time.sleep(LOOK_DELAY) continue logger.warning('log file is empty') - return None return log_name @@ -236,7 +235,6 @@ class StreamView(APIView): self.duplicatelineno = 0 def event_stream(self, task_id): - print('ABC',task_id) if not isinstance(task_id, uuid.UUID): raise ValidationError('Invalid uuid format') |