Commit 28f7f9a586250d2bffa08a14a2a91e2d97e4e4de

Authored by Arnaud Blanchard
1 parent c1753bdf

Add blc_quit in parameter of blc_init of each program

... ... @@ -52,7 +52,7 @@ int main(int argc, char **argv){
blc_program_add_option(&find_arg_str, 'a', "find_arg", "real", "Return argmax mutiplied by the real instead of max", NULL);
blc_program_add_option(&output_name, 'o', "output", "blc_channel-out", "channel name", DEFAULT_OUTPUT_NAME);
blc_program_add_parameter(&input_name, "blc_channel-in", 1, "channel you want to find max", NULL);
blc_program_init(&argc, &argv, NULL);
blc_program_init(&argc, &argv, blc_quit);
input.open(input_name, BLC_CHANNEL_READ);
... ...
... ... @@ -244,7 +244,8 @@ int main(int argc, char** argv){
blc_program_add_option(&step_size_str, 'S', "step", "real", "Set the normed step size", NULL);
blc_program_add_option(&toggle_mode, 'T', "toggle", NULL, "Set in toggle mode", NULL);
blc_program_init(&argc, &argv, blc_set_back_stdin_mode);
blc_program_init(&argc, &argv, blc_quit);
atexit(blc_set_back_stdin_mode);
if (strlen(str_quitting_key)!=1) EXIT_ON_ERROR("You can only have one quitting key. You propose %s", str_quitting_key);
... ...
... ... @@ -24,22 +24,6 @@ float gain=0;
int columns_nb=64;
int rows_nb=16;
static void info_cb(char const*, void*){
fprintf(stderr, "%d ", output.chars[0]);
}
static void period_cb(char const*argument, void*){
period=strtol(argument, NULL, 10);
step=(double)refresh_rate/(double)period;
}
static void refresh_cb(char const*argument, void*){
refresh_rate=strtol(argument, NULL, 10);
step=(double)refresh_rate/(double)period;
blc_command_loop_period=refresh_rate*1000;
}
static void start_float_loop(float frequency, float min, float max){
int i;
float time_gain, offset, gain;
... ... @@ -63,7 +47,7 @@ static void start_float_loop(float frequency, float min, float max){
}
int main(int argc, char **argv){
char const *period_str, *refresh_rate_str, *display_str, *display_height_str, *channel_name, *buffer_length_str, *type_str, *frequency_str;
char const *refresh_rate_str, *channel_name, *buffer_length_str, *type_str, *frequency_str;
char const *min_str, *max_str;
float frequency, min, max;
int buffer_length;
... ... @@ -77,7 +61,7 @@ int main(int argc, char **argv){
blc_program_add_option(&max_str, 'M', "max", "float", "maximum value of oscillation", "1");
blc_program_add_option(&refresh_rate_str, 'r', "refresh", "integer", "refresh rate in ms", "10");
blc_program_add_option(&type_str, 't', "type", "FL32", "type of data", "FL32");
blc_program_init(&argc, &argv, NULL);
blc_program_init(&argc, &argv, blc_quit);
// period=strtol(period_str, NULL, 10);
SSCANF(1, refresh_rate_str, "%f", &refresh_rate);
... ...
... ... @@ -84,7 +84,7 @@ int main(int argc, char** argv){
blc_program_add_option(&channel_name, 'o', "output_channel", "string", "Name of the channel to output the data", NULL);
blc_program_add_option(&text, 't', "text", NULL, "Export the result as text instead of blc_channel", NULL);
blc_program_add_parameter(&filename, "file name", 1, "file to load", NULL);
blc_program_init(&argc, &argv, NULL);
blc_program_init(&argc, &argv, blc_quit);
period=strtod(period_str, NULL);
... ...