|
Robotran C Documentation
|
Go to the documentation of this file.
142 MbsBuffer*
mbs_new_buffer(
char* filename,
char* anim_name,
int nx,
int size,
int id,
char* buf_format,
int save_anim,
int save_visu,
double anim_period,
int saving_mode,
int* indices_to_print,
char** labels,
int flag_custom_label);
char * buf_format
Format of the buffer output.
Definition: mbs_buffer.h:82
char * filename
the name of the text file associated to this buffer
Definition: mbs_buffer.h:64
@ BUFFER_X
Definition: mbs_buffer.h:23
int id
ID of the buffer.
Definition: mbs_buffer.h:76
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
double last_t
the time corresponding to 'last_x'
Definition: mbs_buffer.h:58
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:235
@ BUFFER_Q
Definition: mbs_buffer.h:21
void set_output_nb_new(int nb)
set the number of new user inputs
Definition: set_output.c:362
int mbs_anim_write(MbsBuffer *b)
Write the content of the q buffer as anim file to the disk.
Definition: mbs_buffer.c:571
double * tx
the array in which the time and the value are saved.
Definition: mbs_buffer.h:52
buffer used to store the user variables to output
Definition: mbs_buffer.h:98
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
@ BUFFER_LINK_ZD
Definition: mbs_buffer.h:22
double anim_period
time interval between two recorded values in .anim file
Definition: mbs_buffer.h:34
int mbs_buffer_write(MbsBuffer *b)
Write the content of the buffer to disk.
Definition: mbs_buffer.c:467
int size
the size of the buffer (i.e.
Definition: mbs_buffer.h:70
double ** X
the tabular (2 dimensions) in which the values are stored
Definition: mbs_buffer.h:102
char * buf_separator
Format of the separator in the buffer output.
Definition: mbs_buffer.h:85
int mbs_buffer_save(MbsBuffer *b, double t, double *x)
Save the given array to the specified buffer with the specified time.
Definition: mbs_buffer.c:332
int flag_not_printed
flag: 1 if it was not yet printed
Definition: mbs_buffer.h:61
int get_output_nb_new()
get the number of new user inputs
Definition: set_output.c:343
int size
the size of the buffer (i.e. the number of different value of the array that can be stored)
Definition: mbs_buffer.h:108
@ BUFFER_LINK_F
Definition: mbs_buffer.h:22
char * respath
path for the results
Definition: mbs_buffer.h:114
int mbs_growing_buffer_write(MbsGrowingBuffer *b)
write the content of the growing buffer to disk
Definition: mbs_buffer.c:713
@ BUFFER_OTHER
Definition: mbs_buffer.h:23
char * get_output_label(int index)
get the output label corresponding to the requested index
Definition: set_output.c:295
char * buf_format
Format of the buffer output, default is e.
Definition: mbs_buffer.h:117
int nx
the size of the array that is tracked by this buffer
Definition: mbs_buffer.h:73
char ** names
the names of the user variables to save
Definition: mbs_buffer.h:104
int mbs_buffer_save(MbsBuffer *b, double t, double *x)
Save the given array to the specified buffer with the specified time.
Definition: mbs_buffer.c:332
@ BUFFER_VISU
Definition: mbs_buffer.h:22
int max_nx
maximal size for nx
Definition: mbs_buffer.h:112
@ BUFFER_QC
Definition: mbs_buffer.h:22
double * t
the array in which the time value corresponding to each value of the array are stored
Definition: mbs_buffer.h:100
Definition: mbs_buffer.h:46
int mbs_growing_buffer_save(MbsGrowingBuffer *b, double t)
Save the given values of auto_output to the specified buffer with the specified time.
Definition: mbs_buffer.c:373
@ BUFFER_QDD
Definition: mbs_buffer.h:21
void mbs_delete_buffer(MbsBuffer *b)
Free memory of the specified MbsBuffer.
Definition: mbs_buffer.c:284
MbsBuffer * mbs_new_buffer(char *filename, char *anim_name, int nx, int size, int id, char *buf_format, int save_anim, int save_visu, double anim_period, int saving_mode, int *indices_to_print, char **labels, int flag_custom_labels)
Allocate and initialize a MbsBuffer structure.
Definition: mbs_buffer.c:27
void mbs_delete_growing_buffer(MbsGrowingBuffer *b)
release memory for growing buffer
Definition: mbs_buffer.c:308
double * last_x
the array in which the last values of 'x' are stored
Definition: mbs_buffer.h:55
double get_output_value(int index)
get the output value corresponding to the requested index
Definition: set_output.c:285
#define TIME_ID(i)
Macro to get the id in tx array corresponding to index (assuming b->nx exist)
Definition: mbs_buffer.c:23
int mbs_growing_buffer_write(MbsGrowingBuffer *b)
write the content of the growing buffer to disk
Definition: mbs_buffer.c:713
@ BUFFER_UX
Definition: mbs_buffer.h:21
@ BUFFER_QQ
Definition: mbs_buffer.h:21
@ BUFFER_LAMBDA
Definition: mbs_buffer.h:23
@ BUFFER_QD
Definition: mbs_buffer.h:21
void mbs_delete_buffer(MbsBuffer *b)
Free memory of the specified MbsBuffer.
Definition: mbs_buffer.c:284
void mbs_delete_growing_buffer(MbsGrowingBuffer *b)
release memory for growing buffer
Definition: mbs_buffer.c:308
MbsBuffer * mbs_new_buffer(char *filename, char *anim_name, int nx, int size, int id, char *buf_format, int save_anim, int save_visu, double anim_period, int saving_mode, int *indices_to_print, char **labels, int flag_custom_label)
Allocate and initialize a MbsBuffer structure.
Definition: mbs_buffer.c:27
@ BUFFER_LINK3D
Definition: mbs_buffer.h:23
char * buf_separator
Format of the separator in the buffer output.
Definition: mbs_buffer.h:120
MbsGrowingBuffer * mbs_new_growing_buffer(int max_nx, int size, const char *respath, int saving_mode)
create a new growing buffer for the user inputs to save
Definition: mbs_buffer.c:206
set_output function called by the user to output his own variables
int get_output_nb()
get the number of user inputs
Definition: set_output.c:325
MbsGrowingBuffer * mbs_new_growing_buffer(int max_nx, int size, const char *respath, int saving_mode)
create a new growing buffer for the user inputs to save
Definition: mbs_buffer.c:206
@ BUFFER_UXD
Definition: mbs_buffer.h:21
@ BUFFER_R
Definition: mbs_buffer.h:23
int index
indicate the index to which next values must be written
Definition: mbs_buffer.h:106
animationR .anim file info
Definition: mbs_buffer.h:29
@ BUFFER_QA
Definition: mbs_buffer.h:23
double last_print_t
last time printed in the .anim file
Definition: mbs_buffer.h:35
int save_anim
1 to save the anim file, 0 otherwise (only valid if 'save2file' is set to 1)
Definition: mbs_buffer.h:31
int mbs_growing_buffer_save(MbsGrowingBuffer *b, double t)
Save the given values of auto_output to the specified buffer with the specified time.
Definition: mbs_buffer.c:373
int mbs_anim_write(MbsBuffer *b)
Write the content of the q buffer as anim file to the disk.
Definition: mbs_buffer.c:571
int save_visu
1 to save the visu file (as in 'user_realtime_visu.c'), 0 otherwise (only valid if 'save2file' is set...
Definition: mbs_buffer.h:32
char * filename
anim file name
Definition: mbs_buffer.h:37
@ BUFFER_F
Definition: mbs_buffer.h:23
int index
indicate the index to which next values must be written
Definition: mbs_buffer.h:67
@ BUFFER_LINK_Z
Definition: mbs_buffer.h:22
int mbs_buffer_write(MbsBuffer *b)
Write the content of the buffer to disk.
Definition: mbs_buffer.c:467
int * indices_to_print
The indices to be printed by this buffer output.
Definition: mbs_buffer.h:79
int nx
the current size of the array that is tracked by this buffer
Definition: mbs_buffer.h:110
AnimInfo * anim
info for the .anim file
Definition: mbs_buffer.h:88