FMI_power_sa.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * PW_Controller.h
  3. *
  4. * Created on: Jan 25, 2017
  5. * Author: Joachim
  6. */
  7. #ifndef FMI_POWER_SA_H_
  8. #define FMI_POWER_SA_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 1
  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[_NR_OF_FMUS];
  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 stored_windowsa_u;
  46. fmi2Real stored_windowsa_d;
  47. fmi2Real stored_tau;
  48. fmi2Real stored_armature_current;
  49. fmi2Real stored_speed;
  50. fmi2Real stored_displacement;
  51. } 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)
  52. #endif /* FMI_POWER_SA_H_ */