X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.fmil.core%2Fnative%2FFMUSimulator%2Finclude%2Ffmi1_cs.h;h=40d942b15f531e2d64b2b9ccf7a13dae7409cfbe;hb=9dcc8cac323b2fc064007203ef76e57e152699db;hp=65072e1f41f311a1c750eba72259ffcd292fca01;hpb=e3ede17bbc55c6598bc5262015ff5ea8df3570e0;p=simantics%2Ffmil.git diff --git a/org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h b/org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h index 65072e1..40d942b 100644 --- a/org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h +++ b/org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h @@ -1,55 +1,66 @@ -#ifndef __FMI1_CS_H__ -#define __FMI1_CS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - char *name; - char *description; - char *declaredType; - long vr; - // 0 = real - // 1 = integer - // 2 = boolean - // 3 = string - // 4 = enumeration - int type; - // 0 = constant - // 1 = parameter - // 2 = discrete - // 3 = continuous - // 4 = unknown - int variability; - // 0 = input - // 1 = output - // 2 = internal - // 3 = none - // 4 = unknown - int causality; -} FMIL_Variable; - -typedef struct { - char *name; - char *description; - char *quantity; - char *unit; -} FMIL_DeclaredType; - -__declspec(dllexport) void* FMI1_CS_LOAD(const char *zipFilePath, const char *unzipFolder); -__declspec(dllexport) int FMI1_CS_UNLOAD(void* fmu); -__declspec(dllexport) FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count); -__declspec(dllexport) FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count); -__declspec(dllexport) int FMI1_CS_INSTANTIATE(void* fmu); -__declspec(dllexport) int FMI1_CS_INITIALIZE(void* fmu); -__declspec(dllexport) int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize); -__declspec(dllexport) double FMI1_CS_SET_REAL(void* fmu, int vr, double value); -__declspec(dllexport) int FMI1_CS_GET_REALS(void* fmu, int *vrs, double *values, int count); -__declspec(dllexport) double FMI1_CS_GET_REAL(void* fmu, int vr); - -#ifdef __cplusplus -} -#endif - +#ifndef __FMI1_CS_H__ +#define __FMI1_CS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char *name; + char *description; + char *declaredType; + long vr; + // 0 = real + // 1 = integer + // 2 = boolean + // 3 = string + // 4 = enumeration + int type; + // 0 = constant + // 1 = parameter + // 2 = discrete + // 3 = continuous + // 4 = unknown + int variability; + // 0 = input + // 1 = output + // 2 = internal + // 3 = none + // 4 = unknown + int causality; +} FMIL_Variable; + +typedef struct { + char *name; + char *description; + char *quantity; + char *unit; +} FMIL_DeclaredType; + +__declspec(dllexport) int FMI_CS_LOAD(const char *zipFilePath, const char *unzipFolder, void **fmuPointer, int *fmuVersion, const char **error); + +__declspec(dllexport) int FMI1_CS_UNLOAD(void* fmu, const char **error); +__declspec(dllexport) FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count, const char **error); +__declspec(dllexport) FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error); +__declspec(dllexport) int FMI1_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error); +__declspec(dllexport) int FMI1_CS_INITIALIZE(void* fmu, const char **error); +__declspec(dllexport) int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error); +__declspec(dllexport) int FMI1_CS_SET_REAL(void* fmu, int vr, double value, const char **error); +__declspec(dllexport) double FMI1_CS_GET_REAL(void* fmu, int vr, const char **error); +__declspec(dllexport) int FMI1_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error); + +__declspec(dllexport) int FMI2_CS_UNLOAD(void* fmu, const char **error); +__declspec(dllexport) FMIL_Variable *FMI2_CS_GET_VARIABLES(void* fmu, int *count, const char **error); +__declspec(dllexport) FMIL_DeclaredType *FMI2_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error); +__declspec(dllexport) int FMI2_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error); +__declspec(dllexport) int FMI2_CS_INITIALIZE(void* fmu, const char **error); +__declspec(dllexport) int FMI2_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error); +__declspec(dllexport) int FMI2_CS_SET_REAL(void* fmu, int vr, double value, const char **error); +__declspec(dllexport) double FMI2_CS_GET_REAL(void* fmu, int vr, const char **error); +__declspec(dllexport) int FMI2_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error); + +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file