]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[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 #ifdef _MSC_VER
9 #define DLLEXPORT __declspec(dllexport)
10 #else
11 #define DLLEXPORT
12 #endif
13
14 typedef struct {
15         char *name;
16         char *description;
17         char *declaredType;
18         long vr;
19         // 0 = real
20         // 1 = integer
21         // 2 = boolean
22         // 3 = string
23         // 4 = enumeration
24         int type;
25         // 0 = constant
26         // 1 = parameter
27         // 2 = discrete
28         // 3 = continuous
29         // 4 = unknown
30         int variability;
31         // 0 = input
32         // 1 = output
33         // 2 = internal
34         // 3 = none
35         // 4 = unknown
36         int causality;
37 } FMIL_Variable;
38
39 typedef struct {
40         char *name;
41         char *description;
42         char *quantity;
43         char *unit;
44 } FMIL_DeclaredType;
45
46 DLLEXPORT int FMI_CS_LOAD(const char *zipFilePath, const char *unzipFolder, void **fmuPointer, int *fmuVersion, const char **error);
47
48 DLLEXPORT int FMI1_CS_UNLOAD(void* fmu, const char **error);
49 DLLEXPORT FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
50 DLLEXPORT FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
51 DLLEXPORT int FMI1_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
52 DLLEXPORT int FMI1_CS_INITIALIZE(void* fmu, const char **error);
53 DLLEXPORT int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
54 DLLEXPORT int FMI1_CS_SET_REAL(void* fmu, int vr, double value, const char **error);
55 DLLEXPORT double FMI1_CS_GET_REAL(void* fmu, int vr, const char **error);
56 DLLEXPORT int FMI1_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error);
57
58 DLLEXPORT int FMI2_CS_UNLOAD(void* fmu, const char **error);
59 DLLEXPORT FMIL_Variable *FMI2_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
60 DLLEXPORT FMIL_DeclaredType *FMI2_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
61 DLLEXPORT int FMI2_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
62 DLLEXPORT int FMI2_CS_INITIALIZE(void* fmu, const char **error);
63 DLLEXPORT int FMI2_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
64 DLLEXPORT int FMI2_CS_SET_REAL(void* fmu, int vr, double value, const char **error);
65 DLLEXPORT double FMI2_CS_GET_REAL(void* fmu, int vr, const char **error);
66 DLLEXPORT int FMI2_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif // __FMI1_CS_H__