Commit 1bd60ba5 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files
parents b31bfbb9 4cd9bc22
......@@ -54,41 +54,17 @@ void create_graph(deque <blc_channel>inputs, const char *title, int refresh_peri
EXIT_ON_ARRAY_ERROR(&inputs[0], "Too many dims");
break;
}
element_size=input->get_type_size();
switch (input->type){
case 'UIN8':
gnuplot_format="%uchar";
element_size=sizeof(uchar);
break;
case 'INT8':
gnuplot_format="%char";
element_size=sizeof(char);
break;
case 'UI16':
gnuplot_format="%uint16";
element_size=sizeof(uint16_t);
break;
case 'IN16':
gnuplot_format="%int16";
element_size=sizeof(int16_t);
break;
case 'UI32':
gnuplot_format="%uint32";
element_size=sizeof(uint32_t);
break;
case 'IN32':
gnuplot_format="%int32";
element_size=sizeof(int32_t);
break;
case 'FL32':
gnuplot_format="%float32";
element_size=sizeof(float);
break;
case 'FL64':
gnuplot_format="%float64";
element_size=sizeof(double);
break;
default: EXIT_ON_ARRAY_ERROR(&inputs[0], "The type is not managed");
case 'UIN8':gnuplot_format="%uchar";break;
case 'INT8':gnuplot_format="%char";break;
case 'IN16':gnuplot_format="%int16";break;
case 'UI16':gnuplot_format="%uint16";break;
case 'IN32':gnuplot_format="%int32";break;
case 'UI32':gnuplot_format="%uint32";break;
case 'FL32':gnuplot_format="%float32";break;
case 'FL64':gnuplot_format="%float64";break;
default: EXIT_ON_ARRAY_ERROR(input, "The type is not managed");
}
init_term(pipef, title, verbatim);
......
......@@ -76,12 +76,17 @@ int main(int argc, char *argv[]){
default: EXIT_ON_ERROR( "No default min value for type");
}
if (ymax_str) ymax=strtof(ymax_str, NULL);
else switch (type){
case 'UIN8':ymax=UINT8_MAX;break;
case 'INT8':ymax=INT8_MAX;break;
case 'UI16':ymax=UINT16_MAX;break;
case 'IN16':ymax=INT16_MAX;break;
case 'UI32':ymax=UINT32_MAX;break;
case 'IN32':ymax=INT32_MAX;break;
case 'FL32': case 'FL64':ymax=1.0;break;
default: EXIT_ON_ERROR( "No default max value for type");
default: EXIT_ON_ERROR( "No default max value");
}
if (xmin_str) SSCANF(1, xmin_str, "%f", &xmin);
......
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