summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuchita Lad2025-05-13 17:29:38 +0530
committerSuchita Lad2025-05-13 17:29:38 +0530
commitd792c4b40003922d58693c2c5c42abbb48477eb3 (patch)
tree4aea63fa8bd706a07a3508b072ba57cbb2d8d7ab
parent5fbfdea75fddc95c40dfcdc23c0677ae141b9c0b (diff)
downloadCommon-Interface-Project-d792c4b40003922d58693c2c5c42abbb48477eb3.tar.gz
Common-Interface-Project-d792c4b40003922d58693c2c5c42abbb48477eb3.tar.bz2
Common-Interface-Project-d792c4b40003922d58693c2c5c42abbb48477eb3.zip
Removed Xcosdiagram node from SuperBlock
-rwxr-xr-xblocks/Xcos/MxGraphParser.py11
-rw-r--r--blocks/Xcos/blocks/CLKOUTV_f.py2
-rw-r--r--blocks/Xcos/blocks/SUPER_f.py4
-rw-r--r--blocks/Xcos/common/AAAAAA.py15
4 files changed, 17 insertions, 15 deletions
diff --git a/blocks/Xcos/MxGraphParser.py b/blocks/Xcos/MxGraphParser.py
index c0b4d770..b60fb596 100755
--- a/blocks/Xcos/MxGraphParser.py
+++ b/blocks/Xcos/MxGraphParser.py
@@ -3,6 +3,7 @@
import os
import re
import sys
+import datetime
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as goodET
@@ -30,8 +31,16 @@ diagram = tree.getroot()
rootattribid = '0:1:0'
parentattribid = '0:2:0'
-outdiagram = process_xcos_model(diagram, title, rootattribid, parentattribid,
+outdiagram = ET.Element('XcosDiagram')
+outdiagram.set('background', '-1')
+outdiagram.set('finalIntegrationTime', '30.0') # TODO: From POST
+outdiagram.set('title', title)
+dt = datetime.datetime(2021, 7, 15, 15, 31)
+comment = ET.Comment(dt.strftime('Xcos - 2.0 - scilab-6.1.1 - %Y%m%d %H%M'))
+outdiagram.append(comment)
+outmodel = process_xcos_model(diagram, title, rootattribid, parentattribid,
workspace_file, context)
+outdiagram.append(outmodel)
outtree = ET.ElementTree(outdiagram)
diff --git a/blocks/Xcos/blocks/CLKOUTV_f.py b/blocks/Xcos/blocks/CLKOUTV_f.py
index a0a3bbca..96a45718 100644
--- a/blocks/Xcos/blocks/CLKOUTV_f.py
+++ b/blocks/Xcos/blocks/CLKOUTV_f.py
@@ -19,7 +19,7 @@ def CLKOUTV_f(outroot, attribid, ordering, geometry, parameters, parent=1, style
addTypeNode(outnode, TYPE_DOUBLE, AS_REAL_PARAM, 0,
[])
array = ['0']
- addPrecisionNode(outnode, TYPE_INTEGER, AS_INT_PARAM, 1, array)
+ addPrecisionNode(outnode, TYPE_INTEGER, AS_INT_PARAM, 1, parameters)
addObjNode(outnode, TYPE_ARRAY, CLASS_LIST, AS_OBJ_PARAM)
addPrecisionNode(outnode, TYPE_INTEGER, AS_NBZERO, 1, array)
addPrecisionNode(outnode, TYPE_INTEGER, AS_NMODE, 1, array)
diff --git a/blocks/Xcos/blocks/SUPER_f.py b/blocks/Xcos/blocks/SUPER_f.py
index fefbbd9b..8cd43120 100644
--- a/blocks/Xcos/blocks/SUPER_f.py
+++ b/blocks/Xcos/blocks/SUPER_f.py
@@ -38,9 +38,9 @@ def SUPER_f(outroot, attribid, ordering, geometry, parameters, parent=1, style=N
rootattribid = block_id[0]
parentattribid = block_id[1]
title = ''
- outdiagram = process_xcos_model(superblock, title, rootattribid, parentattribid)
+ outmodel = process_xcos_model(superblock, title, rootattribid, parentattribid)
- SuperBlockDiagram.append(outdiagram)
+ SuperBlockDiagram.append(outmodel)
return outnode
diff --git a/blocks/Xcos/common/AAAAAA.py b/blocks/Xcos/common/AAAAAA.py
index f315ddf1..0ca284be 100644
--- a/blocks/Xcos/common/AAAAAA.py
+++ b/blocks/Xcos/common/AAAAAA.py
@@ -1,5 +1,4 @@
import ast
-import datetime
import os
from os.path import abspath, isfile, join
import pexpect
@@ -1660,14 +1659,7 @@ def process_xcos_model(diagram, title, rootattribid, parentattribid,
model = diagram.find('mxGraphModel')
checkModelTag(model)
- outdiagram = ET.Element('XcosDiagram')
- outdiagram.set('background', '-1')
- outdiagram.set('finalIntegrationTime', '30.0') # TODO: From POST
- outdiagram.set('title', title)
- dt = datetime.datetime(2021, 7, 15, 15, 31)
- comment = ET.Comment(dt.strftime('Xcos - 2.0 - scilab-6.1.1 - %Y%m%d %H%M'))
- outdiagram.append(comment)
- outmodel = ET.SubElement(outdiagram, 'mxGraphModel')
+ outmodel = ET.Element('mxGraphModel')
outmodel.set('as', 'model')
for root in model:
@@ -1859,10 +1851,11 @@ def process_xcos_model(diagram, title, rootattribid, parentattribid,
getattr(Links, style)(outroot, attribid, sourceVertex, targetVertex, waypoints[1:-1], parent=parentattribid)
- outnode = ET.SubElement(outdiagram, 'mxCell')
+ outnode = ET.Element('mxCell')
outnode.set('as', 'defaultParent')
outnode.set('id', parentattribid)
outnode.set('parent', rootattribid)
+ outmodel.append(outnode)
if started_workspace:
print('Terminating workspace')
@@ -1870,7 +1863,7 @@ def process_xcos_model(diagram, title, rootattribid, parentattribid,
WORKSPACE = None
started_workspace = False
- return outdiagram
+ return outmodel
def is_safe_string(parameter, value):