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 typedef struct MbsData MbsData;
11 
12 // functions prototype
13 #ifdef __cplusplus // in case the function is called from a C++ file
14 extern "C" {
15 #endif
16 
20 int set_output_to_mbs(MbsData *mbs_data, int verbosity);
21 
25 int set_mbs_to_output(MbsData *mbs_data);
26 
27 int define_output_vector(char *label, int size);
28 int set_output(double value, char *label);
29 int set_output_vector(double *vector, char *label);
30 int set_output_vector_from_id(double *vector, char *label, int output_id);
31 
53 int set_output_partial_vector_from_id(double *vector, char *label, int output_id,
54  int start, int number);
55 int set_output_value(double value, int val_index, char *label);
56 int set_output_value_from_id(double value, int val_index, char *label, int output_id);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 void init_set_output(int max_nb_curves);
63 void free_set_output();
64 
65 double get_output_value(int index);
66 char* get_output_label(int index);
67 char* get_output_vector_label(int index);
68 int get_output_vector_size(int index);
69 int get_output_nb();
70 int get_output_nb_new();
72 double* get_output_vector_ptr(int index);
73 void set_output_nb_new(int nb);
74 void reset_flag_output();
75 
88 int mbs_disable_indices_save(int **indices);
89 
107 int mbs_resize_indices_save(int **indices, int size);
108 
129 int mbs_set_indices_save(int **target, int size, int *indices);
130 #endif
AutoOutput
User output auto-update.
Definition: mbs_output_struct.h:17
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:518
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
auto_output
static AutoOutput * auto_output
Definition: set_output.c:22
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:305
set_mbs_to_output
int set_mbs_to_output(MbsData *mbs_data)
Set the value of this buffers from MbsData to use another module memory.
Definition: set_output.c:48
MbsOutputPtr::flag_warning_output_raised
int * flag_warning_output_raised
Pointer to the flag indicating wether the warning message has been already printed once.
Definition: mbs_output_struct.h:51
set_output_nb_new
void set_output_nb_new(int nb)
set the number of new user inputs
Definition: set_output.c:362
get_output_nb
int get_output_nb()
get the number of user inputs
Definition: set_output.c:325
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:202
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:106
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:136
get_output_label
char * get_output_label(int index)
get the output label corresponding to the requested index
Definition: set_output.c:295
mbs_disable_indices_save
int mbs_disable_indices_save(int **indices)
Disable the indices to save.
Definition: set_output.c:367
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:202
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:250
mbs_data.h
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:67
mbs_error_msg
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
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:353
mbs_define.h
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:265
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:551
update_auto_output_partial_vector
int update_auto_output_partial_vector(AutoOutput *auto_output, double *vector, char *label, int output_id, int start, int number)
update auto_output when a 'set_output_partial_vector' is encountered.
Definition: auto_output.c:267
Functions::user_synch_outputs
set_mbs_to_output_ptr user_synch_outputs
Definition: mbs_data.h:192
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:166
free_set_output
void free_set_output()
release memory of auto_output
Definition: set_output.c:118
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:106
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:316
get_output_nb_new
int get_output_nb_new()
get the number of new user inputs
Definition: set_output.c:343
set_output_verbose
int set_output_verbose
1 if we want to print messages, 1 is the default. (0 no messages)
Definition: set_output.c:25
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:265
mbs_set_indices_save
int mbs_set_indices_save(int **target, int size, int *indices)
Resize the targeted array to set the provided indices to be saved.
Definition: set_output.c:418
mbs_warning_msg
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
set_output_to_mbs
int set_output_to_mbs(MbsData *mbs_data, int verbosity)
Set the address of this buffers in MbsData to expose memory + synchronize verbosity.
Definition: set_output.c:27
mbs_1D_array.h
get_output_label
char * get_output_label(int index)
get the output label corresponding to the requested index
Definition: set_output.c:295
mbs_resize_indices_save
int mbs_resize_indices_save(int **indices, int size)
Resize the indice to be saved.
Definition: set_output.c:380
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:77
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:501
set_mbs_to_output
int set_mbs_to_output(MbsData *mbs_data)
Set the value of this buffers from MbsData to use another module memory.
Definition: set_output.c:48
Functions::user
struct Functions::@4 user
AutoOutput::nb_new_outputs
int nb_new_outputs
Number of new user outputs discovered during this time step.
Definition: mbs_output_struct.h:39
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:219
init_auto_output
AutoOutput * init_auto_output(int max_nb)
initialize the AutoOutput structure
Definition: auto_output.c:24
AutoOutput::out_vector_nb
int out_vector_nb
Current number of user outputs vectors.
Definition: mbs_output_struct.h:21
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:405
get_output_value
double get_output_value(int index)
get the output value corresponding to the requested index
Definition: set_output.c:285
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:535
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:568
mbs_disable_indices_save
int mbs_disable_indices_save(int **indices)
Disable the indices to save.
Definition: set_output.c:367
MSG_PRE
#define MSG_PRE
Definition: set_output.c:20
MbsOutputPtr::auto_output
AutoOutput ** auto_output
Pointer to the pointer of the user outputs.
Definition: mbs_output_struct.h:46
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:167
get_output_vector_nb
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:334
free_auto_output
void free_auto_output(AutoOutput *auto_output)
release memory for AutoOutput
Definition: auto_output.c:130
MbsData::fct
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:426
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:250
set_output_partial_vector_from_id
int set_output_partial_vector_from_id(double *vector, char *label, int output_id, int start, int number)
Set part of a vector into a buffer (from its id).
Definition: set_output.c:221
AutoOutput::out_nb
int out_nb
Current number of user outputs.
Definition: mbs_output_struct.h:19
get_output_nb_new
int get_output_nb_new()
get the number of new user inputs
Definition: set_output.c:343
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:325
set_output_partial_vector_from_id
int set_output_partial_vector_from_id(double *vector, char *label, int output_id, int start, int number)
Set part of a vector into a buffer (from its id).
Definition: set_output.c:221
set_output_nb_new
void set_output_nb_new(int nb)
set the number of new user inputs
Definition: set_output.c:362
MbsData
Definition: mbs_data.h:247
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:167
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:316
MSG_ERR
#define MSG_ERR
Definition: set_output.c:19
get_output_vector_nb
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:334
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:136
init_set_output
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:85
MbsOutputPtr::flag_output
int * flag_output
Pointer to the flag to indicate whether the outputs are activated (1) or deactived (0).
Definition: mbs_output_struct.h:48
MbsData::user_outputs
MbsOutputPtr user_outputs
Structure to share outputs between different process/libraries.
Definition: mbs_data.h:432
get_output_value
double get_output_value(int index)
get the output value corresponding to the requested index
Definition: set_output.c:285
mbs_set_indices_save
int mbs_set_indices_save(int **target, int size, int *indices)
Resize the targeted array to set the provided indices to be saved.
Definition: set_output.c:418
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:30
mbs_resize_indices_save
int mbs_resize_indices_save(int **indices, int size)
Resize the indice to be saved.
Definition: set_output.c:380
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:77
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:305
free_set_output
void free_set_output()
release memory of auto_output
Definition: set_output.c:118
init_set_output
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:85
flag_warning_output_raised
int flag_warning_output_raised
1 if a warning message has already been raised, 0 otherwise
Definition: set_output.c:24
flag_output
int flag_output
1 if init_set_output was called, 0 otherwise
Definition: set_output.c:23
MbsOutputPtr::set_output_verbose
int * set_output_verbose
1 if we want to print messages, 1 is the default. (0 no messages)
Definition: mbs_output_struct.h: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:353
set_output_to_mbs
int set_output_to_mbs(MbsData *mbs_data, int verbosity)
Set the address of this buffers in MbsData to expose memory + synchronize verbosity.
Definition: set_output.c:27