Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation fixes and moved to FMI.jl #99

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -109,7 +109,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 @@ -97,7 +97,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 @@ -255,6 +255,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 @@ -450,7 +454,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
2 changes: 1 addition & 1 deletion src/FMI2/sens.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function (fmu::FMU2)(;dx::AbstractVector{<:Real}=Vector{fmi2Real}(),
if hasCurrentComponent(fmu)
c = getCurrentComponent(fmu)
else
logWarn(fmu, "No FMU2Component found. Allocating one.")
logWarning(fmu, "No FMU2Component found. Allocating one.")
c = fmi2Instantiate!(fmu)
fmi2EnterInitializationMode(c)
fmi2ExitInitializationMode(c)
Expand Down
Loading