Tuesday 15 February 2011

c++ - Pipe erratic behaviour in linux / MSVC 2012 -


I have a particle system for which I basically track coordinates. So far I was output all the coordinates in the files, then do it with a Gnuplot script and using FFPAP to make a video from PGG. To leave all file I / O, I did not take any advantage before OpenGL, so I thought of installing a pipe for Gnuplot.

I like it in MSVC 2012: FILE * gnuplotpipe = _popen (GNUPLOT_NAME, "w"); Setwuf (Gnuplotipipe, Faucet, _IONBF, Faucet); // Setbuff (GnuplotPipe, Faucet); Fprintf (gnuplotpipe, "set word png \ n"); Fprintf (gnuplotpipe, "size size 720, 480 \ n"); Fprintf (gnuplotpipe, "set size ratio -1 \"); Fprintf (gnuplotpipe, "unset \ n"); Fprintf (gnuplotpipe, "set xrange [-% d:% d] \ n", RANGE + 100, RANGE + 100); Fprintf (gnuplotpipe, "set yrange [-% d:% d] \ n", RANGE + 100, RANGE + 100); For calculating fprintf (gnuplotpipe, "% f% f \ n", particle [//] for the (time-phase) // Doo Stuffprint (gnuplotpipe, "plot" - '\ n "); (all particles) I] - end for ffush (gnuplotpipe, "e \ n"); // fflush (gnuplotpipe); _pcloce (gnuplotpipe); <-> <->, x [i] -> y); end for fprintf; gnuplot -persist instead of popen and instead of

Pclose , and setbuf instead of setvbuf . It was already with much testing and error.

This is very consistent in Linux I plot '-' command and after that can read unreadable text. Nothing opens in Windows This is amazing in Windows, as sometimes it will work and I will be able to do data streaming on the GnuPlot "MS Windows" window (I mean the console is not output and it is amazing for me because I am not using wgnuplot_pipes.exe). Nothing has been plotted. The window is closed for some time-period for a second time W Lot will, but in separate windows for each time-step. Occasionally, it will crash or it will work but send unpleasant text.

I am working with 100 particles most of the time. I can have more than 10,000 time-consuming steps. I do not know that this is a lot. I suspect cut-offs in windows or some things, though I'm setting buffer with a tap. I am working in WinXX64 and QT in MSVC in Linux Mint X64 in versionbank I am using gnuplot 4.7 (win) and 4.6.0.8 (linux). I have seen very much in SO and only one problem I have found is that -persist is not actually released in windows. Any help would be appreciated.

This question is not unanswered. Puts a single window with a silly animation.

However, I would not be surprised that some other drivers try to open a window for each frame

  import subprocessation F = subprances. Popen (['/ usr / bin / gnuplot', '- persist'], stdin = subprocess.PIPE, shell = falls) f.stdin.write ('set term x11 \ n') f.stdin (I) == 50: d * = -1 i + = 1 If IRCTET = 1000 IT = = d f.stdin.write ('plot' '\' points with lines 4 PS2 \ n ') in range Range (0,500): F.stdin.write ('% f% f \ n'% (float (j), math.sin (float (j) / float (abs (i) +1)))) f.stdin.write ('e \ N ')    

No comments:

Post a Comment