OMJulia.jl
OMJulia.jl copied to clipboard
Set methods dictionary input
For the set methods documented in https://openmodelica.github.io/OMJulia.jl/dev/modelicaSystem/#Set-Methods
Two setting possibilities are accepted using setXXXs(),where "XXX" can be any of above functions.
- setXXX("Name=value") string of keyword assignments
- setXXX(["Name1=value1","Name2=value2","Name3=value3"]) array of string of keyword assignments
having tuples of names and values as string or array of strings is a bit strange.
I suggest to add higher level methods for the set methods with dictionaries instead of a list of strings
parameters = Dict("x"=>1, "y"=>7.0, "z"=>"hello")
setParameters(omc, parameters)
function setParameters(omc, parameters::Dict{Any}, verbose::Bool = true)
name = ["$(p[1])=$(p[2])" for p in collect(parameters)]
setParameters(omc, name, verbose)
end