Commit b2e07816 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Fix problem with 2d plot

parent 81ef4027
......@@ -25,13 +25,10 @@ void create_graph(deque <blc_channel>&inputs, const char *title, int refresh_per
blc_channel *input=nullptr;
char const *gnuplot_format=NULL;
char command[LINE_MAX];
// char code;
int i, offset=0, columns_nb=0, rows_nb=0;
FILE *pipef;
size_t element_size;
int ret;
// char *buffer;
SYSTEM_ERROR_CHECK(pipef=popen("gnuplot", "w"), nullptr, "Calling gnuplot");
......@@ -106,7 +103,7 @@ void create_graph(deque <blc_channel>&inputs, const char *title, int refresh_per
fprintf(pipef, "\n%s\n", command);
for (i=0;i<inputs.size();i++) {
SYSTEM_SUCCESS_CHECK(fwrite(inputs[i].data, element_size, columns_nb, pipef), columns_nb, NULL);
SYSTEM_SUCCESS_CHECK(fwrite(inputs[i].data, element_size, columns_nb*rows_nb, pipef), columns_nb*rows_nb, NULL);
SYSTEM_SUCCESS_CHECK(fflush(pipef), 0, nullptr);
......@@ -56,7 +56,8 @@ int main(int argc, char *argv[]){
for (char *const*channel_name_pt = channel_names; *channel_name_pt!=nullptr; channel_name_pt++){
inputs.emplace_back(*channel_name_pt, BLC_CHANNEL_READ);
new (&inputs.back()) blc_channel(*channel_name_pt, BLC_CHANNEL_READ);
if (inputs.size()==1){ //First time
Supports Markdown
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