Commit da807e32 authored by Nicolas Van der Noot's avatar Nicolas Van der Noot
Browse files

error messages set for bad real-time flags

parent 39b7c2cb
......@@ -136,6 +136,12 @@ void mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data){
{
mbs_realtime_init(mbs_data, dd->options->dt0, dd->options->tf);
}
#else
if (dd->options->realtime)
{
printf("\nTo use the real-time features (mbs_dirdyn->options->realtime activated), set the CMake flag 'FLAG_REAL_TIME' to ON !\n");
exit(EXIT_FAILURE);
}
#endif
if(dd->options->save2file){
......
......@@ -341,86 +341,86 @@ void check_user_realtime_options(Realtime_option *options)
// errors generated
if (options->t0 >= options->tf)
{
printf("Real-time options error: t0 (%f) >= tf (%f).\n", options->t0, options->tf);
printf("\nReal-time options error: t0 (%f) >= tf (%f).\n", options->t0, options->tf);
exit(EXIT_FAILURE);
}
if (options->dt0 <= 0.0)
{
printf("Real-time options error: dt0 (%f) is not strictly positive.\n", options->dt0);
printf("\nReal-time options error: dt0 (%f) is not strictly positive.\n", options->dt0);
exit(EXIT_FAILURE);
}
if (options->y_min_init >= options->y_max_init)
{
printf("Real-time options error: y_min_init (%f) >= y_max_init (%f).\n", options->y_min_init, options->y_max_init);
printf("\nReal-time options error: y_min_init (%f) >= y_max_init (%f).\n", options->y_min_init, options->y_max_init);
exit(EXIT_FAILURE);
}
if (options->nb_q < 0)
{
printf("Real-time options error: nb_q (%d) negative.\n", options->nb_q);
printf("\nReal-time options error: nb_q (%d) negative.\n", options->nb_q);
exit(EXIT_FAILURE);
}
// warnings generated
if (options->init_speed_factor <= 0.0)
{
printf("Real-time options warning: init_speed_factor (%f) <= 0.0; set to 1.0.\n", options->init_speed_factor);
printf("\nReal-time options warning: init_speed_factor (%f) <= 0.0; set to 1.0.\n", options->init_speed_factor);
options->init_speed_factor = 1.0;
}
if (options->start_viewpoint < -1)
{
printf("Real-time options warning: start_viewpoint (%d) < -1; set to 0.\n", options->start_viewpoint);
printf("\nReal-time options warning: start_viewpoint (%d) < -1; set to 0.\n", options->start_viewpoint);
options->start_viewpoint = 0;
}
if (options->nb_viewpoints < 0)
{
printf("Real-time options warning: nb_viewpoints (%d) < 0; set to 1.\n", options->nb_viewpoints);
printf("\nReal-time options warning: nb_viewpoints (%d) < 0; set to 1.\n", options->nb_viewpoints);
options->nb_viewpoints = 1;
}
if (options->curve_width < 1)
{
printf("Real-time options warning: curve_width (%d) < 1; set to 3.\n", options->curve_width);
printf("\nReal-time options warning: curve_width (%d) < 1; set to 3.\n", options->curve_width);
options->curve_width = 3;
}
if (options->screen_width < 200)
{
printf("Real-time options warning: screen_width (%d) < 200; set to 660.\n", options->screen_width);
printf("\nReal-time options warning: screen_width (%d) < 200; set to 660.\n", options->screen_width);
options->screen_width = 660;
}
if (options->screen_height < 200)
{
printf("Real-time options warning: screen_height (%d) < 200; set to 520.\n", options->screen_height);
printf("\nReal-time options warning: screen_height (%d) < 200; set to 520.\n", options->screen_height);
options->screen_height = 520;
}
if (options->max_nb_curves < 0)
{
printf("Real-time options warning: max_nb_curves (%d) < 0; set to 12.\n", options->max_nb_curves);
printf("\nReal-time options warning: max_nb_curves (%d) < 0; set to 12.\n", options->max_nb_curves);
options->max_nb_curves = 12;
}
if (options->max_nb_legends > options->max_nb_curves)
{
printf("Real-time options warning: max_nb_legends (%d) > max_nb_curves (%d); set to %d.\n", options->max_nb_legends, options->max_nb_curves, options->max_nb_curves);
printf("\nReal-time options warning: max_nb_legends (%d) > max_nb_curves (%d); set to %d.\n", options->max_nb_legends, options->max_nb_curves, options->max_nb_curves);
options->max_nb_legends = options->max_nb_curves;
}
if (options->fqc_visu <= 0.0)
{
printf("Real-time options warning: fqc_visu (%f) <= 0.0; set to 30.0.\n", options->fqc_visu);
printf("\nReal-time options warning: fqc_visu (%f) <= 0.0; set to 30.0.\n", options->fqc_visu);
options->fqc_visu = 30.0;
}
if (options->fqc_screen <= 0.0)
{
printf("Real-time options warning: fqc_screen (%f) <= 0.0; set to 30.0.\n", options->fqc_screen);
printf("\nReal-time options warning: fqc_screen (%f) <= 0.0; set to 30.0.\n", options->fqc_screen);
options->fqc_screen = 30.0;
}
}
......@@ -529,6 +529,12 @@ Simu_realtime* init_simu_realtime(MbsData* mbs_data, Realtime_option *options, i
{
realtime->ext->java = init_realtime_java(options, mbs_data);
}
#else
if (options->flag_visu)
{
printf("\nTo use the Java visualization (realtime->options->flag_visu activated), set the CMake flag 'FLAG_VISU' to ON !\n");
exit(EXIT_FAILURE);
}
#endif
#ifdef SDL
......@@ -536,6 +542,12 @@ Simu_realtime* init_simu_realtime(MbsData* mbs_data, Realtime_option *options, i
{
realtime->ext->sdl = init_realtime_sdl(init_screen_sdl(options));
}
#else
if (options->flag_plot)
{
printf("\nTo use the real-time features (realtime->options->flag_plot activated), set the CMake flag 'FLAG_PLOT' to ON !\n");
exit(EXIT_FAILURE);
}
#endif
// absolute time before starting loop
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment