SM_ADC  1.0
Приём данных АЦП через разделяемую память
baseblock.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //
3 // This file is part of easyLink Library.
4 //
5 // Copyright (c) 2014 FEMTO-ST, ENSMM, UFC, CNRS.
6 //
7 // License: GNU General Public License 3
8 // Author: Guillaume J. Laurent
9 //
10 //------------------------------------------------------------------------------
11 #ifndef EASYLINK_BASEBLOCK_H
12 #define EASYLINK_BASEBLOCK_H
13 
14 //------------------------------------------------------------------------------
15 #include "array.h"
16 
17 //------------------------------------------------------------------------------
18 #ifndef INPUT_PORT_NUMBER
19 #define INPUT_PORT_NUMBER 0
21 int inputPortRows[1] = { 1 };
22 int inputPortCols[1] = { 1 };
23 #endif
24 
25 //------------------------------------------------------------------------------
26 #ifndef OUTPUT_PORT_NUMBER
27 #define OUTPUT_PORT_NUMBER 0
29 int outputPortRows[1] = { 1 };
30 int outputPortCols[1] = { 1 };
31 #endif
32 
33 //------------------------------------------------------------------------------
34 #ifndef PARAMETER_NUMBER
35 #define PARAMETER_NUMBER 0
37 int parameterType[1] = { 1 };
38 int parameterRows[1] = { 1 };
39 int parameterCols[1] = { 1 };
40 int parameterTunable[1] = { 1 };
41 #endif
42 
43 //------------------------------------------------------------------------------
44 /** BaseBlock is the basis class for designing new S-functions.
45  *
46  * Use the file sfun_offset.cpp as a template to write a new S-function.
47  */
48 class BaseBlock
49 {
50 protected:
51 
52  /** SimStruct data structure allocated for the S-function.
53  * Can be used to call simulink macros. */
54  static SimStruct *simStruct;
55 
56 public:
57 
58  static inline void setSimStruct(SimStruct *S)
59  {
60  simStruct = S;
61  }
62 
63  /** \ingroup initialization
64  * This is the first static method that the Simulink engine calls within
65  * mdlInitializeSizes.
66  * This method specifies the number of parameters and wheter or not they
67  * are tunable. A parameter is tunable if its value
68  * can change during simulation.
69  *
70  * Use -1 to specify dynamically dimensioned parameters.
71  *
72  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
74  {
75  ssSetNumSFcnParams(simStruct,PARAMETER_NUMBER);
76  for (int i=0;i<PARAMETER_NUMBER;i++)
77  {
78  if (parameterTunable[i]==0)
79  ssSetSFcnParamNotTunable(simStruct,i);
80  }
81 
82  if (ssGetSFcnParamsCount(simStruct) != PARAMETER_NUMBER)
83  throw runtime_error("easyLink error: " + toString(PARAMETER_NUMBER) + " parameters are expected.");
84  }
85 
86  /** \ingroup initialization
87  * This is the second static method that the Simulink engine calls within
88  * mdlInitializeSizes.
89  * This method specifies the number of input ports and their dimensions.
90  * All ports are set to direct feedthrough by default.
91  *
92  * Use -1 to specify dynamically dimensioned input signals.
93  *
94  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
96  {
97  if (!ssSetNumInputPorts(simStruct,INPUT_PORT_NUMBER))
98  throw runtime_error("easyLink error: Unable to set input port number to " + toString(INPUT_PORT_NUMBER) + ".");
99 
100  for (int i=0;i<INPUT_PORT_NUMBER;i++)
101  {
103  ssSetInputPortDirectFeedThrough(simStruct,i,1);
104  ssSetInputPortRequiredContiguous(simStruct,i,1);
105  }
106  }
107 
108  /** \ingroup initialization
109  * This is the third static method that the Simulink engine calls within
110  * mdlInitializeSizes.
111  * This method specifies the number of output ports and their dimensions.
112  *
113  * Use -1 to specify dynamically dimensioned output signals.
114  *
115  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
117  {
118  if (!ssSetNumOutputPorts(simStruct,OUTPUT_PORT_NUMBER))
119  throw runtime_error("easyLink error: Unable to set output port number to " + toString(OUTPUT_PORT_NUMBER) + ".");
120 
121  for (int i=0;i<OUTPUT_PORT_NUMBER;i++)
123  }
124 
125  /** \ingroup initialization
126  * This is the fourth static method that the Simulink engine calls within
127  * mdlInitializeSizes.
128  * This method specifies the number of continuous and discrete states.
129  *
130  * The default values are zero continuous states and zero discrete states.
131  *
132  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
134  {
135  ssSetNumContStates(simStruct,0);
136  ssSetNumDiscStates(simStruct,0);
137  }
138 
139  /** \ingroup initialization
140  * This is the fifth static method that the Simulink engine calls within
141  * mdlInitializeSizes.
142  * This method specifies the number of sample time (i.e., sample rates) at
143  * which the block operates.
144  *
145  * The default value is 1
146  *
147  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
149  {
150  ssSetNumSampleTimes(simStruct, 1);
151 
152  //ssSetSampleTime( simStruct, 0, "[INHERITED_SAMPLE_TIME, 0.0]" );
153  }
154 
155  /** \ingroup initialization
156  * This is the sixth static method that the Simulink engine calls within
157  * mdlInitializeSizes.
158  * This method specifies the simulation options that this block implements,
159  * using ssSetOptions.
160  *
161  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesizes.html */
162  static void initializeOptions()
163  {
164  }
165 
166  /** \ingroup initialization
167  * This static method is called with candidate dimensions for input port.
168  * If the proposed dimensions are unacceptable for the port, the method must
169  * throw an exception.
170  *
171  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlsetinputportdimensioninfo.html */
172  static void setInputPortDimensionInfo(int port,const DimsInfo_T *dimsInfo)
173  {
174  if(!ssSetInputPortDimensionInfo(simStruct, port, dimsInfo)) return;
175  }
176 
177  /** \ingroup initialization
178  * This static method is called with candidate dimensions for output port.
179  * If the proposed dimensions are unacceptable for the port, the method must
180  * throw an exception.
181  *
182  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlsetoutputportdimensioninfo.html */
183  static void setOutputPortDimensionInfo(int port,const DimsInfo_T *dimsInfo)
184  {
185  if(!ssSetOutputPortDimensionInfo(simStruct, port, dimsInfo)) return;
186  }
187 
188 
189  /** \ingroup initialization
190  * This static method is called with candidate parameter values.
191  * If the proposed dimensions or types are unacceptable, the method must
192  * throw an exception.
193  *
194  * The possible types of the paramaters are:
195  * - 1 for real parameters (scalar or array, use -1 as size to specify
196  * a dynamically dimensioned array)
197  * - 2 for literal string parameters
198  * - 3 for literal identifiers of MATLAB variables
199  *
200  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlcheckparameters.html */
201  static void checkParameters()
202  {
203  for (int i=0;i<PARAMETER_NUMBER;i++)
204  {
205  if ((parameterType[i]==2)||(parameterType[i]==3))
206  {
207  // check if it is really a string
208  if (!mxIsChar(ssGetSFcnParam(simStruct,i)))
209  throw runtime_error("easyLink error: Parameter port " + toString(i) + " must be a string.");
210 
211  if (parameterType[i]==3)
212  {
213  // check if it is really a identifier
214  string str=getParameterString(i);
215  if (!isIdentifier(str))
216  throw runtime_error("easyLink error: Parameter port " + toString(i) + " must be a valid identifier.");
217  }
218  }
219  else
220  {
221  // check if it is a scalar or a vector
222  if (mxIsSparse(ssGetSFcnParam(simStruct,i))||!mxIsDouble(ssGetSFcnParam(simStruct,i)))
223  throw runtime_error("easyLink error: Parameter port " + toString(i) + " must be a scalar or an array of real values.");
224 
225  // check the number of rows
226  if ( (parameterRows[i]>0) && (mxGetM(ssGetSFcnParam(simStruct,i))!=parameterRows[i]) )
227  throw runtime_error("easyLink error: Parameter port " + toString(i) + " must have " + toString(parameterRows[i]) + " rows.");
228 
229  // check the number of cols
230  if ( (parameterCols[i]>0) && (mxGetN(ssGetSFcnParam(simStruct,i))!=parameterCols[i]) )
231  throw runtime_error("easyLink error: Parameter port " + toString(i) + " must have " + toString(parameterCols[i]) + " cols.");
232  }
233  }
234  }
235 
236  /** \ingroup initialization
237  * This static method should specify the sample time and offset time for
238  * each sample rate at which this S-function operates.
239  *
240  * The default values are INHERITED_SAMPLE_TIME and FIXED_IN_MINOR_STEP_OFFSET
241  *
242  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlinitializesampletimes.html */
243  static void initializeSampleTimes()
244  {
245  ssSetSampleTime(simStruct, 0, INHERITED_SAMPLE_TIME);
246  ssSetOffsetTime(simStruct, 0, 0.0);
247  ssSetModelReferenceSampleTimeDefaultInheritance(simStruct);
248  }
249 
250  /** \ingroup runtime
251  * The Simulink engine invokes this method at the beginning of
252  * a simulation right after contructing the class.
253  * The method should perform initialization activities that this S-function
254  * requires only once, such as allocating memory, setting up user data, or
255  * initializing states.
256  *
257  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlstart.html */
258  void start()
259  {
260  }
261 
262  /** \ingroup runtime
263  * The Simulink engine invokes this method at each simulation time step.
264  * The method should compute the S-function's outputs at the current time
265  * step and store the results using outputArray or using writeOutput.
266  *
267  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdloutputs.html */
268  void outputs()
269  {
270  }
271 
272  /** \ingroup runtime
273  * The Simulink engine invokes this optional method at each time step to
274  * compute the derivatives of the S-function's continuous states.
275  * This method should store the derivatives in the S-function's state
276  * derivatives array using derivativesArray.
277  *
278  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlderivatives.html */
279  void derivatives()
280  {
281  }
282 
283  /** \ingroup runtime
284  * An S-function needs to provide this optional method only if it does
285  * zero-crossing detection. Implementing zero-crossing detection typically
286  * requires using the zero-crossing and mode work vectors to determine when
287  * a zero crossing occurs and how the S-function's outputs should respond
288  * to this event. The zeroCrossings method should update the S-function's
289  * zero-crossing vector, using nonSampledZCsArray.
290  *
291  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlzerocrossings.html */
293  {
294  }
295 
296  /** \ingroup runtime
297  * The Simulink engine invokes this optional method at each major
298  * simulation time step. The method should compute the S-function's states
299  * at the current time step and store the states in the S-function's state
300  * vector. The method can also perform any other tasks that the S-function
301  * needs to perform at each major time step.
302  *
303  * Use this code if your S-function has one or more discrete states or does
304  * not have direct feedthrough.
305  *
306  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlupdate.html */
307  void update()
308  {
309  }
310 
311  /** \ingroup runtime
312  * The Simulink engine invokes this method when the simulation is terminated
313  * right before deleting the class.
314  * This method should perform any terminal actions, such as freeing of
315  * memory.
316  *
317  * For more information, see: http://www.mathworks.fr/fr/help/simulink/sfg/mdlterminate.html */
318  void terminate()
319  {
320  }
321 
322  //--------------------------------------------------------------------------
323  /** \ingroup inputPort
324  * Returns the scalar value of an input port.
325  */
326  static inline double getInputDouble(int port)
327  {
328  return *ssGetInputPortRealSignal(simStruct,port);
329  }
330 
331  /** \ingroup inputPort
332  * Returns the integer value of an input port
333  */
334  static inline double getInputInt(int port)
335  {
336  //return round(*(ssGetInputPortRealSignal(simStruct,port)));
337  return *(ssGetInputPortRealSignal(simStruct,port)); // FIXME:
338  }
339 
340  /** \ingroup inputPort
341  * Returns the input port Array.
342  */
343  static inline Array getInputArray(int port)
344  {
345  return Array(ssGetInputPortRealSignal(simStruct,port),ssGetInputPortDimensionSize(simStruct,port,0),ssGetInputPortDimensionSize(simStruct,port,1),"input port "+toString(port),true);
346  }
347 
348  /** \ingroup inputPort
349  * Returns the input port number of elements.
350  * If the input port is a 1-D array with w elements, this function returns w.
351  * If the input port is an M-by-N array, this function returns m*n.
352  */
353  static inline int getInputWidth(int port)
354  {
355  return ssGetInputPortWidth(simStruct,port);
356  }
357 
358  /** \ingroup inputPort
359  * Returns the input port number of rows.
360  */
361  static inline int getInputNRows(int port)
362  {
363  return ssGetInputPortDimensionSize(simStruct,port,0);
364  }
365 
366  /** \ingroup inputPort
367  * Returns the input port number of cols.
368  */
369  static inline int getInputNCols(int port)
370  {
371  return ssGetInputPortDimensionSize(simStruct,port,1);
372  }
373 
374  /** \ingroup inputPort
375  * Sets the input port dimensions.
376  * Must be used only in initializeInputPortSizes
377  */
378  static inline void setInputPortDimensions(int port,int nrows,int ncols)
379  {
380  if (ncols==1)
381  ssSetInputPortWidth(simStruct,port,nrows);
382  else
383  ssSetInputPortMatrixDimensions(simStruct,port,nrows,ncols);
384  }
385 
386  //--------------------------------------------------------------------------
387  /** \ingroup outputPort
388  * Writes a double or int value to an output port.
389  */
390  static inline void setOutputDouble(int port,double value)
391  {
392  double *x=ssGetOutputPortRealSignal(simStruct,port);
393  x[0]=value;
394  }
395 
396  /** \ingroup outputPort
397  * Writes an Array to an output port. Dimensions must agree.
398  */
399  static inline void setOutputArray(int port,Array & array)
400  {
401  if (ssGetOutputPortDimensionSize(simStruct,port,0)!=array.getNRows() || ssGetOutputPortDimensionSize(simStruct,port,1)!=array.getNCols())
402  throw runtime_error("easyLink error: Unable to write "+array.getName()+" to output port "+toString(port)+". Array dimensions must agree.");
403 
404  memcpy((void*)ssGetOutputPortRealSignal(simStruct,port),(void*)array.getData(), array.getWidth()*sizeof(double) );
405 #ifdef __TEST__
406  printf("easyLink test message: hard copy of array in setOutputArray(\"%s\").\n",array.getName().c_str());
407 #endif
408  }
409 
410  /** \ingroup outputPort
411  * Returns the output port Array.
412  */
413  static inline Array getOutputArray(int port)
414  {
415  return Array(ssGetOutputPortRealSignal(simStruct,port),ssGetOutputPortDimensionSize(simStruct,port,0),ssGetOutputPortDimensionSize(simStruct,port,1),"output port "+toString(port),true);
416  }
417 
418  /** \ingroup outputPort
419  * Returns the output port number of elements.
420  * If the output port is a 1-D array with w elements, this function returns w.
421  * If the output port is an M-by-N array, this function returns m*n.
422  */
423  static inline int getOutputWidth(int port)
424  {
425  return ssGetOutputPortWidth(simStruct,port);
426  }
427 
428  /** \ingroup outputPort
429  * Returns the output port number of rows.
430  */
431  static inline int getOutputNRows(int port)
432  {
433  return ssGetOutputPortDimensionSize(simStruct,port,0);
434  }
435 
436  /** \ingroup outputPort
437  * Returns the output port number of cols.
438  */
439  static inline int getOutputNCols(int port)
440  {
441  return ssGetOutputPortDimensionSize(simStruct,port,1);
442  }
443 
444  /** \ingroup outputPort
445  * Sets the output port dimensions.
446  * Must be used only in initializeOutputPortSizes
447  */
448  static inline void setOutputPortDimensions(int port,int nrows,int ncols)
449  {
450  if (ncols==1)
451  ssSetOutputPortWidth(simStruct,port,nrows);
452  else
453  ssSetOutputPortMatrixDimensions(simStruct,port,nrows,ncols);
454  }
455 
456  //--------------------------------------------------------------------------
457  /** \ingroup parameterPort
458  * Returns the double value of a parameter port.
459  */
460  static inline double getParameterDouble(int port)
461  {
462  return mxGetPr(ssGetSFcnParam(simStruct,port))[0];
463  }
464 
465  /** \ingroup parameterPort
466  * Returns the int value of a parameter port.
467  */
468  static inline int getParameterInt(int port)
469  {
470  return _round(mxGetPr(ssGetSFcnParam(simStruct,port))[0]);
471  }
472 
473  /** \ingroup parameterPort
474  * Returns the string value of a parameter port.
475  */
476  static inline string getParameterString(int port)
477  {
478  char buffer[256];
479  mxGetString(ssGetSFcnParam(simStruct,port), buffer, 256);
480  return string(buffer);
481  }
482 
483  /** \ingroup parameterPort
484  * Returns an Array connected to a parameter port.
485  */
486  static inline Array getParameterArray(int port)
487  {
488  return Array(ssGetSFcnParam(simStruct,port),"parameter "+toString(port),true);
489  }
490 
491  /** \ingroup parameterPort
492  * Returns the parameter port number of elements.
493  *
494  * If the parameter port is a 1-D array with w elements, this function returns
495  * w. If the parameter port is an M-by-N array, this function returns m*n.
496  */
497  static inline int getParameterWidth(int port)
498  {
499  return (int)mxGetM(ssGetSFcnParam(simStruct,port))*(int)mxGetN(ssGetSFcnParam(simStruct,port));
500  }
501 
502  /** \ingroup parameterPort
503  * Returns the parameter port number of rows.
504  */
505  static inline int getParameterNRows(int port)
506  {
507  return (int)mxGetM(ssGetSFcnParam(simStruct,port));
508  }
509 
510  /** \ingroup parameterPort
511  * Returns the parameter port number of cols.
512  */
513  static inline int getParameterNCols(int port)
514  {
515  return (int)mxGetN(ssGetSFcnParam(simStruct,port));
516  }
517 
518  //--------------------------------------------------------------------------
519  /** \ingroup statePort
520  * Returns the continuous state Array.
521  */
523  {
524  return Array(ssGetContStates(simStruct),ssGetNumContStates(simStruct),1,"continuous state",true);
525  }
526 
527  /** \ingroup statePort
528  * Returns the continuous state number of elements (1-D array).
529  */
530  static inline int getContinuousStateWidth(int port)
531  {
532  return ssGetNumContStates(simStruct);
533  }
534 
535  /** \ingroup statePort
536  * Writes the derivative state Array.
537  */
538  static inline void setDerivativeStateArray(Array & array)
539  {
540  if (ssGetNumContStates(simStruct)!=array.getNRows() || array.getNCols()!=1 )
541  throw runtime_error("easyLink error: Unable to write "+array.getName()+" to derivative of state port. Array dimensions must agree.");
542 
543  memcpy((void*)ssGetdX(simStruct),(void*)array.getData(), array.getWidth()*sizeof(double) );
544 #ifdef __TEST__
545  printf("easyLink test message: hard copy of array in setDerivativeStateArray(\"%s\").\n",array.getName().c_str());
546 #endif
547  }
548 
549  /** \ingroup statePort
550  * Returns the discrete state Array.
551  */
552  static inline Array getDiscreteStateArray()
553  {
554  return Array(ssGetDiscStates(simStruct),ssGetNumDiscStates(simStruct),1,"discrete state",true);
555  }
556 
557  /** \ingroup statePort
558  * Returns the discrete state number of elements (1-D array).
559  */
560  static inline int getDiscreteStateWidth(int port)
561  {
562  return ssGetNumDiscStates(simStruct);
563  }
564 
565  /** \ingroup statePort
566  * Writes the discrete state Array.
567  */
568  static inline void setDiscreteStateArray(Array & array)
569  {
570  if (ssGetNumDiscStates(simStruct)!=array.getNRows() || array.getNCols()!=1 )
571  throw runtime_error("easyLink error: Unable to write "+array.getName()+" to discrete state port. Array dimensions must agree.");
572 
573  memcpy((void*)ssGetDiscStates(simStruct),(void*)array.getData(), array.getWidth()*sizeof(double) );
574 #ifdef __TEST__
575  printf("easyLink test message: hard copy of array in setDiscreteStateArray(\"%s\").\n",array.getName().c_str());
576 #endif
577  }
578 
579  /** \ingroup statePort
580  * Sets the number of continuous states. Must be used in lastMinuteSizeChanges.
581  */
582  static inline void setContinuousStatesNumber(int num)
583  {
584  ssSetNumContStates(simStruct,num);
585  }
586 
587  /** \ingroup statePort
588  * Sets the number of discrete states. Must be used in lastMinuteSizeChanges.
589  */
590  static inline void setDiscreteStatesNumber(int num)
591  {
592  ssSetNumDiscStates(simStruct,num);
593  }
594 
595  /** Get the current simulation time */
596  static inline time_T getCurrentTime()
597  {
598  return ssGetT(simStruct);
599  }
600 
601 };
602 
603 SimStruct *BaseBlock::simStruct=NULL;
604 
605 //------------------------------------------------------------------------------
606 #endif
static void setOutputPortDimensions(int port, int nrows, int ncols)
Definition: baseblock.h:448
static Array getOutputArray(int port)
Definition: baseblock.h:413
int getNRows()
Definition: array.h:293
static void setContinuousStatesNumber(int num)
Definition: baseblock.h:582
Definition: array.h:29
int inputPortCols[1]
Definition: baseblock.h:22
int outputPortCols[1]
Definition: baseblock.h:30
static int getContinuousStateWidth(int port)
Definition: baseblock.h:530
static void initializeOptions()
Definition: baseblock.h:162
static void setDiscreteStateArray(Array &array)
Definition: baseblock.h:568
static int getParameterNCols(int port)
Definition: baseblock.h:513
static double getInputDouble(int port)
Definition: baseblock.h:326
static void initializeNumberSampleTimes()
Definition: baseblock.h:148
int inputPortRows[1]
Definition: baseblock.h:21
void outputs()
Definition: baseblock.h:268
static double getParameterDouble(int port)
Definition: baseblock.h:460
void update()
Definition: baseblock.h:307
static string getParameterString(int port)
Definition: baseblock.h:476
static int getDiscreteStateWidth(int port)
Definition: baseblock.h:560
static void setOutputDouble(int port, double value)
Definition: baseblock.h:390
outputPortName
Definition: baseblock.h:28
static int getOutputNRows(int port)
Definition: baseblock.h:431
static void initializeOutputPortSizes()
Definition: baseblock.h:116
static void initializeStatePortSizes()
Definition: baseblock.h:133
int outputPortRows[1]
Definition: baseblock.h:29
parameterName
Definition: baseblock.h:36
static void setOutputArray(int port, Array &array)
Definition: baseblock.h:399
static double getInputInt(int port)
Definition: baseblock.h:334
static void setSimStruct(SimStruct *S)
Definition: baseblock.h:58
static void setDerivativeStateArray(Array &array)
Definition: baseblock.h:538
string toString(T value)
Definition: utils.h:35
static Array getInputArray(int port)
Definition: baseblock.h:343
static int getParameterNRows(int port)
Definition: baseblock.h:505
static int getParameterInt(int port)
Definition: baseblock.h:468
static void setInputPortDimensions(int port, int nrows, int ncols)
Definition: baseblock.h:378
static int getOutputWidth(int port)
Definition: baseblock.h:423
static Array getDiscreteStateArray()
Definition: baseblock.h:552
static int getOutputNCols(int port)
Definition: baseblock.h:439
#define PARAMETER_NUMBER
Definition: baseblock.h:35
static void initializeInputPortSizes()
Definition: baseblock.h:95
int parameterRows[1]
Definition: baseblock.h:38
static void setOutputPortDimensionInfo(int port, const DimsInfo_T *dimsInfo)
Definition: baseblock.h:183
void terminate()
Definition: baseblock.h:318
static time_T getCurrentTime()
Definition: baseblock.h:596
static void setDiscreteStatesNumber(int num)
Definition: baseblock.h:590
int getNCols()
Definition: array.h:287
#define OUTPUT_PORT_NUMBER
Definition: baseblock.h:27
bool isIdentifier(string str)
Definition: utils.h:45
int parameterType[1]
Definition: baseblock.h:37
static void initializeParameterPortSizes()
Definition: baseblock.h:73
void start()
Definition: baseblock.h:258
int parameterCols[1]
Definition: baseblock.h:39
static SimStruct * simStruct
Definition: baseblock.h:54
void derivatives()
Definition: baseblock.h:279
string getName()
Definition: array.h:299
inputPortName
Definition: baseblock.h:20
static int getParameterWidth(int port)
Definition: baseblock.h:497
int parameterTunable[1]
Definition: baseblock.h:40
static Array getParameterArray(int port)
Definition: baseblock.h:486
double * getData()
Definition: array.h:256
static Array getContinuousStateArray()
Definition: baseblock.h:522
static int getInputNCols(int port)
Definition: baseblock.h:369
#define INPUT_PORT_NUMBER
Definition: baseblock.h:19
static int getInputNRows(int port)
Definition: baseblock.h:361
int getWidth()
Definition: array.h:281
static void initializeSampleTimes()
Definition: baseblock.h:243
void zeroCrossings()
Definition: baseblock.h:292
static void checkParameters()
Definition: baseblock.h:201
static int getInputWidth(int port)
Definition: baseblock.h:353
static void setInputPortDimensionInfo(int port, const DimsInfo_T *dimsInfo)
Definition: baseblock.h:172