ConOpSys V2970  P004.07
ANVILEX control operating system
rtw_continuous.h
Go to the documentation of this file.
1 /* Copyright 1990-2014 The MathWorks, Inc. */
2 
3 /*
4  * File: rtw_continuous.h
5  *
6  * Abstract:
7  * Type definitions for continuous-time support.
8  *
9  */
10 
11 #ifndef RTW_CONTINUOUS_H__
12 #define RTW_CONTINUOUS_H__
13 
14 #ifdef MATLAB_MEX_FILE
15 #include "tmwtypes.h"
16 #else
17 #include "rtwtypes.h"
18 #endif
19 
20 /* For models registering MassMatrix */
21 typedef enum {
27 
28 typedef enum {
29  SOLVER_MODE_AUTO, /* only occurs in
30  mdlInitializeSizes/mdlInitializeSampleTimes */
34 
35 typedef enum {
39 
40 /* =============================================================================
41  * Model methods object
42  * =============================================================================
43  */
44 typedef void (*rtMdlInitializeSizesFcn)(void *rtModel);
45 typedef void (*rtMdlInitializeSampleTimesFcn)(void *rtModel);
46 typedef void (*rtMdlStartFcn)(void *rtModel);
47 typedef void (*rtMdlOutputsFcn)(void *rtModel, int_T tid);
48 typedef void (*rtMdlUpdateFcn)(void *rtModel, int_T tid);
49 typedef void (*rtMdlDerivativesFcn)(void *rtModel);
50 typedef void (*rtMdlProjectionFcn)(void *rtModel);
51 typedef void (*rtMdlMassMatrixFcn)(void *rtModel);
52 typedef void (*rtMdlForcingFunctionFcn)(void *rtModel);
53 typedef void (*rtMdlTerminateFcn)(void *rtModel);
54 #ifdef RT_MALLOC
55 typedef real_T (*rtMdlDiscreteEventsFcn)(void *pModel,
56  int_T rtmNumSampTimes,
57  void *rtmTimingData,
58  int_T *rtmSampleHitPtr,
59  int_T *rtmPerTaskSampleHits);
60 #endif
61 
62 typedef struct _RTWRTModelMethodsInfo_tag {
63  void *rtModelPtr;
74 #ifdef RT_MALLOC
75  rtMdlDiscreteEventsFcn rtmDiscreteEventsFcn;
76 #endif
78 
79 #define rtmiSetRTModelPtr(M,rtmp) ((M).rtModelPtr = (rtmp))
80 #define rtmiGetRTModelPtr(M) (M).rtModelPtr
81 
82 #define rtmiSetInitSizesFcn(M,fp) \
83  ((M).rtmInitSizesFcn = ((rtMdlInitializeSizesFcn)(fp)))
84 #define rtmiSetInitSampTimesFcn(M,fp) \
85  ((M).rtmInitSampTimesFcn = ((rtMdlInitializeSampleTimesFcn)(fp)))
86 #define rtmiSetStartFcn(M,fp) \
87  ((M).rtmStartFcn = ((rtMdlStartFcn)(fp)))
88 #define rtmiSetOutputsFcn(M,fp) \
89  ((M).rtmOutputsFcn = ((rtMdlOutputsFcn)(fp)))
90 #define rtmiSetUpdateFcn(M,fp) \
91  ((M).rtmUpdateFcn = ((rtMdlUpdateFcn)(fp)))
92 #define rtmiSetDervisFcn(M,fp) \
93  ((M).rtmDervisFcn = ((rtMdlDerivativesFcn)(fp)))
94 #define rtmiSetProjectionFcn(M,fp) \
95  ((M).rtmProjectionFcn = ((rtMdlProjectionFcn)(fp)))
96 #define rtmiSetMassMatrixFcn(M,fp) \
97  ((M).rtmMassMatrixFcn = ((rtMdlMassMatrixFcn)(fp)))
98 #define rtmiSetForcingFunctionFcn(M,fp) \
99  ((M).rtmForcingFunctionFcn = ((rtMdlForcingFunctionFcn)(fp)))
100 #define rtmiSetTerminateFcn(M,fp) \
101  ((M).rtmTerminateFcn = ((rtMdlTerminateFcn)(fp)))
102 #ifdef RT_MALLOC
103 #define rtmiSetDiscreteEventsFcn(M,fp) \
104  ((M).rtmDiscreteEventsFcn = ((rtMdlDiscreteEventsFcn)(fp)))
105 #endif
106 
107 #define rtmiInitializeSizes(M) \
108  ((*(M).rtmInitSizesFcn)((M).rtModelPtr))
109 #define rtmiInitializeSampleTimes(M) \
110  ((*(M).rtmInitSampTimesFcn)((M).rtModelPtr))
111 #define rtmiStart(M) \
112  ((*(M).rtmStartFcn)((M).rtModelPtr))
113 #define rtmiOutputs(M, tid) \
114  ((*(M).rtmOutputsFcn)((M).rtModelPtr,tid))
115 #define rtmiUpdate(M, tid) \
116  ((*(M).rtmUpdateFcn)((M).rtModelPtr,tid))
117 #define rtmiDerivatives(M) \
118  ((*(M).rtmDervisFcn)((M).rtModelPtr))
119 #define rtmiProjection(M) \
120  ((*(M).rtmProjectionFcn)((M).rtModelPtr))
121 #define rtmiMassMatrix(M) \
122  ((*(M).rtmMassMatrixFcn)((M).rtModelPtr))
123 #define rtmiForcingFunction(M) \
124  ((*(M).rtmForcingFunctionFcn)((M).rtModelPtr))
125 #define rtmiTerminate(M) \
126  ((*(M).rtmTerminateFcn)((M).rtModelPtr))
127 #ifdef RT_MALLOC
128 #define rtmiDiscreteEvents(M,x1,x2,x3,x4) \
129  ((*(M).rtmDiscreteEventsFcn)((M).rtModelPtr,(x1),(x2),(x3),(x4)))
130 #endif
131 #endif /* __RTW_CONTINUOUS_H__ */
void(* rtMdlForcingFunctionFcn)(void *rtModel)
Definition: rtw_continuous.h:52
void(* rtMdlDerivativesFcn)(void *rtModel)
Definition: rtw_continuous.h:49
struct _RTWRTModelMethodsInfo_tag RTWRTModelMethodsInfo
void(* rtMdlMassMatrixFcn)(void *rtModel)
Definition: rtw_continuous.h:51
ssMatrixType
Definition: rtw_continuous.h:21
@ SS_MATRIX_NONE
Definition: rtw_continuous.h:22
@ SS_MATRIX_TIMEDEP
Definition: rtw_continuous.h:24
@ SS_MATRIX_CONSTANT
Definition: rtw_continuous.h:23
@ SS_MATRIX_STATEDEP
Definition: rtw_continuous.h:25
void(* rtMdlUpdateFcn)(void *rtModel, int_T tid)
Definition: rtw_continuous.h:48
void(* rtMdlProjectionFcn)(void *rtModel)
Definition: rtw_continuous.h:50
void(* rtMdlInitializeSampleTimesFcn)(void *rtModel)
Definition: rtw_continuous.h:45
void(* rtMdlOutputsFcn)(void *rtModel, int_T tid)
Definition: rtw_continuous.h:47
void(* rtMdlStartFcn)(void *rtModel)
Definition: rtw_continuous.h:46
SimTimeStep
Definition: rtw_continuous.h:35
@ MAJOR_TIME_STEP
Definition: rtw_continuous.h:37
@ MINOR_TIME_STEP
Definition: rtw_continuous.h:36
void(* rtMdlTerminateFcn)(void *rtModel)
Definition: rtw_continuous.h:53
void(* rtMdlInitializeSizesFcn)(void *rtModel)
Definition: rtw_continuous.h:44
SolverMode
Definition: rtw_continuous.h:28
@ SOLVER_MODE_MULTITASKING
Definition: rtw_continuous.h:32
@ SOLVER_MODE_SINGLETASKING
Definition: rtw_continuous.h:31
@ SOLVER_MODE_AUTO
Definition: rtw_continuous.h:29
double real_T
Definition: rtwtypes.h:64
int int_T
Definition: rtwtypes.h:67
Definition: rtw_continuous.h:62
rtMdlStartFcn rtmStartFcn
Definition: rtw_continuous.h:66
rtMdlUpdateFcn rtmUpdateFcn
Definition: rtw_continuous.h:68
void * rtModelPtr
Definition: rtw_continuous.h:63
rtMdlProjectionFcn rtmProjectionFcn
Definition: rtw_continuous.h:70
rtMdlOutputsFcn rtmOutputsFcn
Definition: rtw_continuous.h:67
rtMdlInitializeSampleTimesFcn rtmInitSampTimesFcn
Definition: rtw_continuous.h:65
rtMdlDerivativesFcn rtmDervisFcn
Definition: rtw_continuous.h:69
rtMdlMassMatrixFcn rtmMassMatrixFcn
Definition: rtw_continuous.h:71
rtMdlForcingFunctionFcn rtmForcingFunctionFcn
Definition: rtw_continuous.h:72
rtMdlTerminateFcn rtmTerminateFcn
Definition: rtw_continuous.h:73
rtMdlInitializeSizesFcn rtmInitSizesFcn
Definition: rtw_continuous.h:64