Skip to content

Commit

Permalink
API doc update.
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Nov 12, 2024
1 parent 17ec71c commit 928c931
Show file tree
Hide file tree
Showing 8 changed files with 290 additions and 57 deletions.
8 changes: 7 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ DOC_OUTPUT_fmimcl := doc/content/apis/fmi/fmimcl/index.md
DOC_LINKTITLE_fmimcl := FMI MCL
DOC_TITLE_fmimcl := "FMI Model Compatibility Library API Reference"

# Module "fmimodelc"
DOC_INPUT_fmimodelc := dse/fmimodelc/fmimodelc.h
DOC_CDIR_fmimodelc := dse/fmimodelc/ascii85.c,dse/fmimodelc/fmi2fmu.c,dse/fmimodelc/runtime.c
DOC_OUTPUT_fmimodelc := doc/content/apis/fmi/fmimodelc/index.md
DOC_LINKTITLE_fmimodelc := FMI ModelC FMU
DOC_TITLE_fmimodelc := "FMI ModelC FMU API Reference"

# Targets
DOC_C_MODULES := fmimcl
DOC_C_MODULES := fmimcl fmimodelc


.PHONY: index
Expand Down
Binary file removed doc/content/apis/fmi/fmimcl/fmimcl-component.png
Binary file not shown.
Binary file added doc/content/apis/fmi/fmimcl/fmimcl-sequence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 47 additions & 39 deletions doc/content/apis/fmi/fmimcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The FMI Model Compatibility Library provides an interfaces for loading and
operating FMUs.


### Component Diagram
### Sequence Diagram

<div hidden>

```
@startuml fmimcl-component
@startuml fmimcl-sequence
title FMI Model Compatibility Library
title FMI MCL - Sequence
actor User
participant ModelC
Expand Down Expand Up @@ -191,15 +191,30 @@ center footer Dynamic Simulation Environment

</div>

![](fmimcl-component.png)
![](fmimcl-sequence.png)


### Example


{{< readfile file="examples/fmimcl_api.c" code="true" lang="c" >}}
## fmimcl_adapter_create


This method creates an adapter object based on the configuration in the FMU
Model object.

### Parameters

fmu_model (FmuModel*)
: FMU Model descriptor object.

### Returns

0 (int32_t)
: The related adapter was loaded by the fmimcl.

-EINVAL (-22)
: No matching adapter found.



## mcl_create
Expand Down Expand Up @@ -241,7 +256,6 @@ model (ModelDesc*)




## Typedefs

### FmuData
Expand All @@ -250,7 +264,8 @@ model (ModelDesc*)
typedef struct FmuData {
int count;
const char** name;
double* scalar;
uint32_t* binary_len;
int* kind;
int* mg_table;
}
```
Expand All @@ -269,9 +284,9 @@ typedef struct FmuModel {
const char* handle;
FmuSignal* signals;
void* m_doc;
void* v_doc;
void* adapter;
FmuData data;
struct (anonymous struct at dse/fmimcl/fmimcl.h:257:5) measurement;
}
```

Expand All @@ -285,53 +300,33 @@ typedef struct FmuSignal {
int variable_kind;
int variable_dir;
int variable_type;
const char* variable_annotation_encoding;
}
```

## Functions

### fmimcl_adapter_create

This method creates an adapter object based on the configuration in the FMU
Model object.

#### Parameters

fmu_model (FmuModel*)
: Fmu Model descriptor object.

#### Returns

0 (int32_t)
: The related adapter was loaded by the fmimcl.

-EINVAL (-22)
: No matching adapter found.



### fmimcl_allocate_scalar_source
### fmimcl_allocate_source

For each Signal parsed from the Signalgroup, this function creates an
intermediate signal object for mapping between SignalVector and FMU Variable.

#### Parameters

fmu_model (FmuModel*)
: Fmu Model descriptor object.

: FMU Model descriptor object.



### fmimcl_destroy

Releases memory and system resources allocated by fmimcl.
Releases memory and system resources allocated by
FMI Model Compatibility Library.

#### Parameters

fmu_model (FmuModel*)
: Fmu Model descriptor object.

: FMU Model descriptor object.



Expand All @@ -345,21 +340,34 @@ of signal blocks, each representing a marshal group.
#### Parameters

fmu_model (FmuModel*)
: Fmu Model descriptor object.
: FMU Model descriptor object.



### fmimcl_load_encoder_funcs

Parse the MarshalGroup NTL and for each Kind which supports an encoder
function attempt to load the configured encoder functions to:

* .functions.string_encode
* .functions.string_decode

#### Parameters

fmu_model (FmuModel*)
: FMU Model descriptor object.



### fmimcl_parse

This function parses the given yaml files into a Fmu Model descriptor object
This function parses the given yaml files into a FMU Model descriptor object
and into a mapping list between the signals and FMU variables.

#### Parameters

fmu_model (FmuModel*)
: Fmu Model descriptor object.

: FMU Model descriptor object.



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 928c931

Please sign in to comment.