diff --git a/LinearTransform/FMI3.xml b/LinearTransform/FMI3.xml index b313bc3d..568b4f15 100644 --- a/LinearTransform/FMI3.xml +++ b/LinearTransform/FMI3.xml @@ -13,8 +13,8 @@ - - + + diff --git a/LinearTransform/config.h b/LinearTransform/config.h index 2162985a..4b771a15 100644 --- a/LinearTransform/config.h +++ b/LinearTransform/config.h @@ -14,6 +14,7 @@ #define GET_FLOAT64 #define SET_FLOAT64 +#define GET_INT32 #define EVENT_UPDATE #define FIXED_SOLVER_STEP 1 diff --git a/LinearTransform/model.c b/LinearTransform/model.c index 4d1687ca..ffe9c3c6 100644 --- a/LinearTransform/model.c +++ b/LinearTransform/model.c @@ -31,12 +31,6 @@ Status getFloat64(ModelInstance* comp, ValueReference vr, double *value, size_t calculateValues(comp); switch (vr) { - case vr_m: - value[(*index)++] = M(m); - return OK; - case vr_n: - value[(*index)++] = M(n); - return OK; case vr_u: value[(*index)++] = M(u)[0]; value[(*index)++] = M(u)[1]; @@ -72,6 +66,20 @@ Status setFloat64(ModelInstance* comp, ValueReference vr, const double *value, s } } +Status getInt32(ModelInstance* comp, ValueReference vr, int *value, size_t *index) { + calculateValues(comp); + switch (vr) { + case vr_m: + value[(*index)++] = M(m); + return OK; + case vr_n: + value[(*index)++] = M(n); + return OK; + default: + return Error; + } +} + void eventUpdate(ModelInstance *comp) { comp->valuesOfContinuousStatesChanged = false; comp->nominalsOfContinuousStatesChanged = false;