Robotran C Documentation
set_output.h
Go to the documentation of this file.
1 
7 #ifndef _SET_OUTPUT_H_
8 #define _SET_OUTPUT_H_
9 
10 // funcions prototype
11 #ifdef __cplusplus // in case the function is called from a C++ file
12  extern "C" {
13  int define_output_vector(const char* label, int size);
14  int set_output(double value, const char* label);
15  int set_output_vector(double* vector, const char* label);
16  int set_output_value(double value, int val_index, const char* label);
17  int set_output_vector_from_id(double* vector, char* label, int output_id);
18  int set_output_value_from_id(double value, int val_index, char* label, int output_id);
19  }
20 #else
21  int define_output_vector(char* label, int size);
22  int set_output(double value, char* label);
23  int set_output_vector(double* vector, char* label);
24  int set_output_vector_from_id(double* vector, char* label, int output_id);
25  int set_output_value(double value, int val_index, char* label);
26  int set_output_value_from_id(double value, int val_index, char* label, int output_id);
27 #endif
28 
29 void init_set_output(int max_nb_curves);
30 void free_set_output();
31 
32 double get_output_value(int index);
33 char* get_output_label(int index);
34 char* get_output_vector_label(int index);
35 int get_output_vector_size(int index);
36 int get_output_nb();
37 int get_output_nb_new();
39 double* get_output_vector_ptr(int index);
40 void set_output_nb_new(int nb);
41 void reset_flag_output();
42 
43 #endif
AutoOutput
User output auto-update.
Definition: auto_output.h:12
get_output_vector_ptr_auto
double * get_output_vector_ptr_auto(AutoOutput *auto_output, int index)
get the pointer to the output vector at the requested index
Definition: auto_output.c:359
auto_output
static AutoOutput * auto_output
Definition: set_output.c:7
get_output_vector_label
char * get_output_vector_label(int index)
get the output vector label corresponding to the requested index
Definition: set_output.c:211
set_output_nb_new
void set_output_nb_new(int nb)
set the number of new user inputs
Definition: set_output.c:268
get_output_nb
int get_output_nb()
get the number of user inputs
Definition: set_output.c:231
set_output_vector_from_id
int set_output_vector_from_id(double *vector, char *label, int output_id)
function called by the user to output the time evolution of a whole vector. It is very similar to set...
Definition: set_output.c:134
define_output_vector
int define_output_vector(char *label, int size)
set needed information to handle the specified vector name in the auto_output structure.
Definition: set_output.c:44
set_output
int set_output(double value, char *label)
function called by the user to output the time evolution of a value
Definition: set_output.c:74
get_output_label
char * get_output_label(int index)
get the output label corresponding to the requested index
Definition: set_output.c:201
mbs_error_msg
void mbs_error_msg(char *msg,...)
Send an error message.
Definition: mbs_message.c:102
set_output_vector_from_id
int set_output_vector_from_id(double *vector, char *label, int output_id)
function called by the user to output the time evolution of a whole vector. It is very similar to set...
Definition: set_output.c:134
set_output_value
int set_output_value(double value, int val_index, char *label)
function called by the user to output the time evolution of a value in a vector.
Definition: set_output.c:156
define_auto_output_vector
int define_auto_output_vector(AutoOutput *auto_output, char *label, int size)
set memory for a vector in AutoOutput
Definition: auto_output.c:54
get_output_vector_ptr
double * get_output_vector_ptr(int index)
get the pointer to the output vector at the requested index
Definition: set_output.c:259
set_output_value_from_id
int set_output_value_from_id(double value, int val_index, char *label, int output_id)
Definition: set_output.c:171
get_output_vector_label_auto
char * get_output_vector_label_auto(AutoOutput *auto_output, int index)
get the output vector label corresponding to the requested index
Definition: auto_output.c:392
update_auto_output
int update_auto_output(AutoOutput *auto_output, double value, char *label)
update auto_output when a 'set_output' is encountered
Definition: auto_output.c:137
free_set_output
void free_set_output()
release memory of auto_output
Definition: set_output.c:56
define_output_vector
int define_output_vector(char *label, int size)
set needed information to handle the specified vector name in the auto_output structure.
Definition: set_output.c:44
get_output_vector_size
int get_output_vector_size(int index)
get the output vector size corresponding to the requested index
Definition: set_output.c:222
get_output_nb_new
int get_output_nb_new()
get the number of new user inputs
Definition: set_output.c:249
set_output_value_from_id
int set_output_value_from_id(double value, int val_index, char *label, int output_id)
Definition: set_output.c:171
get_output_label
char * get_output_label(int index)
get the output label corresponding to the requested index
Definition: set_output.c:201
reset_flag_output
void reset_flag_output()
reset the flag_output to 0. Useful when running several simulation in a row with different save2file ...
Definition: set_output.c:15
get_output_value_auto
double get_output_value_auto(AutoOutput *auto_output, int index)
get the output value corresponding to the requested index
Definition: auto_output.c:342
AutoOutput::nb_new_outputs
int nb_new_outputs
number of new user outputs discovered during this time step
Definition: auto_output.h:26
update_auto_output_vector
int update_auto_output_vector(AutoOutput *auto_output, double *vector, char *label, int output_id)
update auto_output when a 'set_output_vector' is encountered
Definition: auto_output.c:189
init_auto_output
AutoOutput * init_auto_output(int max_nb)
initialize the AutoOutput structure
Definition: auto_output.c:13
AutoOutput::out_vector_nb
int out_vector_nb
current number of user outputs vectors
Definition: auto_output.h:15
update_auto_output_value
int update_auto_output_value(AutoOutput *auto_output, double value, int val_index, char *label, int output_id)
update auto_output when a 'set_output_value' is encountered It can take the label and/or the output_i...
Definition: auto_output.c:247
get_output_value
double get_output_value(int index)
get the output value corresponding to the requested index
Definition: set_output.c:191
get_output_label_auto
char * get_output_label_auto(AutoOutput *auto_output, int index)
get the output label corresponding to the requested index
Definition: auto_output.c:376
get_output_vector_size_auto
int get_output_vector_size_auto(AutoOutput *auto_output, int index)
get the output vector size corresponding to the requested index
Definition: auto_output.c:409
auto_output.h
functions used to automatically update the user output values
set_output_vector
int set_output_vector(double *vector, char *label)
function called by the user to output the time evolution of a whole vector.
Definition: set_output.c:102
get_output_vector_nb
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:240
free_auto_output
void free_auto_output(AutoOutput *auto_output)
release memory for AutoOutput
Definition: auto_output.c:101
set_output_value
int set_output_value(double value, int val_index, char *label)
function called by the user to output the time evolution of a value in a vector.
Definition: set_output.c:156
AutoOutput::out_nb
int out_nb
current number of user outputs
Definition: auto_output.h:14
get_output_nb_new
int get_output_nb_new()
get the number of new user inputs
Definition: set_output.c:249
set_output.h
set_output function called by the user to output his own variables
mbs_message.h
get_output_nb
int get_output_nb()
get the number of user inputs
Definition: set_output.c:231
set_output_nb_new
void set_output_nb_new(int nb)
set the number of new user inputs
Definition: set_output.c:268
set_output_vector
int set_output_vector(double *vector, char *label)
function called by the user to output the time evolution of a whole vector.
Definition: set_output.c:102
get_output_vector_size
int get_output_vector_size(int index)
get the output vector size corresponding to the requested index
Definition: set_output.c:222
get_output_vector_nb
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:240
set_output
int set_output(double value, char *label)
function called by the user to output the time evolution of a value
Definition: set_output.c:74
init_set_output
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:23
get_output_value
double get_output_value(int index)
get the output value corresponding to the requested index
Definition: set_output.c:191
reset_flag_output
void reset_flag_output()
reset the flag_output to 0. Useful when running several simulation in a row with different save2file ...
Definition: set_output.c:15
get_output_vector_label
char * get_output_vector_label(int index)
get the output vector label corresponding to the requested index
Definition: set_output.c:211
free_set_output
void free_set_output()
release memory of auto_output
Definition: set_output.c:56
init_set_output
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:23
mbs_warning_msg
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89
flag_warning_output_raised
int flag_warning_output_raised
1 if a warning message has already been raised, 0 otherwise
Definition: set_output.c:9
flag_output
int flag_output
1 if init_set_output was called, 0 otherwise
Definition: set_output.c:8
get_output_vector_ptr
double * get_output_vector_ptr(int index)
get the pointer to the output vector at the requested index
Definition: set_output.c:259