Closed Fredrik1Haider closed 2 years ago
@Fredrik1Haider I cannot reproduce the issue, for me it is working correctly as expected, see the following test example where the ssm template files are exported correctly https://github.com/OpenModelica/OMSimulator/blob/master/testsuite/simulation/exportSSMTemplate.py,
when adding the ssm file using addResources()
API see the following example
https://github.com/OpenModelica/OMSimulator/blob/master/testsuite/api/addExternalResources4.py#L24,
@Fredrik1Haider I cannot reproduce the issue, for me it is working correctly as expected, see the following test example where the ssm template files are exported correctly https://github.com/OpenModelica/OMSimulator/blob/master/testsuite/simulation/exportSSMTemplate.py, when adding the ssm file using
addResources()
API see the following example https://github.com/OpenModelica/OMSimulator/blob/master/testsuite/api/addExternalResources4.py#L24,
huh, odd the issue does not appear with the example code you provided. I will have to dig a bit deeper and see if I can figure out what the cause is for my code...
@arun3688 the underlying issue has been identified and is NOT related to OMS, this issue may be closed.
Description
The SSM exported from exportSSMTemplate is not recognized as an ssm file, when added back to an oms model using addResource()
Steps to reproduce the behavior
A model is initialized with the ECS_HW.fmu (Embrace)
exports the following file:
note that what is supposed to be ssm is exported as ns0 the exported ssm, is read using the python lib xml.ETree and sources are added to a couple of the targets the modified ssm gets added back to the OMS model
oms.addResources(“model”, .ssm))
and the reference to the .ssm is added
oms.referencesResources(model.root:.ssv, .ssm)
finally, the resulting .ssp is exported
oms.export("model", path)
Inspecting the resulting .ssp it is noted that the .ssm is empty only containing the boilerplate code i.e
Running the simulation it can be confirmed that the mapping did not work.
In conclusion, ssm is replaced by ns0 in the exported .ssm, the file is no longer recognized as an .ssm file. Currently, the my work around is to replace as ns0 entries with ssm prior to adding the .ssm resource
Expected behavior
An exported .ssm is recognized as an .ssm when added to a model
What would be expected of the ssm export:
Version and OS
OMSimulator v2.1.1
]