Not sure I completely understand the problem so forgive me if this isn’t the problem…
Concerning the progrss bar, If it is outputing a line that looks like it is updating, its just writing a \r character. You could look for that on the stdout/stderr stream and update the progressbar accordingly.
I would guess that its running in it’s own thread and with a qtimer, etc it would be easy to track.
PS: good work on the new primitive stuff!
From: “Marcus D. Hanwell” email@example.com
Date: Sun, 23 Nov 2008 15:08:03
Subject: Re: [Avogadro-devel] povray export
On Sunday 23 November 2008 13:56:44 Tim Vandermeersch wrote:
On Sun, Nov 23, 2008 at 7:15 PM, Marcus D. Hanwell firstname.lastname@example.org wrote:
On Sunday 23 November 2008 11:40:57 email@example.com wrote:
First, congrats Marcus for the vastly improved povray export.
A few observations:
- the default filename for me was /home/.png. First, I’d suggest
replacing “.png” by “example.png” or something like that; Second, it
doesn’t really make sense to default to /home, I’d suggest $HOME
Can’t we just use untitled.png if the title is empty?
That was my thought but I just hadn’t gotten that far yet… I have added it
locally and it looks good. Working on some other changes too. Will hopefully
have a commit or two ready soon.
The default is actually taken from the molecule filename. I should try
and set up a reasonable default for the molecule filename and that will
then propagate through to everything else. I will take a look through the
Qt documentation to see if there is a sane way of finding the home
directory - I am sure there must be.
See QDir::home() and QDir::homePath()
I was sure it must exist
This is a really new feature that feeds through into several other
- I selected mistakenly /home/a.png, of course I don’t have write
access to /home, so the file couldn’t be created. Avogadro didn’t
catch that error, instead the povray run failed silently, the console
output showed that it couldn’t find the input file.
I am having trouble here trapping any of the output from POV-Ray and so
cannot do any error detection. Most other command line programs I get
output from, but POV-Ray seems to do a great job of sending it elsewhere.
I think this is what you are looking for:
// QByteArray result = m_process->readAll();
QByteArray result = m_process->readAllStandardError();
I had honestly not thought of them sending everything to the error stream! I
also thought readAll was supposed to get everything. Tests with other programs
seemed to look fine with readAll(). Thanks for pointing this out as I had left
it alone for now.
- The first time I ran pov-ray export, the “Command” field was left
blank. It was only filled the second time after I selected a valid path.
Yeah - I need to connect up several other signals to an update slot… It
is on my list of things to finish off. I have been concentrating on
getting the meshes working and testing out various orbitals.
I hope that this dialog will make the POV-Ray export much more
accessible. I would really like to trap errors from POV-Ray in an
intelligent way if there is a way to do that. Also need to search through
to path to check that POV-Ray is in it - it will fail silently right now.
Is there a way to grab progress information too? I would love to have a
progress bar for the render.
Here, povray 3.6 updates a line like :
0:00:02 Rendering line 474 of 768, 7863 supersamples
Not sure how easy it will be to extract this information, I know you
can overwrite a line in a terminal by using the backspace character.
However, I don’t know if this makes it harder…
I have seen that line myself, but cannot see an easy way to extract that
information in a sane way. I was going to see if I could spot whether other
programs had handled it. It is more of a nice thing to add polish anyway, and
seeing the preview may be more than enough for most.
This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Avogadro-devel mailing list