Skip to content

Commit

Permalink
Update API documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Jan 26, 2024
1 parent 06519f2 commit 6165b45
Show file tree
Hide file tree
Showing 34 changed files with 588 additions and 220 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ super-linter:
--env RUN_LOCAL=true \
--env DEFAULT_BRANCH=main \
--env IGNORE_GITIGNORED_FILES=true \
--env FILTER_REGEX_EXCLUDE="(dse/modelc/examples/apis/.*|doc/content/apis/modelc/examples/.*)" \
--env FILTER_REGEX_EXCLUDE="(dse/mocks/examples/.*|dse/modelc/examples/doc/.*|doc/content/apis/modelc/examples/.*|doc/content/docs/examples/modelc/.*)" \
--env VALIDATE_CPP=true \
--env VALIDATE_YAML=true \
--env VALIDATE_PYTHON_PYLINT=true \
Expand Down
7 changes: 6 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,14 @@ DOC_C_MODULES := gateway mcl model runtime schema simmock

.PHONY: examples
examples:
# API Examples
cd ..;mkdir -p doc/content/apis/modelc/examples
cd ..;cp dse/modelc/examples/gateway/gateway.c doc/content/apis/modelc/examples/gateway.c
cd ..;cp dse/modelc/examples/apis/*.c doc/content/apis/modelc/examples
cd ..;cp dse/modelc/examples/doc/apis/*.c doc/content/apis/modelc/examples
# DOC Examples
cd ..;mkdir -p doc/content/docs/examples/modelc/mocks
cd ..;find dse/mocks/examples/* -type d | xargs -I % cp -r % doc/content/docs/examples/modelc/mocks
cd ..;find dse/modelc/examples/doc/docs/* -type d | xargs -I % cp -r % doc/content/docs/examples/modelc

.PHONY: index
index:
Expand Down
10 changes: 5 additions & 5 deletions doc/content/apis/modelc/gateway/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ center footer Dynamic Simulation Environment

```c
typedef struct ModelGatewayDesc {
int * sim;
int * mi;
int * sv;
const char ** argv;
char * name_arg;
int* sim;
int* mi;
int* sv;
const char** argv;
char* name_arg;
}
```

Expand Down
28 changes: 14 additions & 14 deletions doc/content/apis/modelc/mcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ center footer Dynamic Simulation Environment

```c
typedef struct MclAdapterDesc {
const char * name;
const char* name;
MclLoadHandler load_func;
MclInitHandler init_func;
MclStepHandler step_func;
Expand All @@ -70,9 +70,9 @@ typedef struct MclAdapterDesc {

```c
typedef struct MclInstanceDesc {
int * model_instance;
int * mcl_channel_sv;
MclStrategyDesc * strategy;
int* model_instance;
int* mcl_channel_sv;
MclStrategyDesc* strategy;
int models;
}
```
Expand All @@ -81,32 +81,32 @@ typedef struct MclInstanceDesc {

```c
typedef struct MclModelDesc {
const char * name;
int * model_doc;
char * path;
void * handle;
double * vector_double;
void ** vector_binary;
const char* name;
int* model_doc;
char* path;
void* handle;
double* vector_double;
void** vector_binary;
double model_time;
double model_time_correction;
double step_size;
MclAdapterDesc * adapter;
void * private;
MclAdapterDesc* adapter;
void* private;
}
```

### MclStrategyDesc

```c
typedef struct MclStrategyDesc {
const char * name;
const char* name;
double model_time;
double stop_time;
MclExecuteMethod execute;
MclExecuteHandler execute_func;
MclMarshallOutHandler marshall_out_func;
MclMarshallInHandler marshall_in_func;
MclInstanceDesc * mcl_instance;
MclInstanceDesc* mcl_instance;
}
```

Expand Down
22 changes: 11 additions & 11 deletions doc/content/apis/modelc/model/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ center footer Dynamic Simulation Environment
typedef struct ModelDesc {
ModelVTable vtable;
ModelIndex index;
SimulationSpec * sim;
ModelInstanceSpec * mi;
SignalVector * sv;
SimulationSpec* sim;
ModelInstanceSpec* mi;
SignalVector* sv;
}
```

### ModelSignalIndex

```c
typedef struct ModelSignalIndex {
SignalVector * sv;
double * scalar;
void ** binary;
SignalVector* sv;
double* scalar;
void** binary;
uint32_t vector;
uint32_t signal;
}
Expand All @@ -133,18 +133,18 @@ typedef struct ModelVTable {

```c
typedef struct SignalVector {
const char * name;
const char * alias;
const char * function_name;
const char* name;
const char* alias;
const char* function_name;
_Bool is_binary;
uint32_t count;
const char ** signal;
const char** signal;
BinarySignalAppendFunc append;
BinarySignalResetFunc reset;
BinarySignalReleaseFunc release;
SignalAnnotationGetFunc annotation;
BinarySignalCodecFunc codec;
ModelInstanceSpec * mi;
ModelInstanceSpec* mi;
}
```

Expand Down
62 changes: 31 additions & 31 deletions doc/content/apis/modelc/runtime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ which can be used to load, configure and execute a model.

```c
typedef struct ChannelSpec {
const char * name;
const char * alias;
void * private;
const char* name;
const char* alias;
void* private;
}
```

### ModelCArguments

```c
typedef struct ModelCArguments {
const char * transport;
char * uri;
const char * host;
const char* transport;
char* uri;
const char* host;
int port;
double timeout;
int log_level;
double step_size;
double end_time;
int uid;
const char * name;
const char * file;
const char * path;
void * yaml_doc_list;
const char* name;
const char* file;
const char* path;
void* yaml_doc_list;
int timeout_set_by_cli;
int log_level_set_by_cli;
int steps;
Expand All @@ -50,29 +50,29 @@ typedef struct ModelCArguments {

```c
typedef struct ModelChannelDesc {
const char * name;
const char * function_name;
const char ** signal_names;
const char* name;
const char* function_name;
const char** signal_names;
int signal_count;
int propagator_source_channel;
int propagator_target_channel;
double * vector_double;
void ** vector_binary;
int * vector_binary_size;
int * vector_binary_buffer_size;
double* vector_double;
void** vector_binary;
int* vector_binary_size;
int* vector_binary_buffer_size;
}
```

### ModelDefinitionSpec

```c
typedef struct ModelDefinitionSpec {
const char * name;
const char * path;
const char * file;
char * full_path;
void * doc;
void * channels;
const char* name;
const char* path;
const char* file;
char* full_path;
void* doc;
void* channels;
}
```

Expand All @@ -81,26 +81,26 @@ typedef struct ModelDefinitionSpec {
```c
typedef struct ModelInstanceSpec {
int uid;
char * name;
int * model_desc;
char* name;
int* model_desc;
ModelDefinitionSpec model_definition;
void * spec;
void * yaml_doc_list;
void * private;
void* spec;
void* yaml_doc_list;
void* private;
}
```

### SimulationSpec

```c
typedef struct SimulationSpec {
const char * transport;
char * uri;
const char* transport;
char* uri;
int uid;
double timeout;
double step_size;
double end_time;
ModelInstanceSpec * instance_list;
ModelInstanceSpec* instance_list;
}
```

Expand Down
24 changes: 12 additions & 12 deletions doc/content/apis/modelc/schema/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,40 @@ documents which represent (some of) the Schemas of the Model C Library.

```c
typedef struct SchemaLabel {
const char * name;
const char * value;
const char* name;
const char* value;
}
```

### SchemaObject

```c
typedef struct SchemaObject {
const char * kind;
const char * name;
void * doc;
void * data;
const char* kind;
const char* name;
void* doc;
void* data;
}
```

### SchemaObjectSelector

```c
typedef struct SchemaObjectSelector {
const char * kind;
const char * name;
SchemaLabel * labels;
const char* kind;
const char* name;
SchemaLabel* labels;
int labels_len;
void * data;
void* data;
}
```

### SchemaSignalObject

```c
typedef struct SchemaSignalObject {
const char * signal;
void * data;
const char* signal;
void* data;
}
```

Expand Down
22 changes: 11 additions & 11 deletions doc/content/apis/modelc/simmock/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ center footer Dynamic Simulation Environment
```c
typedef struct BinaryCheck {
int index;
int * buffer;
int* buffer;
int len;
}
```
Expand All @@ -116,11 +116,11 @@ typedef struct FrameCheck {

```c
typedef struct ModelMock {
const char * name;
int * mi;
int * sv_signal;
int * sv_network;
int * sv_save;
const char* name;
int* mi;
int* sv_signal;
int* sv_network;
int* sv_save;
int vtable;
}
```
Expand All @@ -140,12 +140,12 @@ typedef struct SignalCheck {
typedef struct SimMock {
int sim;
double step_size;
ModelMock * model;
void * doc_list;
ModelMock* model;
void* doc_list;
double model_time;
int * sv_signal;
int * sv_network_rx;
int * sv_network_tx;
int* sv_signal;
int* sv_network_rx;
int* sv_network_tx;
}
```

Expand Down
Loading

0 comments on commit 6165b45

Please sign in to comment.