diff --git a/src/FMI2/cconst.jl b/src/FMI2/cconst.jl index f8d94bc..4d71f97 100644 --- a/src/FMI2/cconst.jl +++ b/src/FMI2/cconst.jl @@ -20,6 +20,13 @@ const fmi2Real = Creal # defined in FMICore.jl, dependent on the Julia arch const fmi2Integer = Cint const fmi2Byte = Char const fmi2ValueReference = Cuint + +""" +fmi2FMUstate is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or +a previous time instant. This allows to restart a simulation from a previous FMU state. + +Source: FMI2.0.3 Spec [p.17]; See also section 2.1.8 +""" const fmi2FMUstate = Ptr{Cvoid} const fmi2Component = Ptr{Cvoid} const fmi2ComponentEnvironment = Ptr{Cvoid} @@ -29,29 +36,31 @@ export fmi2Char, fmi2String, fmi2Boolean, fmi2Real, fmi2Integer, fmi2Byte, fmi2V fmi2ValueReferenceFormat = Union{Nothing, String, AbstractArray{String,1}, fmi2ValueReference, AbstractArray{fmi2ValueReference,1}, Int64, AbstractArray{Int64,1}, Symbol} export fmi2ValueReferenceFormat +const fmi2Status = Cuint +const fmi2StatusOK = Cuint(0) +const fmi2StatusWarning = Cuint(1) +const fmi2StatusDiscard = Cuint(2) +const fmi2StatusError = Cuint(3) +const fmi2StatusFatal = Cuint(4) +const fmi2StatusPending = Cuint(5) + """ Source: FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions Status returned by functions. The status has the following meaning: -fmi2OK – all well -fmi2Warning – things are not quite right, but the computation can continue. Function “logger” was called in the model (see below), and it is expected that this function has shown the prepared information message to the user. -fmi2Discard – this return status is only possible if explicitly defined for the corresponding function +- fmi2OK – all well +- fmi2Warning – things are not quite right, but the computation can continue. Function “logger” was called in the model (see below), and it is expected that this function has shown the prepared information message to the user. +- fmi2Discard – this return status is only possible if explicitly defined for the corresponding function (ModelExchange: fmi2SetReal, fmi2SetInteger, fmi2SetBoolean, fmi2SetString, fmi2SetContinuousStates, fmi2GetReal, fmi2GetDerivatives, fmi2GetContinuousStates, fmi2GetEventIndicators; CoSimulation: fmi2SetReal, fmi2SetInteger, fmi2SetBoolean, fmi2SetString, fmi2DoStep, fmiGetXXXStatus): For “model exchange”: It is recommended to perform a smaller step size and evaluate the model equations again, for example because an iterative solver in the model did not converge or because a function is outside of its domain (for example sqrt()). If this is not possible, the simulation has to be terminated. For “co-simulation”: fmi2Discard is returned also if the slave is not able to return the required status information. The master has to decide if the simulation run can be continued. In both cases, function “logger” was called in the FMU (see below) and it is expected that this function has shown the prepared information message to the user if the FMU was called in debug mode (loggingOn = fmi2True). Otherwise, “logger” should not show a message. -fmi2Error – the FMU encountered an error. The simulation cannot be continued with this FMU instance. If one of the functions returns fmi2Error, it can be tried to restart the simulation from a formerly stored FMU state by calling fmi2SetFMUstate. +- fmi2Error – the FMU encountered an error. The simulation cannot be continued with this FMU instance. If one of the functions returns fmi2Error, it can be tried to restart the simulation from a formerly stored FMU state by calling fmi2SetFMUstate. This can be done if the capability flag canGetAndSetFMUstate is true and fmi2GetFMUstate was called before in non-erroneous state. If not, the simulation cannot be continued and fmi2FreeInstance or fmi2Reset must be called afterwards.4 Further processing is possible after this call; especially other FMU instances are not affected. Function “logger” was called in the FMU (see below), and it is expected that this function has shown the prepared information message to the user. -fmi2Fatal – the model computations are irreparably corrupted for all FMU instances. [For example, due to a run-time exception such as access violation or integer division by zero during the execution of an fmi function]. Function “logger” was called in the FMU (see below), and it is expected that this function has shown the prepared information message to the user. It is not possible to call any other function for any of the FMU instances. -fmi2Pending – this status is returned only from the co-simulation interface, if the slave executes the function in an asynchronous way. That means the slave starts to compute but returns immediately. The master has to call fmi2GetStatus(..., fmi2DoStepStatus) to determine if the slave has finished the computation. Can be returned only by fmi2DoStep and by fmi2GetStatus (see section 4.2.3). +- fmi2Fatal – the model computations are irreparably corrupted for all FMU instances. [For example, due to a run-time exception such as access violation or integer division by zero during the execution of an fmi function]. Function “logger” was called in the FMU (see below), and it is expected that this function has shown the prepared information message to the user. It is not possible to call any other function for any of the FMU instances. +- fmi2Pending – this status is returned only from the co-simulation interface, if the slave executes the function in an asynchronous way. That means the slave starts to compute but returns immediately. The master has to call fmi2GetStatus(..., fmi2DoStepStatus) to determine if the slave has finished the computation. Can be returned only by fmi2DoStep and by fmi2GetStatus (see section 4.2.3). """ -const fmi2Status = Cuint -const fmi2StatusOK = Cuint(0) -const fmi2StatusWarning = Cuint(1) -const fmi2StatusDiscard = Cuint(2) -const fmi2StatusError = Cuint(3) -const fmi2StatusFatal = Cuint(4) -const fmi2StatusPending = Cuint(5) +fmi2Status, fmi2StatusOK, fmi2StatusWarning, fmi2StatusDiscard, fmi2StatusError, fmi2StatusFatal, fmi2StatusPending export fmi2Status, fmi2StatusOK, fmi2StatusWarning, fmi2StatusDiscard, fmi2StatusError, fmi2StatusFatal, fmi2StatusPending """ @@ -117,14 +126,15 @@ const fmi2InitialApprox = Cuint(1) const fmi2InitialCalculated = Cuint(2) export fmi2Initial, fmi2InitialExact, fmi2InitialApprox, fmi2InitialCalculated +const fmi2True = fmi2Boolean(true) +const fmi2False = fmi2Boolean(false) """ Source: FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions To simplify porting, no C types are used in the function interfaces, but the alias types are defined in this section. All definitions in this section are provided in the header file “fmi2TypesPlatform.h”. """ -const fmi2True = fmi2Boolean(true) -const fmi2False = fmi2Boolean(false) +fmi2True, fmi2False export fmi2True, fmi2False """ @@ -153,7 +163,14 @@ export fmi2StatusKind, fmi2StatusKindDoStepStatus, fmi2StatusKindPendingStatus, # Custom helper, not part of the FMI-Spec. """ -ToDo. +Types of dependency: + +- `fmi2DependencyKindDependent`: no particular structure, f(v) +- `fmi2DependencyKindConstant`: constant factor, c*v (for Real valued variables only) +- `fmi2DependencyKindFixed`: tunable factor, p*v (for Real valued variables only) +- `fmi2DependencyKindDependent`: discrete factor, d*v (for Real valued variables only) + +Source: FMI2.0.3 Spec for fmi2VariableDependency [p.60] """ const fmi2DependencyKind = Cuint const fmi2DependencyKindDependent = Cuint(0) diff --git a/src/FMI2/convert.jl b/src/FMI2/convert.jl index 6945df4..90bd34b 100644 --- a/src/FMI2/convert.jl +++ b/src/FMI2/convert.jl @@ -4,10 +4,10 @@ # """ - - fmi2StatusToString(status) -Converts a fmi2Status/Integer `status` to String. + fmi2StatusToString(status::Union{fmi2Status, Integer}) + +Converts `fmi2Status` `status` into a String ("OK", "Warning", "Discard", "Error", "Fatal", "Pending"). """ function fmi2StatusToString(status::Union{fmi2Status, Integer}) if status == fmi2StatusOK @@ -54,10 +54,10 @@ end export fmi2StatusToString """ - - fmi2CausalityToString(c) -Converts a fmi2Causality `c` to String. + fmi2CausalityToString(c::fmi2Causality) + +Converts [`fmi2Causality`](@ref) `c` to the corresponding String ("parameter", "calculatedParameter", "input", "output", "local", "independent"). """ function fmi2CausalityToString(c::fmi2Causality) if c == fmi2CausalityParameter @@ -79,10 +79,10 @@ end export fmi2CausalityToString """ - - fmi2StringToCausality(s) -Converts a String `s` to fmi2Causality. + fmi2StringToCausality(s::AbstractString) + +Converts `s` ("parameter", "calculatedParameter", "input", "output", "local", "independent") to the corresponding [`fmi2Causality`](@ref). """ function fmi2StringToCausality(s::AbstractString) if s == "parameter" @@ -104,10 +104,10 @@ end export fmi2StringToCausality """ - - fmi2VariabilityToString(c) -Converts a fmi2Variablitiy `c` to fmi2Variability. + fmi2VariabilityToString(c::fmi2Variability) + +Converts [`fmi2Variability`](@ref) `c` to the corresponding String ("constant", "fixed", "tunable", "discrete", "continuous"). """ function fmi2VariabilityToString(c::fmi2Variability) if c == fmi2VariabilityConstant @@ -127,10 +127,10 @@ end export fmi2VariabilityToString """ - - fmi2StringToVariability(s) -Converts a String `s` to fmi2Variablitiy. + fmi2StringToVariability(s::AbstractString) + +Converts `s` ("constant", "fixed", "tunable", "discrete", "continuous") to the corresponding [`fmi2Variability`](@ref). """ function fmi2StringToVariability(s::AbstractString) if s == "constant" @@ -150,10 +150,10 @@ end export fmi2StringToVariability """ - - fmi2InitialToString(c) -Converts a fmi2Initial `c` to String. + fmi2InitialToString(c::fmi2Initial) + +Converts [`fmi2Initial`](@ref) `c` to the corresponding String ("approx", "exact", "calculated"). """ function fmi2InitialToString(c::fmi2Initial) if c == fmi2InitialApprox @@ -169,10 +169,10 @@ end export fmi2InitialToString """ - - fmi2StringToInitial(s) -Converts a String `s` to fmi2Initial. + fmi2StringToInitial(s::AbstractString) + +Converts `s` ("approx", "exact", "calculated") to the corresponding [`fmi2Initial`](@ref). """ function fmi2StringToInitial(s::AbstractString) if s == "approx" @@ -188,10 +188,10 @@ end export fmi2StringToInitial """ - - fmi2DependencyKindToString(dk) -Converts a fmi2DependencyKind `dk` to String. + fmi2DependencyKindToString(c::fmi2DependencyKind) + +Converts [`fmi2DependencyKind`](@ref) `c` to the corresponding String ("dependent", "constant", "fixed", "tunable", "discrete") """ function fmi2DependencyKindToString(dk::fmi2DependencyKind) if dk == fmi2DependencyKindDependent @@ -211,10 +211,10 @@ end export fmi2DependencyKindToString """ - - fmi2StringToDependencyKind(s) -Converts a String `s` to fmi2DependencyKind. + fmi2StringToDependencyKind(s::AbstractString) + +Converts `s` ("dependent", "constant", "fixed", "tunable", "discrete") to the corresponding [`fmi2DependencyKind`](@ref) """ function fmi2StringToDependencyKind(s::AbstractString) if s == "dependent" diff --git a/src/FMI2/ctype.jl b/src/FMI2/ctype.jl index 90ddf7b..068cbec 100644 --- a/src/FMI2/ctype.jl +++ b/src/FMI2/ctype.jl @@ -62,7 +62,9 @@ end export fmi2Annotation """ -ToDo +Mutable Struct representing existance and kind of dependencies of an Unknown on Known Variables in Continuous-Time and Event Mode (ME) and at Communication Points (CS) + +See also FMI2.0.3 Spec fmi2VariableDependency [p.60] """ mutable struct fmi2VariableDependency # mandatory diff --git a/src/FMI2/struct.jl b/src/FMI2/struct.jl index d4e159a..557456f 100644 --- a/src/FMI2/struct.jl +++ b/src/FMI2/struct.jl @@ -42,7 +42,7 @@ Overload the Base.show() function for custom printing of the FMU2. Base.show(io::IO, e::FMU2Event) = print(io, e.indicator == 0 ? "Time-Event @ $(round(e.t; digits=4))s" : "State-Event #$(e.indicator) @ $(round(e.t; digits=4))s") """ -ToDo +The mutable struct representing a specific Solution of a FMI2 FMU. """ mutable struct FMU2Solution{C} <: FMUSolution where {C} component::C # FMU2Component @@ -206,7 +206,12 @@ function Base.show(io::IO, sol::FMU2Solution) end """ -ToDo. +Source: FMISpec 2.0.3 [p.16f] + +This is a pointer to a data structure in the simulation environment that calls the FMU. Using this +pointer, data from the modelDescription.xml file [(for example, mapping of valueReferences to +variable names)] can be transferred between the simulation environment and the logger function +(see [FMISpec 2.0.3] section 2.1.5). """ mutable struct FMU2ComponentEnvironment logStatusOK::Bool diff --git a/src/FMI3/cconst.jl b/src/FMI3/cconst.jl index a012b34..8c1eb46 100644 --- a/src/FMI3/cconst.jl +++ b/src/FMI3/cconst.jl @@ -3,12 +3,6 @@ # Licensed under the MIT license. See LICENSE file in the project root for details. # -""" -Source: FMISpec3.0-dev, Version D5ef1c1:2.2.2. Platform Dependent Definitions - -To simplify porting, no C types are used in the function interfaces, but the alias types are defined in this section. -All definitions in this section are provided in the header file fmi3PlatformTypes.h. It is required to use this definition for all binary FMUs. -""" const fmi3Float32 = Cfloat const fmi3Float64 = Cdouble const fmi3Int8 = Cchar @@ -29,6 +23,14 @@ const fmi3FMUState = Ptr{Cvoid} const fmi3Instance = Ptr{Cvoid} const fmi3InstanceEnvironment = Ptr{Cvoid} const fmi3Clock = Cint + +""" +Source: FMISpec3.0-dev, Version D5ef1c1:2.2.2. Platform Dependent Definitions + +To simplify porting, no C types are used in the function interfaces, but the alias types are defined in this section. +All definitions in this section are provided in the header file fmi3PlatformTypes.h. It is required to use this definition for all binary FMUs. +""" +fmi3Float32, fmi3Float64, fmi3Int8, fmi3UInt8, fmi3Int16, fmi3UInt16, fmi3Int32, fmi3UInt32, fmi3Int64, fmi3UInt64 export fmi3Float32, fmi3Float64, fmi3Int8, fmi3UInt8, fmi3Int16, fmi3UInt16, fmi3Int32, fmi3UInt32, fmi3Int64, fmi3UInt64 export fmi3Boolean, fmi3Char, fmi3String, fmi3Byte, fmi3Binary, fmi3ValueReference, fmi3FMUState, fmi3Instance, fmi3InstanceEnvironment, fmi3Clock @@ -36,28 +38,26 @@ export fmi3Boolean, fmi3Char, fmi3String, fmi3Byte, fmi3Binary, fmi3ValueReferen fmi3ValueReferenceFormat = Union{Nothing, String, AbstractArray{String,1}, fmi3ValueReference, AbstractArray{fmi3ValueReference,1}, Int64, AbstractArray{Int64,1}} export fmi3ValueReferenceFormat +const fmi3Status = Cuint +const fmi3StatusOK = Cuint(0) +const fmi3StatusWarning = Cuint(1) +const fmi3StatusDiscard = Cuint(2) +const fmi3StatusError = Cuint(3) +const fmi3StatusFatal = Cuint(4) + """ Source: FMISpec3.0, Version D5ef1c1: 2.2.3. Status Returned by Functions Defines the status flag (an enumeration of type fmi3Status defined in file fmi3FunctionTypes.h) that is returned by functions to indicate the success of the function call: The status has the following meaning: -fmi3OK - The call was successful. The output argument values are defined. - -fmi3Warning - A non-critical problem was detected, but the computation can continue. The output argument values are defined. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. +- fmi3OK: The call was successful. The output argument values are defined. +- fmi3Warning: A non-critical problem was detected, but the computation can continue. The output argument values are defined. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. [In certain applications, e.g. in a prototyping environment, warnings may be acceptable. For production environments warnings should be treated like errors unless they can be safely ignored.] - -fmi3Discard - The call was not successful and the FMU is in the same state as before the call. The output argument values are not defined, but the computation can continue. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. Advanced simulation algorithms can try alternative approaches to drive the simulation by calling the function with different arguments or calling another function. Otherwise the simulation algorithm has to treat this return code like fmi3Error and has to terminate the simulation. +- fmi3Discard: The call was not successful and the FMU is in the same state as before the call. The output argument values are not defined, but the computation can continue. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. Advanced simulation algorithms can try alternative approaches to drive the simulation by calling the function with different arguments or calling another function. Otherwise the simulation algorithm has to treat this return code like fmi3Error and has to terminate the simulation. [Examples for usage of fmi3Discard are handling of min/max violation, or signal numerical problems during model evaluation forcing smaller step sizes.] - -fmi3Error - The call failed. The output argument values are undefined and the simulation cannot be continued. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. If a function returns fmi3Error, it is possible to restore a previously retrieved FMU state by calling fmi3SetFMUState. Otherwise fmi3FreeInstance or fmi3Reset must be called. When detecting illegal arguments or a function call not allowed in the current state according to the respective state machine, the FMU must return fmi3Error. Other instances of this FMU are not affected by the error. - -fmi3Fatal - The state of all instances of the model is irreparably corrupted. [For example, due to a runtime exception such as access violation or integer division by zero during the execution of an FMI function.] Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings, if still possible. It is not allowed to call any other function for any instance of the FMU. +- fmi3Error: The call failed. The output argument values are undefined and the simulation cannot be continued. Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings. If a function returns fmi3Error, it is possible to restore a previously retrieved FMU state by calling fmi3SetFMUState. Otherwise fmi3FreeInstance or fmi3Reset must be called. When detecting illegal arguments or a function call not allowed in the current state according to the respective state machine, the FMU must return fmi3Error. Other instances of this FMU are not affected by the error. +- fmi3Fatal: The state of all instances of the model is irreparably corrupted. [For example, due to a runtime exception such as access violation or integer division by zero during the execution of an FMI function.] Function logMessage should be called by the FMU with further information before returning this status, respecting the current logging settings, if still possible. It is not allowed to call any other function for any instance of the FMU. """ -const fmi3Status = Cuint -const fmi3StatusOK = Cuint(0) -const fmi3StatusWarning = Cuint(1) -const fmi3StatusDiscard = Cuint(2) -const fmi3StatusError = Cuint(3) -const fmi3StatusFatal = Cuint(4) +fmi3Status, fmi3StatusOK, fmi3StatusWarning, fmi3StatusDiscard, fmi3StatusError, fmi3StatusFatal export fmi3Status, fmi3StatusOK, fmi3StatusWarning, fmi3StatusDiscard, fmi3StatusError, fmi3StatusFatal """ @@ -172,11 +172,13 @@ const fmi3InitialApprox = Cuint(1) const fmi3InitialCalculated = Cuint(2) export fmi3Initial, fmi3InitialExact, fmi3InitialApprox, fmi3InitialCalculated -""" -ToDo. -""" const fmi3False = fmi3Boolean(false) const fmi3True = fmi3Boolean(true) + +""" +`fmi3Boolean` TODO +""" +fmi3False, fmi3True export fmi3False, fmi3True """ @@ -208,12 +210,14 @@ const fmi3IntervalQualifierIntervalUnchanged = Cuint(1) const fmi3IntervalQualifierIntervalChanged = Cuint(2) export fmi3IntervalQualifier, fmi3IntervalQualifierIntervalNotYetKnown, fmi3IntervalQualifierIntervalUnchanged, fmi3IntervalQualifierIntervalChanged -""" -Source: FMISpec3.0, Version D5ef1c1: 2.4.7.5.1. Variable Naming Conventions -""" const fmi3VariableNamingConvention = Cuint const fmi3VariableNamingConventionFlat = Cuint(0) const fmi3VariableNamingConventionStructured = Cuint(1) + +""" +Source: FMISpec3.0, Version D5ef1c1: 2.4.7.5.1. Variable Naming Conventions +""" +fmi3VariableNamingConvention, fmi3VariableNamingConventionFlat, fmi3VariableNamingConventionStructured export fmi3VariableNamingConvention, fmi3VariableNamingConventionFlat, fmi3VariableNamingConventionStructured # this is a custom type to catch the internal state of the instance diff --git a/src/FMI3/convert.jl b/src/FMI3/convert.jl index fa98bb8..fc09aef 100644 --- a/src/FMI3/convert.jl +++ b/src/FMI3/convert.jl @@ -4,7 +4,10 @@ # """ -ToDo. + + fmi3StatusToString(status::Union{fmi3Status, Integer}) + +Converts `fmi3Status` `status` into a String ("OK", "Warning", "Discard", "Error", "Fatal", "Unknown"). """ function fmi3StatusToString(status::Union{fmi3Status, Integer}) if status == fmi3StatusOK @@ -24,7 +27,9 @@ end export fmi3StatusToString """ -ToDo. + fmi3CausalityToString(c::fmi3Causality) + +Convert [`fmi3Causality`](@ref) `c` to the corresponding String ("parameter", "calculatedParameter", "structuralParameter", "input", "output", "local", "independent"). """ function fmi3StringToStatus(s::AbstractString) if s == "OK" @@ -68,7 +73,9 @@ end export fmi3CausalityToString """ -ToDo. + fmi3StringToCausality(s::AbstractString) + +Convert `s` ("parameter", "calculatedParameter", "structuralParameter", "input", "output", "local", "independent") to the corresponding [`fmi3Causality`](@ref). """ function fmi3StringToCausality(s::AbstractString) if s == "parameter" @@ -92,7 +99,9 @@ end export fmi3StringToCausality """ -ToDo. + fmi3VariabilityToString(c::fmi3Variability) + +Convert [`fmi3Variability`](@ref) `c` to the corresponding String ("constant", "fixed", "tunable", "discrete", "continuous"). """ function fmi3VariabilityToString(c::fmi3Variability) if c == fmi3VariabilityConstant @@ -112,7 +121,9 @@ end export fmi3VariabilityToString """ -ToDo. + fmi3StringToVariability(s::AbstractString) + +Convert `s` ("constant", "fixed", "tunable", "discrete", "continuous") to the corresponding [`fmi3Variability`](@ref). """ function fmi3StringToVariability(s::AbstractString) if s == "constant" @@ -132,7 +143,9 @@ end export fmi3StringToVariability """ -ToDo. + fmi3InitialToString(c::fmi3Initial) + +Convert [`fmi3Initial`](@ref) `c` to the corresponding String ("approx", "exact", "calculated"). """ function fmi3InitialToString(c::fmi3Initial) if c == fmi3InitialApprox @@ -148,7 +161,9 @@ end export fmi3InitialToString """ -ToDo. + fmi3StringToInitial(s::AbstractString) + +Convert `s` ("approx", "exact", "calculated") to the corresponding [`fmi3Initial`](@ref). """ function fmi3StringToInitial(s::AbstractString) if s == "approx" @@ -164,7 +179,9 @@ end export fmi3StringToInitial """ -ToDo. + fmi3DependencyKindToString(c::fmi3DependencyKind) + +Convert [`fmi3DependencyKind`](@ref) `c` to the corresponding String ("independent", "dependent", "constant", "fixed", "tunable", "discrete"). """ function fmi3DependencyKindToString(c::fmi3DependencyKind) if c == fmi3DependencyKindIndependent @@ -186,7 +203,9 @@ end export fmi3DependencyKindToString """ -ToDo. + fmi3StringToDependencyKind(s::AbstractString) + +Convert `s` ("independent", "dependent", "constant", "fixed", "tunable", "discrete") to the corresponding [`fmi3DependencyKind`](@ref). """ function fmi3StringToDependencyKind(s::AbstractString) if s == "independent" @@ -208,7 +227,9 @@ end export fmi3StringToDependencyKind """ -ToDo. + fmi3VariableNamingConventionToString(c::fmi3VariableNamingConvention) + +Convert [`fmi3VariableNamingConvention`](@ref) `c` to the corresponding String ("flat", "structured"). """ function fmi3VariableNamingConventionToString(c::fmi3VariableNamingConvention) if c == fmi3VariableNamingConventionFlat @@ -222,7 +243,9 @@ end export fmi3VariableNamingConventionToString """ -ToDo. + fmi3StringToVariableNamingConvention(s::AbstractString) + +Convert `s` ("flat", "structured") to the corresponding [`fmi3VariableNamingConvention`](@ref). """ function fmi3StringToVariableNamingConvention(s::AbstractString) if s == "flat" @@ -236,7 +259,9 @@ end export fmi3StringToVariableNamingConvention """ -ToDo. + fmi3TypeToString(c::fmi3Type) + +Convert [`fmi3Type`](@ref) `c` to the corresponding String ("coSimulation", "modelExchange", "scheduledExecution"). """ function fmi3TypeToString(c::fmi3Type) if c == fmi3TypeCoSimulation @@ -252,7 +277,9 @@ end export fmi3TypeToString """ -ToDo. + fmi3StringToType(s::AbstractString) + +Convert `s` ("coSimulation", "modelExchange", "scheduledExecution") to the corresponding [`fmi3Type`](@ref). """ function fmi3StringToType(s::AbstractString) if s == "coSimulation" @@ -268,7 +295,9 @@ end export fmi3StringToType """ -ToDo. + fmi3IntervalQualifierToString(c::fmi3IntervalQualifier) + +Convert [`fmi3IntervalQualifier`](@ref) `c` to the corresponding String ("intervalNotYetKnown", "intervalUnchanged", "intervalChanged"). """ function fmi3IntervalQualifierToString(c::fmi3IntervalQualifier) if c == fmi3IntervalQualifierIntervalNotYetKnown @@ -284,7 +313,9 @@ end export fmi3IntervalQualifierToString """ -ToDo. + fmi3StringToIntervalQualifier(s::AbstractString) + +Convert `s` ("intervalNotYetKnown", "intervalUnchanged", "intervalChanged") to the corresponding [`fmi3IntervalQualifier`](@ref). """ function fmi3StringToIntervalQualifier(s::AbstractString) if s == "intervalNotYetKnown" diff --git a/src/FMI3/ctype.jl b/src/FMI3/ctype.jl index 437e386..3c86464 100644 --- a/src/FMI3/ctype.jl +++ b/src/FMI3/ctype.jl @@ -12,7 +12,9 @@ abstract type fmi3Variable end export fmi3Variable """ -ToDo +Mutable Struct representing existance and kind of dependencies of an Unknown on Known Variables. + +See also FMI3.0.1 Spec [fig 30] """ mutable struct fmi3VariableDependency # mandatory @@ -1068,7 +1070,7 @@ mutable struct fmi3ModelDescriptionScheduledExecution end """ -ToDo +ToDo: Not implemented """ mutable struct fmi3Unit # ToDo @@ -1076,7 +1078,7 @@ end export fmi3Unit """ -ToDo +ToDo: Not implemented """ mutable struct fmi3SimpleType # ToDo diff --git a/src/FMI3/struct.jl b/src/FMI3/struct.jl index b8c89ee..7469f21 100644 --- a/src/FMI3/struct.jl +++ b/src/FMI3/struct.jl @@ -10,7 +10,9 @@ # - string/enum-converters for FMI-attribute-structs (e.g. `fmi3StatusToString`, ...) """ -ToDo. +This is a pointer to a data structure in the importer. Using this pointer, data may be transferred between the importer and callback functions the importer provides with the instantiation functions. + +Source: FMISpec 3.0.1 [2.2.3. Platform Dependent Definitions] """ mutable struct FMU3InstanceEnvironment logStatusOK::Bool @@ -277,7 +279,7 @@ Base.show(io::IO, e::FMU3Event) = print(io, e.indicator == 0 ? "Time-Event @ $(r """ -ToDo +The mutable struct representing a specific Solution of a FMI2 FMU. """ mutable struct FMU3Solution{F} <: FMUSolution where {F} fmu::F # FMU3