FMI_Environment.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * PW_Controller.h
  3. *
  4. * Created on: Jan 25, 2017
  5. * Author: Joachim
  6. */
  7. #ifndef FMI_ENVIRONMENT_H_
  8. #define FMI_ENVIRONMENT_H_
  9. double relativeError(double a, double b);
  10. double absoluteError(double a, double b);
  11. int is_close(double a, double b, double REL_TOL, double ABS_TOL);
  12. typedef enum {
  13. fmuInstantiated = 0,
  14. fmuInitMode = 1,
  15. fmuInitialized = 2,
  16. fmuTerminated = 3,
  17. fmuError = 4,
  18. fmuExperimentSettedUp = 5
  19. } FMUState;
  20. typedef struct {
  21. fmi2Real *r;
  22. fmi2Integer *i;
  23. fmi2Boolean *b;
  24. fmi2String *s;
  25. fmi2Boolean isVisible;
  26. fmi2String instanceName;
  27. fmi2String GUID;
  28. const fmi2CallbackFunctions* functions;
  29. fmi2Boolean loggingOn;
  30. FMUState state;
  31. fmi2Real stepSize;
  32. fmi2Real startTime;
  33. fmi2Real stopTime;
  34. fmi2Real currentTime;
  35. fmi2Boolean stopTimeDefined;
  36. fmi2Real tolerance;
  37. fmi2Boolean toleranceDefined;
  38. } FMUInstance; // At the moment, most of the variables not really used since multiple instances of an FMU are not supported at the moment (performance issues)
  39. #endif /* FMI_ENVIRONMENT_H_ */