Commit 1bd60ba5d9a7b0d7cbf9143ca7f51a495cbebe71

Authored by Arnaud Blanchard
2 parents b31bfbb9 4cd9bc22
@@ -54,41 +54,17 @@ void create_graph(deque <blc_channel>inputs, const char *title, int refresh_peri @@ -54,41 +54,17 @@ void create_graph(deque <blc_channel>inputs, const char *title, int refresh_peri
54 EXIT_ON_ARRAY_ERROR(&inputs[0], "Too many dims"); 54 EXIT_ON_ARRAY_ERROR(&inputs[0], "Too many dims");
55 break; 55 break;
56 } 56 }
57 - 57 + element_size=input->get_type_size();
58 switch (input->type){ 58 switch (input->type){
59 - case 'UIN8':  
60 - gnuplot_format="%uchar";  
61 - element_size=sizeof(uchar);  
62 - break;  
63 - case 'INT8':  
64 - gnuplot_format="%char";  
65 - element_size=sizeof(char);  
66 - break;  
67 - case 'UI16':  
68 - gnuplot_format="%uint16";  
69 - element_size=sizeof(uint16_t);  
70 - break;  
71 - case 'IN16':  
72 - gnuplot_format="%int16";  
73 - element_size=sizeof(int16_t);  
74 - break;  
75 - case 'UI32':  
76 - gnuplot_format="%uint32";  
77 - element_size=sizeof(uint32_t);  
78 - break;  
79 - case 'IN32':  
80 - gnuplot_format="%int32";  
81 - element_size=sizeof(int32_t);  
82 - break;  
83 - case 'FL32':  
84 - gnuplot_format="%float32";  
85 - element_size=sizeof(float);  
86 - break;  
87 - case 'FL64':  
88 - gnuplot_format="%float64";  
89 - element_size=sizeof(double);  
90 - break;  
91 - default: EXIT_ON_ARRAY_ERROR(&inputs[0], "The type is not managed"); 59 + case 'UIN8':gnuplot_format="%uchar";break;
  60 + case 'INT8':gnuplot_format="%char";break;
  61 + case 'IN16':gnuplot_format="%int16";break;
  62 + case 'UI16':gnuplot_format="%uint16";break;
  63 + case 'IN32':gnuplot_format="%int32";break;
  64 + case 'UI32':gnuplot_format="%uint32";break;
  65 + case 'FL32':gnuplot_format="%float32";break;
  66 + case 'FL64':gnuplot_format="%float64";break;
  67 + default: EXIT_ON_ARRAY_ERROR(input, "The type is not managed");
92 } 68 }
93 69
94 init_term(pipef, title, verbatim); 70 init_term(pipef, title, verbatim);
@@ -76,12 +76,17 @@ int main(int argc, char *argv[]){ @@ -76,12 +76,17 @@ int main(int argc, char *argv[]){
76 default: EXIT_ON_ERROR( "No default min value for type"); 76 default: EXIT_ON_ERROR( "No default min value for type");
77 } 77 }
78 78
  79 +
79 if (ymax_str) ymax=strtof(ymax_str, NULL); 80 if (ymax_str) ymax=strtof(ymax_str, NULL);
80 else switch (type){ 81 else switch (type){
81 case 'UIN8':ymax=UINT8_MAX;break; 82 case 'UIN8':ymax=UINT8_MAX;break;
82 case 'INT8':ymax=INT8_MAX;break; 83 case 'INT8':ymax=INT8_MAX;break;
  84 + case 'UI16':ymax=UINT16_MAX;break;
  85 + case 'IN16':ymax=INT16_MAX;break;
  86 + case 'UI32':ymax=UINT32_MAX;break;
  87 + case 'IN32':ymax=INT32_MAX;break;
83 case 'FL32': case 'FL64':ymax=1.0;break; 88 case 'FL32': case 'FL64':ymax=1.0;break;
84 - default: EXIT_ON_ERROR( "No default max value for type"); 89 + default: EXIT_ON_ERROR( "No default max value");
85 } 90 }
86 91
87 if (xmin_str) SSCANF(1, xmin_str, "%f", &xmin); 92 if (xmin_str) SSCANF(1, xmin_str, "%f", &xmin);