Bugs item #1674533, was opened at 2007-03-05 20:38
Message generated for change (Comment added) made by ceroni
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1674533&group_id=23629
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Scripting
Group: v11
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: ceroni (ceroni)
Assigned to: Miguel (migueljmol)
Summary: trouble with ECHO command
Initial Comment:
I'm trying to use the ECHO command to just warn users that the molecule loading
can take a while. I've figure out that it isn't possible to use ECHO before
loading any pdb file, so I'm using a dummy file whith just one H atom.
I've tried this without success (the ECHO never appears):
jmolApplet(550, "load dummy.pdb; spacefill off; set echo middle center; echo
\"Loading molecule|Please wait...||This can take a while\"; load 1JVEmod.pdb;
spacefill off");
This one works sometimes (the ECHO and the molecule appears, only the ECHO,
only the molecule):
jmolApplet(550, "load 1atom.pdb; spacefill off; set echo middle center; echo
\"Loading molecule|Please wait...||This can take a while\"");
jmolScript("load 1JVEmod.pdb; spacefill off");
Am I doing something wrong or is this a bug?
----------------------------------------------------------------------
>Comment By: ceroni (ceroni)
Date: 2007-03-07 11:52
Message:
Logged In: YES
user_id=1493510
Originator: YES
Had a relative success using:
jmolApplet(550, "script warn.txt; load 1JVEmod.pdb; spacefill off");
warn.txt:
zap;
set echo middle center;
font echo 20 sanserif bold;
color echo white;
echo Loading...;
delay 0.1;
Even so, it doesn't work every time the page is loaded. It's a very odd
behaviour. Sometimes the message just flashes, some other times it doesn't
appear at all. A few times the molecule doesn't load.
----------------------------------------------------------------------
Comment By: ceroni (ceroni)
Date: 2007-03-06 17:32
Message:
Logged In: YES
user_id=1493510
Originator: YES
Thanks for the replies. A few comments:
> recent versions of Jmol allow echo tu be used without any model
loaded...
> For the initial message, you don't need a dummy model...
The only way I could get it to work was by loading a dummy model first.
Zap doesn't work. Used 10.0.1 and 10.1.7
> what takes most time ususally is loading the applet, not loading the
model...
True if you are not loading 50S subunit over a slow link!
> When you use jmolScript, probably you raise two threads and either one
can go faster and step over the other...
That seems to be the case. It explains why I'm getting different results
every time I reload
> If the delay is truly caused by loading a large structure file, it IS
nice to provide some feedback
Great! How difficult would be to have built in to the applet a simple
message like "loading model...", automatically displayed after the applet
is loaded and before the model is shown?
----------------------------------------------------------------------
Comment By: Dean Johnston (deanjohnston)
Date: 2007-03-06 14:06
Message:
Logged In: YES
user_id=1145454
Originator: NO
Angel, your comments are right on - any information about load time has to
be given before loading or outside of Jmol. If the delay is truly caused
by loading a large structure file, it IS nice to provide some feedback. I
use the Javascript setInterval() function to periodically update a message
to the user. Then I use jmolSetCallback() to cancel the message once the
molecule is loaded. It works something like this:
setMoleculeUnloaded(); // set a flag showing no molecule is loaded
(molecule.loaded = false)
jmolSetCallback("loadStructCallback", "setMoleculeLoaded"); // once the
molecule loads, set the molecule.loaded flag to true
var intervalID = setInterval(showLoadProgress, 250, intervalID); //
periodically call showLoadProgress()
/* the showLoadProgress() function removes the message and calls
clearInterval() once the molecule is loaded */
(whatever code is used to load large molecule)
Dean
----------------------------------------------------------------------
Comment By: Angel Herraez (aherraez)
Date: 2007-03-06 03:52
Message:
Logged In: YES
user_id=1065324
Originator: NO
Hello Sérgio
First, recent versions of Jmol allow echo tu be used without any model
loaded.
Second, what takes most time ususally is loading the applet, not loading
the model, so it's probable that you don't see the message because as soon
as the dummy model is loaded, the second one is too.
When you use jmolScript, probably you raise two threads and either one can
go faster and step over the other.
In summary:
1) There is nothing you can do to warn that the initial loading will have
some delay (other than advising it in the web page, not inside Jmol)
2) If the model is large, or it comes from a slower server, you can put a
warning that will disappear when the model arrives (although I think some
times I have seen a black Jmol in between). You may want to take a look at
what eric Martz has done in FirstGlance in Jmol (model files are retrieved
from PDB and there is a previous warning).
3) For the initial message, you don't need a dummy model; you can simply
use
jmolApplet(550, "zap; set echo middle center;
echo \"Loading molecule|Please wait...||This can take a while\"; load
1JVEmod.pdb; spacefill off");
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1674533&group_id=23629
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers