gnuplot-beta

Hi,
First of all: thanks for the great tool!
However, I have a few windows-specific issues integrating gnuplot with
some software I'm writing. I use the python Gnuplot class to write
commands to a gnuplot instance, which works very well.
When wgnuplot is closed manually, the pgnuplot program stays alive. It
is therefore very hard to detect whether the gnuplot instance has been
killed (in which case I want to respawn one). I've attached a patch to
pgnuplot.c to fix this issue: it will check whether the wgnuplot process
is still alive when it receives input. By writing an empty string from
my python program twice (with a small delay in between) I can detect
that wgnuplot is closed. Perhaps it would be even better to call
select() on stdin, but I think this is usually good enough.
The second problem is that my programs spawns quite a few gnuplot
instances, and they become hard to distinguish. On linux the wxt
terminal supports a "title" option that allows to give the windows a
title, e.g. set terminal wxt title "test". It would be great to have
this in the windows terminal too. I think it shouldn't be too hard to
do, but I don't exactly know where to start. Any pointers? I guess the
first time the title is set is in src/win/winmain.c.
Regards,
--
Reinier Heeres
Waalstraat 17
2515 XK Den Haag
The Netherlands
Tel: +31 6 10852639

> When wgnuplot is closed manually, the pgnuplot program stays alive. It is
> therefore very hard to detect whether the gnuplot instance has been killed (in
> which case I want to respawn one). I've attached a patch to pgnuplot.c to fix
> this issue: it will check whether the wgnuplot process is still alive when it
> receives input. By writing an empty string from my python program twice (with
> a small delay in between) I can detect that wgnuplot is closed. Perhaps it
> would be even better to call select() on stdin, but I think this is usually
> good enough.
There is a new pgnuplot replacement just available from cvs; we are
discussing the proper name (pgnuplot? gnuplot?) -- you should have got a
copy of this email. With this new pgnuplot you will have no such problems.
> The second problem is that my programs spawns quite a few gnuplot instances,
> and they become hard to distinguish. On linux the wxt terminal supports a
> "title" option that allows to give the windows a title, e.g. set terminal wxt
> title "test". It would be great to have this in the windows terminal too.
This feature is available in the development version 4.3.x since May.
It seems it would be interesting if this gets ported into 4.2.
Well, what about a portable way
set termoption title "xxx"
Is this feasible?
---
PM

Hi,
Petr Mikulik wrote:
>> When wgnuplot is closed manually, the pgnuplot program stays alive. It is
>> therefore very hard to detect whether the gnuplot instance has been killed (in
>> which case I want to respawn one). I've attached a patch to pgnuplot.c to fix
>> this issue: it will check whether the wgnuplot process is still alive when it
>> receives input. By writing an empty string from my python program twice (with
>> a small delay in between) I can detect that wgnuplot is closed. Perhaps it
>> would be even better to call select() on stdin, but I think this is usually
>> good enough.
>>
>
> There is a new pgnuplot replacement just available from cvs; we are
> discussing the proper name (pgnuplot? gnuplot?) -- you should have got a
> copy of this email. With this new pgnuplot you will have no such problems.
>
That's great! I think calling it pgnuplot will indeed be the best
option, since it would behave similar to the older version and require
no changes to software depending on that. Do I understand correctly that
this binary does not have a command input window next to stdin and stdout?
Btw, if the old pgnuplot is kept somewhere it still might be good to
apply my patch so that it terminates if wgnuplot is closed.
>> The second problem is that my programs spawns quite a few gnuplot instances,
>> and they become hard to distinguish. On linux the wxt terminal supports a
>> "title" option that allows to give the windows a title, e.g. set terminal wxt
>> title "test". It would be great to have this in the windows terminal too.
>>
>
> This feature is available in the development version 4.3.x since May.
> It seems it would be interesting if this gets ported into 4.2.
>
Ah, sorry, I did not know. I will give the 4.3 test binary a try then!
Also, backporting sounds reasonable if it's not too much work.
> Well, what about a portable way
> set termoption title "xxx"
> Is this feasible?
>
Sounds good!
> ---
> PM
>
>
Regards,
--
Reinier Heeres
Waalstraat 17
2515 XK Den Haag
The Netherlands
Tel: +31 6 10852639

Hello Reinier,
> When wgnuplot is closed manually, the pgnuplot program stays alive. It is
> therefore very hard to detect whether the gnuplot instance has been killed (in
> which case I want to respawn one). I've attached a patch to pgnuplot.c to fix
> this issue: it will check whether the wgnuplot process is still alive when it
> receives input.
it seems your patch has not been applied. Can you please make it as a Patch
on gnuplot sourceforge site so that people can comment on it and we can
submit it to cvs afterwards?
There is another pgnuplot related issue there:
[ 1609845 ] quota limits pipe size in pgnuplot
https://sourceforge.net/tracker/?func=detail&atid=102055&aid=1609845&group_id=2055
Could you make a patch for it as well?
Greetings,
Petr