Robotran C Documentation
mbs_user_interface.h
Go to the documentation of this file.
1 /* --------------------------------------------------------
2  * This code interface mbs data struct with an arbitrary user model
3  * MBsysC modules are distributed as part of the ROBOTRAN
4  * software. They provides functionalities for dealing with
5  * symbolic equations generated by ROBOTRAN.
6  *
7  * More info on www.robotran.be
8  *
9  * Universite catholique de Louvain, Belgium
10  *
11  * Last update : Fri Apr 10 11:43:58 2015
12  * --------------------------------------------------------
13  *
14  */
15 #ifndef MBS_USER_INTERFACE_h
16 #define MBS_USER_INTERFACE_h
17 #include <stdio.h>
18 
19 // ============================================================ //
20 
21 typedef struct UserModel UserModel;
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
29  void mbs_get_user_model_size(int *n_user_model);
30  void mbs_get_user_model_list(int *user_model_list);
31  void mbs_save_um(FILE* stream, UserModel* ums);
32 #ifdef __cplusplus
33 }
34 #endif
35 // ============================================================ //
36 
44 typedef struct{
45  int n_in;
46  int n_out;
47  int *size_in;
48  int *size_out;
49  double **ptr_in;
50  double **ptr_out;
51 } UserIoInfo;
52 
53 
54 typedef struct UserIO UserIO;
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
70  void mbs_delete_user_IO(UserIO *uvs);
71 
77  void mbs_print_user_IO(UserIO *uvs);
78 
85  void mbs_save_user_IO(FILE* stream, UserIO *uvs);
86 
96  void mbs_get_user_IO_size(int *n_in, int *n_out, int *n_user_IO);
97 
98 
103  void mbs_set_user_IO(UserIoInfo* ioInfo, double val);
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 # endif
mbs_get_user_IO_size
void mbs_get_user_IO_size(int *n_in, int *n_out, int *n_user_IO)
Get the size of the UserIO structure inside the user_IO.c file.
Definition: user_IO.c:36
mbs_new_user_model
UserModel * mbs_new_user_model()
Definition: user_model.c:22
UserModel
Definition: user_model.h:24
UserIoInfo::size_out
int * size_out
size_out[i] = size of i-th user output
Definition: mbs_user_interface.h:48
mbs_save_um
void mbs_save_um(FILE *stream, UserModel *ums)
UserIoInfo
Contains information about UserIO.
Definition: mbs_user_interface.h:44
UserIoInfo::n_in
int n_in
number of user input port
Definition: mbs_user_interface.h:45
UserIO
Definition: user_IO.h:25
mbs_set_user_IO
void mbs_set_user_IO(UserIoInfo *ioInfo, double val)
Set all the user_IO to the given value (generic code)
Definition: mbs_loader.c:375
mbs_delete_user_IO
void mbs_delete_user_IO(UserIO *uvs)
Free the memory associated to the given UserIO structure.
Definition: user_IO.c:30
mbs_delete_user_model
void mbs_delete_user_model(UserModel *ums)
Definition: user_model.c:30
mbs_get_user_model_list
void mbs_get_user_model_list(int *user_model_list)
Definition: user_model.c:55
UserIoInfo::ptr_in
double ** ptr_in
ptr_in[i][0] = pointer to the 1st element of the i-th input must be copied
Definition: mbs_user_interface.h:49
mbs_get_user_model_size
void mbs_get_user_model_size(int *n_user_model)
Definition: user_model.c:50
mbs_new_user_IO
UserIO * mbs_new_user_IO(UserIoInfo *ioInfo)
Initialize the UserIO structure and bind the ioInfo pointer to the allocated memory (project specific...
Definition: user_IO.c:20
UserIoInfo::size_in
int * size_in
size_in[i] = size of i-th user input
Definition: mbs_user_interface.h:47
UserIoInfo::ptr_out
double ** ptr_out
ptr_out[i][0] = pointer to the 1st element of the i-th output must be copied
Definition: mbs_user_interface.h:50
mbs_print_user_IO
void mbs_print_user_IO(UserIO *uvs)
Print the current UserIO values.
mbs_print_user_model
void mbs_print_user_model(UserModel *ums)
Definition: user_model.c:45
mbs_save_user_IO
void mbs_save_user_IO(FILE *stream, UserIO *uvs)
Save the current UserIO values into a file stream.
UserIoInfo::n_out
int n_out
number of user output port
Definition: mbs_user_interface.h:46