]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMUSimulator / include / fmi1_cs.h
1 #ifndef __FMI1_CS_H__
2 #define __FMI1_CS_H__
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 typedef struct {
9         const char *name;
10         const char *description;
11         const char *declaredType;
12         long vr;
13         // 0 = real
14         // 1 = integer
15         // 2 = boolean
16         // 3 = string
17         // 4 = enumeration
18         int type;
19         // 0 = constant
20         // 1 = parameter
21         // 2 = discrete
22         // 3 = continuous
23         // 4 = unknown
24         int variability;
25         // 0 = input
26         // 1 = output
27         // 2 = internal
28         // 3 = none
29         // 4 = unknown
30         int causality;
31 } FMIL_Variable;
32
33 typedef struct {
34         const char *name;
35         const char *description;
36         const char *quantity;
37         const char *unit;
38 } FMIL_DeclaredType;
39
40 int FMI_CS_LOAD(const char *zipFilePath, const char *unzipFolder, void **fmuPointer, int *fmuVersion, const char **error);
41
42 int FMI1_CS_UNLOAD(void* fmu, const char **error);
43 FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
44 FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
45 int FMI1_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
46 int FMI1_CS_INITIALIZE(void* fmu, const char **error);
47 int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
48
49 int FMI1_CS_SET_REAL(void *fmu, int valueId, double value, const char **error);
50 int FMI1_CS_SET_INTEGER(void *fmu, int valueId, int value, const char **error);
51 int FMI1_CS_SET_BOOLEAN(void *fmu, int valueId, int value, const char **error);
52 int FMI1_CS_SET_STRING(void *fmu, int valueId, const char *value, const char **error);
53
54 double FMI1_CS_GET_REAL(void *fmu, int valueReference, const char **error);
55 int FMI1_CS_GET_INTEGER(void *fmu, int valueReference, const char **error);
56 int FMI1_CS_GET_BOOLEAN(void *fmu, int valueReference, const char **error);
57 const char *FMI1_CS_GET_STRING(void *fmu, int valueReference, const char **error);
58
59 int FMI1_CS_GET_REALS(void *fmu, int *valueReferences, double *result, int count, const char **error);
60 int FMI1_CS_GET_INTEGERS(void *fmu, int *valueReferences, int *result, int count, const char **error);
61 int FMI1_CS_GET_BOOLEANS(void *fmu, int *valueReferences, char *result, int count, const char **error);
62 int FMI1_CS_GET_STRINGS(void *fmu, int *valueReferences, const char **result, int count, const char **error);
63
64 int FMI2_CS_UNLOAD(void* fmu, const char **error);
65 FMIL_Variable *FMI2_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
66 FMIL_DeclaredType *FMI2_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
67 int FMI2_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
68 int FMI2_CS_INITIALIZE(void* fmu, const char **error);
69 int FMI2_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
70 int FMI2_CS_SET_REAL(void *fmu, int valueId, double value, const char **error);
71 int FMI2_CS_SET_INTEGER(void *fmu, int valueId, int value, const char **error);
72 int FMI2_CS_SET_BOOLEAN(void *fmu, int valueId, int value, const char **error);
73 int FMI2_CS_SET_STRING(void *fmu, int valueId, const char *value, const char **error);
74
75 double FMI2_CS_GET_REAL(void *fmu, int valueReference, const char **error);
76 int FMI2_CS_GET_INTEGER(void *fmu, int valueReference, const char **error);
77 int FMI2_CS_GET_BOOLEAN(void *fmu, int valueReference, const char **error);
78 const char *FMI2_CS_GET_STRING(void *fmu, int valueReference, const char **error);
79
80 int FMI2_CS_GET_REALS(void *fmu, int *valueReferences, double *result, int count, const char **error);
81 int FMI2_CS_GET_INTEGERS(void *fmu, int *valueReferences, int *result, int count, const char **error);
82 int FMI2_CS_GET_BOOLEANS(void *fmu, int *valueReferences, int *result, int count, const char **error);
83 int FMI2_CS_GET_STRINGS(void *fmu, int *valueReferences, const char **result, int count, const char **error);
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #endif // __FMI1_CS_H__