On 5/14/2015 3:15 PM, Henrik Rydberg wrote:
> Thank you for the explanation and for the one and only plotting software I
> always come back to. Veusz is amazing!
> 
> I just thought, since the reload function have some kind of timer maybe it
> would not be so hard to add kind of a "tick box" used together with reload
> like "export on reload"...since the export plugin could already be set up
> with desired settings and overwrite without prompt.

Hi Henrik,
  To some extent, this is possible to do using a script run in Veusz --
it's probably not a _supported_ usage, but it works. The key is that you
can import PyQt4 from the scripting command line and it works. If you
open the example Help->Example documents->fit and paste the following
lines into the command prompt, you'll see that the data points update
once a second, and so does the fit:

def timerFn():
  d, symerr, poserr, negerr = GetData('y')
  d *= 1.1
  SetData('y', d, symerr=symerr, poserr=poserr, negerr=negerr)
  Action('fit', '/page1/graph1/fit1')

from PyQt4 import QtCore
timer = QtCore.QTimer()
timer.timeout.connect(timerFn)
timer.start(1000) # run once per second

The contents of timerFn can probably be almost anything that you could
type at the Veusz command line; I've tested GetData(), SetData(), Set(),
Action(), and Export() and they all work. (Although print() doesn't
work, I checked that.) In particular, you could do

def timerFn():
  ReloadData()
  Export('myplot.eps') # and customize your settings

and it should work. If this works for you, please let me know. (Though
as I said, this is probably totally unsupported and may crash randomly
-- though since QTimer is fired through the event loop, it should be
much more stable than e.g. trying to fire off a QThread.)

Regards,
--BKS

_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à