Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/0815Creeper/FMIImport.jl in…
Browse files Browse the repository at this point in the history
…to 0815Creeper-main
  • Loading branch information
ThummeTo committed Nov 6, 2023
2 parents a8f6d4d + c20ad49 commit b78f08d
Show file tree
Hide file tree
Showing 16 changed files with 905 additions and 337 deletions.
2 changes: 0 additions & 2 deletions docs/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions docs/Project.toml

This file was deleted.

26 changes: 0 additions & 26 deletions docs/make.jl

This file was deleted.

4 changes: 0 additions & 4 deletions docs/src/contents.md

This file was deleted.

250 changes: 0 additions & 250 deletions docs/src/fmi2_library.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/fmi3_library.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/overview.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/src/related.md

This file was deleted.

3 changes: 2 additions & 1 deletion src/FMI2/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function fmi2ModelVariablesForValueReference(md::fmi2ModelDescription, vr::fmi2V
end

"""
ToDo.
fmi2DataTypeForValueReference(md::fmi2ModelDescription, vr::fmi2ValueReference)
Returns the fmi2DataType (`fmi2Real`, `fmi2Integer`, `fmi2Boolean`, `fmi2String`) for a given Valuereference `vr` of a given FMU-ModelDescription `md`
"""
function fmi2DataTypeForValueReference(md::fmi2ModelDescription, vr::fmi2ValueReference)
mv = fmi2ModelVariablesForValueReference(md, vr)[1]
Expand Down
8 changes: 6 additions & 2 deletions src/FMI2/ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ end
function dlsym_opt(libHandle, symbol)
addr = dlsym(libHandle, symbol; throw_error=false)
if addr == nothing
logWarn(fmu, "This FMU does not support function '$symbol'.")
logWarning(fmu, "This FMU does not support function '$symbol'.")
addr = Ptr{Cvoid}(C_NULL)
end
addr
Expand Down Expand Up @@ -257,6 +257,10 @@ function fmi2Load(pathToFMU::String; unpackPath::Union{String, Nothing}=nothing,
return fmu
end

"""
loadBinary(fmu::FMU2)
load pointers to `fmu`\`s c functions from shared library handle (provided by `fmu.libHandle`)
"""
function loadBinary(fmu::FMU2)
lastDirectory = pwd()
cd(dirname(fmu.binaryPath))
Expand Down Expand Up @@ -518,7 +522,7 @@ function fmi2Instantiate!(fmu::FMU2;
end

if !isnothing(component)
logWarn(fmu, "fmi2Instantiate!(...): This component was already registered. This may be because you created the FMU by yourself with FMIExport.jl.")
logWarning(fmu, "fmi2Instantiate!(...): This component was already registered. This may be because you created the FMU by yourself with FMIExport.jl.")
else
component = FMU2Component(compAddr, fmu)

Expand Down
4 changes: 2 additions & 2 deletions src/FMI2/md.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative val
# Returns
- `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of derivatives)
See also [fmi2GetValueReferencesAndNames`](@ref)
See also [`fmi2GetValueReferencesAndNames`](@ref)
"""
function fmi2GetDerivateValueReferencesAndNames(md::fmi2ModelDescription)
fmi2GetValueReferencesAndNames(md::fmi2ModelDescription; vrs=md.derivativeValueReferences)
Expand All @@ -1487,7 +1487,7 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative val
# Returns
- `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of derivatives)
See also [fmi2GetValueReferencesAndNames`](@ref)
See also [`fmi2GetValueReferencesAndNames`](@ref)
"""
function fmi2GetDerivateValueReferencesAndNames(fmu::FMU2)
fmi2GetDerivateValueReferencesAndNames(fmu.modelDescription)
Expand Down
Loading

0 comments on commit b78f08d

Please sign in to comment.