Exemplo n.º 1
0
oms.addSubModel("addExternalResources.root.Gain", "../../resources/Modelica.Blocks.Math.Gain.fmu")

## add resources to submodule
oms.newResources("addExternalResources.root.Gain:gain.ssv")

oms.setReal("addExternalResources.root.Gain.k", 27)

oms.setResultFile("addExternalResources", "addExternalResources1.mat", 10)

oms.export("addExternalResources", "addExternalResources3.ssp")

oms.terminate("addExternalResources")
oms.delete("addExternalResources")

oms.importFile("addExternalResources3.ssp")

## old Resources and references
src, status = oms.exportSnapshot("addExternalResources")
print(src, flush=True)

## 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")

## delete the root references
oms.deleteResources("addExternalResources.root:root.ssv")
## switch with new references
oms.referenceResources("addExternalResources.root:externalRoot.ssv")
Exemplo n.º 2
0
printStatus(status, 0)

status = oms.addConnection("test.eoo.foo.bus", "test.eoo.foo2.bus")
printStatus(status, 0)

status, src = oms.list("test")
printStatus(status, 0)
print(src)

status = oms.export("test", "test-py.ssp")
printStatus(status, 0)

status = oms.delete("test")
printStatus(status, 0)

status, model = oms.importFile("test-py.ssp")
printStatus(status, 0)

status, src = oms.list(model)
printStatus(status, 0)
print(src)

status = oms.delete(model)
printStatus(status, 0)

## Result:
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok
Exemplo n.º 3
0
printStatus(status, 0)

status = oms.addConnection("test.eoo.foo.bus", "test.eoo.foo2.bus")
printStatus(status, 0)

src, status = oms.list("test")
printStatus(status, 0)
print(src)

status = oms.export("test", "test-py.ssp")
printStatus(status, 0)

status = oms.delete("test")
printStatus(status, 0)

model, status = oms.importFile("test-py.ssp")
printStatus(status, 0)

src, status = oms.list(model)
printStatus(status, 0)
print(src)

status = oms.delete(model)
printStatus(status, 0)

## Result:
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok
## status:  [correct] ok