|
int | set_output_to_mbs (MbsData *mbs_data, int verbosity) |
| Set the address of this buffers in MbsData to expose memory + synchronize verbosity. More...
|
|
int | set_mbs_to_output (MbsData *mbs_data) |
| Set the value of this buffers from MbsData to use another module memory. More...
|
|
void | reset_flag_output () |
| reset the flag_output to 0. Useful when running several simulation in a row with different save2file settings. More...
|
|
void | init_set_output (int max_nb_curves) |
| initialize the static auto_output structure More...
|
|
int | define_output_vector (char *label, int size) |
| set needed information to handle the specified vector name in the auto_output structure. More...
|
|
void | free_set_output () |
| release memory of auto_output More...
|
|
int | set_output (double value, char *label) |
| function called by the user to output the time evolution of a value More...
|
|
int | set_output_vector (double *vector, char *label) |
| function called by the user to output the time evolution of a whole vector. More...
|
|
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_output_vector, with the output_id (starting at zero) of the vector that is known This allow to run the set_output function faster. By calling this function with an unknown vector (i.e. output_id = -1, the function will search for the correct index by itself - slower) More...
|
|
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). More...
|
|
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. More...
|
|
int | set_output_value_from_id (double value, int val_index, char *label, int output_id) |
|
double | get_output_value (int index) |
| get the output value corresponding to the requested index More...
|
|
char * | get_output_label (int index) |
| get the output label corresponding to the requested index More...
|
|
char * | get_output_vector_label (int index) |
| get the output vector label corresponding to the requested index More...
|
|
int | get_output_vector_size (int index) |
| get the output vector size corresponding to the requested index More...
|
|
int | get_output_nb () |
| get the number of user inputs More...
|
|
int | get_output_vector_nb () |
| get the number of user vector inputs More...
|
|
int | get_output_nb_new () |
| get the number of new user inputs More...
|
|
double * | get_output_vector_ptr (int index) |
| get the pointer to the output vector at the requested index More...
|
|
void | set_output_nb_new (int nb) |
| set the number of new user inputs More...
|
|
int | mbs_disable_indices_save (int **indices) |
| Disable the indices to save. More...
|
|
int | mbs_resize_indices_save (int **indices, int size) |
| Resize the indice to be saved. More...
|
|
int | mbs_set_indices_save (int **target, int size, int *indices) |
| Resize the targeted array to set the provided indices to be saved. More...
|
|
Define functions called by the user to output his own variables.
- Date
- 20/12/2023
- Author
- Robotran Team
int mbs_resize_indices_save |
( |
int ** |
indices, |
|
|
int |
size |
|
) |
| |
Resize the indice to be saved.
This function mainly free the array pointer in the provided pointer, and allocate a new one. It has been devolopped for easy resizing of specific automatic outputs (ie: q, qd, qdd...).
It can be used to disable incides too.
- Parameters
-
[in,out] | indices | Pointer to the pointer of the array to be resized. The common part of both array contains the same index value. The exceeding part contains random value as realloc does not initialize new memory. |
[in] | size | The new size of the array, a null size results in disabeling the indices (see mbs_disable_indices_save() ). |
- Returns
- MBS_INFO_SUCCESS or MBS_INFO_FAILURE.
int mbs_set_indices_save |
( |
int ** |
target, |
|
|
int |
size, |
|
|
int * |
indices |
|
) |
| |
Resize the targeted array to set the provided indices to be saved.
This function mainly free the array pointer in the provided pointer, allocate a new one and fill it with the provided indies. It has been devlopped for easy resizing of specific automatic outputs (ie: q, qd, qdd...).
It can be used to disable incides too (if both size and indices are zero/NULL).
- Parameters
-
[in,out] | target | Pointer to the pointer of the array to be filled. The array targeted can be of arbitrary size (even NULL) as it will be resized. but the target value cannot be NULL. |
[in] | size | The number of element in the indices array. If the size is zero, and indices is NULL, the targeted array is free. |
[in] | indices | The array (nor is ´i_vec1`) containing the indices to be set in the target. If the pointer is NULL, and the size is zero, the targeted array is free. |
- Returns
- MBS_INFO_SUCCESS or MBS_INFO_FAILURE.
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).
The behavior is the same as set_output_vector_from_id() except that only the specified number of values are saved stating at the specified index. The starting index refer to the buffer indexing. The values are taken from the beginning of the provided array.
In the default MBsysC behavior, if the function fails, the current module will stop.
- Parameters
-
[in] | vector | Pointer to the vector with values to be send to buffer. |
[in] | label | Current output label, NULL can be provided (no coherence check). |
[in] | output_id | Index of the output vector, starting at zero (if not known, -1). |
[in] | start | Index in the buffer array to start to save the provided vector. The value must be strictly positive and fit in the buffer size. The first index is 0. |
[in] | number | Number of value to be saved from the vector to the buffer. If this number exceed the size of the vector , an undefined behavior occurs. If start + number exceed the buffer size, an error is raised. |
- Returns
- The status, negative in case of error.
int set_output_vector |
( |
double * |
vector, |
|
|
char * |
label |
|
) |
| |
function called by the user to output the time evolution of a whole vector.
In the default MBsysC behavior, if the function fails, the current module will stop.
If you redirected the mbs_error_msg() via mbs_set_error_msg_fct_ptr() to a function that does not stop the process you can set MbsData::flag_stop to 1 to prevent further computation. If you let it continue, the vector is not saved.
- Parameters
-
[in] | vector | pointer to the current outputs vector |
[in] | label | current output label |
- Returns
- The status, negative in case of error.
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_output_vector, with the output_id (starting at zero) of the vector that is known This allow to run the set_output function faster. By calling this function with an unknown vector (i.e. output_id = -1, the function will search for the correct index by itself - slower)
In the default MBsysC behavior, if the function fails, the current module will stop.
If you redirected the mbs_error_msg() via mbs_set_error_msg_fct_ptr() to a function that does not stop the process you can set MbsData::flag_stop to 1 to prevent further computation. If you let it continue, the vector is not saved.
- Parameters
-
[in] | vector | pointer to the current outputs vector |
[in] | label | current output label (NULL if not known) |
[in] | output_id | id of the output vector, starting at zero (if not known, -1) |
- Returns
- The status, negative in case of error.