-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delete parameter bindings references in ssd (#1079)
- Loading branch information
Showing
34 changed files
with
4,356 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#CAPTION# | ||
addResources | ||
------------ | ||
|
||
Adds an external resources to an existing SSP. The external resources should be a ".ssv" or ".ssm" file | ||
#END# | ||
|
||
#LUA# | ||
.. code-block:: lua | ||
status = oms_addResources(cref, path) | ||
-- Example | ||
oms_importFile("addExternalResources1.ssp") | ||
-- add list of external resources from filesystem to ssp | ||
oms_addResources("addExternalResources", "../../resources/externalRoot.ssv") | ||
oms_addResources("addExternalResources:externalSystem.ssv", "../../resources/externalSystem1.ssv") | ||
oms_addResources("addExternalResources", "../../resources/externalGain.ssv") | ||
-- export the ssp with new resources | ||
oms_export("addExternalResources", "addExternalResources1.ssp") | ||
#END# | ||
|
||
#PYTHON# | ||
.. code-block:: python | ||
status = oms.addResources(cref, path) | ||
## Example | ||
from OMSimulator import OMSimulator | ||
oms = OMSimulator() | ||
oms.importFile("addExternalResources1.ssp") | ||
## add list of external resources from filesystem to ssp | ||
oms.addResources("addExternalResources", "../../resources/externalRoot.ssv") | ||
oms.addResources("addExternalResources:externalSystem.ssv", "../../resources/externalSystem1.ssv") | ||
oms.addResources("addExternalResources", "../../resources/externalGain.ssv") | ||
## export the ssp with new resources | ||
oms_export("addExternalResources", "addExternalResources1.ssp") | ||
#END# | ||
|
||
#CAPI# | ||
.. code-block:: c | ||
oms_status_enu_t oms_addResources(const char* cref_, const char* path) | ||
#END# | ||
|
||
|
||
#DESCRIPTION# | ||
#END# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#CAPTION# | ||
deleteResources | ||
--------------- | ||
|
||
Deletes the reference and resource file in a SSP. Deletion of ".ssv" and ".ssm" files are currently supported. The API can be used in two ways. | ||
|
||
1) deleting only the reference file in ".ssd". | ||
2) deleting both reference and resource files in ".ssp". | ||
|
||
To delete only the reference file in ssd, the user should provide the full qualified cref of the ".ssv" file associated with a system or subsystem or component (e.g) "model.root:root1.ssv". | ||
|
||
To delete both the reference and resource file in ssp, it is enough to provide only the model cref of the ".ssv" file (e.g) "model:root1.ssv". | ||
|
||
When deleting only the references of a ".ssv" file, if a parameter mapping file ".ssm" is binded to a ".ssv" file then the ".ssm" file will also be deleted. | ||
It is not possible to delete the references of ".ssm" seperately as the ssm file is binded to a ssv file. | ||
|
||
The filename of the reference or resource file is provided by the users using colon suffix at the end of cref. (e.g) ":root.ssv" | ||
|
||
#END# | ||
|
||
#LUA# | ||
.. code-block:: lua | ||
status = oms_deleteResources(cref) | ||
-- Example | ||
oms_importFile("deleteResources1.ssp") | ||
-- delete only the references in ".ssd" file | ||
oms_deleteResources("deleteResources.root:root.ssv") | ||
-- delete both references and resources | ||
oms_deleteResources("deleteResources:root.ssv") | ||
oms_export("deleteResources1.ssp") | ||
#END# | ||
|
||
#PYTHON# | ||
.. code-block:: python | ||
status = oms.deleteResources(cref)) | ||
## Example | ||
from OMSimulator import OMSimulator | ||
oms = OMSimulator() | ||
oms.importFile("deleteResources1.ssp") | ||
## delete only the references in ".ssd" file | ||
oms.deleteResources("deleteResources.root:root.ssv") | ||
## delete both references and resources | ||
oms.deleteResources("deleteResources:root.ssv") | ||
oms.export("deleteResources1.ssp") | ||
#END# | ||
|
||
#CAPI# | ||
.. code-block:: c | ||
oms_status_enu_t oms_deleteResources(const char* cref); | ||
#END# | ||
|
||
|
||
#DESCRIPTION# | ||
#END# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#CAPTION# | ||
newResources | ||
------------ | ||
|
||
Adds a new empty resources to the SSP. The resource file is a ".ssv" file where the parameter values set by the users using | ||
"oms_setReal()", "oms_setInteger()" and "oms_setReal()" are writtern to the file. Currently only ".ssv" files can be created. | ||
|
||
The filename of the resource file is provided by the users using colon suffix at the end of cref. (e.g) ":root.ssv" | ||
#END# | ||
|
||
#LUA# | ||
.. code-block:: lua | ||
status = oms_newResources(cref) | ||
-- Example | ||
oms_newModel("newResources") | ||
oms_addSystem("newResources.root", oms_system_wc) | ||
oms_addConnector("newResources.root.Input1", oms_causality_input, oms_signal_type_real) | ||
oms_addConnector("newResources.root.Input2", oms_causality_input, oms_signal_type_real) | ||
-- add Top level new resources, the filename is provided using the colon suffix ":root.ssv" | ||
oms_newResources("newResources.root:root.ssv") | ||
oms_setReal("newResources.root.Input1", 10) | ||
-- export the ssp with new resources | ||
oms_export("newResources", "newResources.ssp") | ||
#END# | ||
|
||
#PYTHON# | ||
.. code-block:: python | ||
status = oms.newResources(cref) | ||
## Example | ||
from OMSimulator import OMSimulator | ||
oms = OMSimulator() | ||
oms.newModel("newResources") | ||
oms.addSystem("newResources.root", oms_system_wc) | ||
oms.addConnector("newResources.root.Input1", oms.input, oms_signal_type_real) | ||
oms.addConnector("newResources.root.Input2", oms.input, oms_signal_type_real) | ||
## add Top level resources, the filename is provided using the colon suffix ":root.ssv" | ||
oms.newResources("newResources.root:root.ssv") | ||
oms.setReal("newResources.root.Input1", 10) | ||
## export the ssp with new resources | ||
oms.export("newResources", "newResources.ssp") | ||
#END# | ||
|
||
#CAPI# | ||
.. code-block:: c | ||
oms_status_enu_t oms_newResources(const char* cref) | ||
#END# | ||
|
||
|
||
#DESCRIPTION# | ||
|
||
#END# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#CAPTION# | ||
referenceResources | ||
------------------ | ||
|
||
Switches the references of ".ssv" and ".ssm" in a SSP file. Referencing of ".ssv" and ".ssm" files are currently supported. The API can be used in two ways. | ||
|
||
1) Referencing only the ".ssv" file. | ||
2) Referencing both the ".ssv" along with the ".ssm" file. | ||
|
||
This API should be used in combination with "oms_deleteResources".To switch with a new reference, the old reference must be deleted first using "oms_deleteResources" and then reference with new resources. | ||
|
||
When deleting only the references of a ".ssv" file, if a parameter mapping file ".ssm" is binded to a ".ssv" file, then the reference of ".ssm" file will also be deleted. | ||
It is not possible to delete the references of ".ssm" seperately as the ssm file is binded to a ssv file. Hence it is not possible to switch the reference of ".ssm" file alone. | ||
So inorder to switch the reference of ".ssm" file, the users need to bind the reference of ".ssm" file along with the ".ssv". | ||
|
||
The filename of the reference or resource file is provided by the users using colon suffix at the end of cref (e.g) ":root.ssv", | ||
and the ".ssm" file is optional and is provided by the user as the second argument to the API. | ||
|
||
|
||
#END# | ||
|
||
#LUA# | ||
.. code-block:: lua | ||
status = oms_referenceResources(cref, ssmFile) | ||
-- Example | ||
oms_importFile("referenceResources1.ssp") | ||
-- delete only the references in ".ssd" file | ||
oms_deleteResources("referenceResources1.root:root.ssv") | ||
-- usage-1 switch with new references, only ssv file | ||
oms_referenceResources("referenceResources1.root:Config1.ssv") | ||
-- usage-2 switch with new references, both ssv and ssm file | ||
oms_referenceResources("referenceResources1.root:Config1.ssv", "Config1.ssm") | ||
oms_export("referenceResources1.ssp") | ||
#END# | ||
|
||
#PYTHON# | ||
.. code-block:: python | ||
status = oms.referenceResources(cref, ssmFile) | ||
## Example | ||
from OMSimulator import OMSimulator | ||
oms = OMSimulator() | ||
oms.importFile("referenceResources1.ssp") | ||
## delete only the references in ".ssd" file | ||
oms.deleteResources("referenceResources1.root:root.ssv") | ||
## usage-1 switch with new references, only ssv file | ||
oms.referenceResources("referenceResources1.root:Config1.ssv") | ||
## usage-2 switch with new references, both ssv and ssm file | ||
oms.referenceResources("referenceResources1.root:Config1.ssv", "Config1.ssm") | ||
#END# | ||
|
||
#CAPI# | ||
.. code-block:: c | ||
oms_status_enu_t oms_referenceResources(const char* cref, const char* ssmFile); | ||
#END# | ||
|
||
|
||
#DESCRIPTION# | ||
#END# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.