FMI_GM.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * PW_Controller.h
  3. *
  4. * Created on: Jan 25, 2017
  5. * Author: Joachim
  6. */
  7. #ifndef FMI_GM_H_
  8. #define FMI_GM_H_
  9. #include "fmi2.h"
  10. typedef enum {
  11. fmuInstantiated = 0,
  12. fmuInitMode = 1,
  13. fmuInitialized = 2,
  14. fmuTerminated = 3,
  15. fmuError = 4,
  16. fmuExperimentSettedUp = 5
  17. } FMUState;
  18. #define _NR_OF_FMUS 1
  19. #define _NR_OF_IN_CONDITIONS 2
  20. #define _NR_OF_OUT_CONDITIONS 1
  21. typedef struct {
  22. fmi2Real *r;
  23. fmi2Integer *i;
  24. fmi2Boolean *b;
  25. fmi2String *s;
  26. fmi2Boolean isVisible;
  27. fmi2String instanceName;
  28. fmi2String GUID;
  29. const fmi2CallbackFunctions* functions;
  30. fmi2Boolean loggingOn;
  31. FMUState state;
  32. fmi2Real startTime;
  33. fmi2Real stopTime;
  34. fmi2Real currentTime;
  35. fmi2Boolean stopTimeDefined;
  36. fmi2Boolean toleranceDefined;
  37. /* for generic algo*/
  38. FMU fmu[1];
  39. char *fmuResourceLocation[_NR_OF_FMUS];
  40. fmi2Component c_fmu[_NR_OF_FMUS];
  41. fmi2Boolean in_condition_executed[_NR_OF_IN_CONDITIONS];
  42. fmi2Boolean out_conditions_executed[_NR_OF_OUT_CONDITIONS];
  43. fmi2Real time_last_fmu[_NR_OF_FMUS];
  44. /* Generated */
  45. fmi2Real REL_TOLERANCE;
  46. fmi2Real ABS_TOLERANCE;
  47. fmi2Real CROSSING;
  48. fmi2Real init_up;
  49. fmi2Real init_down;
  50. fmi2Real init_armature_current;
  51. fmi2Real next_time_step;
  52. fmi2Real stored_arm_current;
  53. fmi2Real step_size;
  54. fmi2Boolean aux_obj_detected;
  55. fmi2Boolean get_next_step;
  56. fmi2Real previous_arm_current;
  57. fmi2Boolean stored_up;
  58. fmi2Boolean stored_down;
  59. } 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)
  60. #endif /* FMI_GM_H_ */