Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-19 Thread Robert Hanson
On Mon, Apr 17, 2017 at 3:01 PM, Angel Herráez  wrote:

> Hi Jeff
>
> Glad you are finding a solution. The lack of working of "!exit" straight
> away is
> disturbing.
>

exit

to work the way you want must be the first command in a script. Otherwise
it just acts on the currently running script (it's script) and clears the
queue of all remaining unprocessed scripts.

Bob
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-17 Thread Angel Herráez
Hi Jeff

Glad you are finding a solution. The lack of working of "!exit" straight away 
is  
disturbing.

"move" is considered an obsolete command and that may be the reason 
there is no method to interrupt it, but I agree that some things are not easy 
to 
reproduce with other commands, as you are seeing.


> > One question, when I get the coordinates for moveTo with "show moveto" in 
> > the console, I end up with a longer command than in your example, for 
> > example:

I am not sure. It is safer that you do not trim the command, but when the last 
parts tend to remain constant (they are related to rotation radius and other 
things that do not change with your use of move) they may be omitted, as I 
did.


> I have a move command: move 0 360 0 0 0 0 0 0 4, which does a full rotation 
> around the y-axis over 4 seconds. How do I covert that to a moveto command? 
> If I just move to the final coordinates, they are the same as the starting 
> position, so it does not animate.

Indeed! No equivalence there. You can either do two 180º moveTo 
commands, but that may behave different,
or, better, use a rotate command - probably this:

rotate y 360 -4.0

(note the minus sign, explained at 
https://chemapps.stolaf.edu/jmol/docs/#rotate )



---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-17 Thread Jeff Sims
One more followup question:

I have a move command: move 0 360 0 0 0 0 0 0 4, which does a full rotation 
around the y-axis over 4 seconds. How do I covert that to a moveto command? If 
I just move to the final coordinates, they are the same as the starting 
position, so it does not animate.

> On Apr 17, 2017, at 2:55 PM, Jeff Sims  wrote:
> 
> Thank you, Angel.
> 
> This is very helpful. I believe it solves my problem.
> 
> After some testing, I can simplify the code by setting this one time, when 
> the applet is created:
> 
> set waitForMoveTo true
> 
> then do the following before playing any scene:
> 
> Jmol.script(jmolview1, ‘moveTo stop;’);
> Jmol.script(jmolview1, ‘!exit;’);
> 
> It doesn’t work if I chain those together, only if they are separate calls.
> 
> Then, it proceeds with 'load mol/s_dipep.pdb; script animation1.spt;’ as 
> before.
> 
> One question, when I get the coordinates for moveTo with “show moveto” in the 
> console, I end up with a longer command than in your example, for example:
> 
> moveto 1.0 { 588 -641 -493 123.42} 170.0 0.0 -10.0 {-2.996 2.3883 
> 7.308} 5.727823233459979 {0 0 0} 0 0 0 3.0 0.0 0.0;
> //compared with moveTo 2.0 {588 -641 -493 123.42} 170 0 -10;
> 
> Can I just leave out everything after the -10.0, as in your example, as I’m 
> making this conversion for all my scripts?
> 
>> On Apr 15, 2017, at 7:38 AM, Angel Herráez  wrote:
>> 
>> Hi Jeff
>> 
>> I've done a little testing.
>> It seems that the problem is in the "move" commands, that cannot be 
>> interrupted. I found about "set waitForMoveTo" and "moveTo stop", so this 
>> seems to work:
>> 
>> 1.
>> Edit you spt files to change the move commands to equivalent moveTo 
>> commands.
>> 
>> // move 0 0 0 80 0 -10 0 0 2.0
>> moveTo 2.0 {588 -641 -493 123.42} 170 0 -10;
>> 
>> //move 0 0 0 -80 0 10 0 0 2.0
>> moveTo 2.0 {588 -641 -493 123.42} 90 0 0;
>> 
>> (parameters obtained using "show moveto" in the console after manually 
>> entering the original move)
>> 
>> 
>> 2.
>> Edit the button code to add the stopping commands, like this:
>> Jmol.script(jmolview1, '!exit; set waitForMoveTo false; moveTo stop; load 
>> s_dipep.pdb; script animation2.spt;');
>> 
>> 
>> 3. 
>> You probably need to reset to "set waitForMoveTo true" somewhere, at the 
>> beginning of the scripts I think, so your moves within a script are 
>> displayed 
>> sequentially as you want.
>> 
>> 
>> 
>> 
>> ---
>> El software de antivirus Avast ha analizado este correo electrónico en busca 
>> de virus.
>> https://www.avast.com/antivirus
>> 
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Jmol-developers mailing list
>> Jmol-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-developers
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-17 Thread Jeff Sims
Thank you, Angel.

This is very helpful. I believe it solves my problem.

After some testing, I can simplify the code by setting this one time, when the 
applet is created:

set waitForMoveTo true

then do the following before playing any scene:

Jmol.script(jmolview1, ‘moveTo stop;’);
Jmol.script(jmolview1, ‘!exit;’);

It doesn’t work if I chain those together, only if they are separate calls.

Then, it proceeds with 'load mol/s_dipep.pdb; script animation1.spt;’ as before.

One question, when I get the coordinates for moveTo with “show moveto” in the 
console, I end up with a longer command than in your example, for example:

moveto 1.0 { 588 -641 -493 123.42} 170.0 0.0 -10.0 {-2.996 2.3883 
7.308} 5.727823233459979 {0 0 0} 0 0 0 3.0 0.0 0.0;
//compared with moveTo 2.0 {588 -641 -493 123.42} 170 0 -10;

Can I just leave out everything after the -10.0, as in your example, as I’m 
making this conversion for all my scripts?

> On Apr 15, 2017, at 7:38 AM, Angel Herráez  wrote:
> 
> Hi Jeff
> 
> I've done a little testing.
> It seems that the problem is in the "move" commands, that cannot be 
> interrupted. I found about "set waitForMoveTo" and "moveTo stop", so this 
> seems to work:
> 
> 1.
> Edit you spt files to change the move commands to equivalent moveTo 
> commands.
> 
> // move 0 0 0 80 0 -10 0 0 2.0
> moveTo 2.0 {588 -641 -493 123.42} 170 0 -10;
> 
> //move 0 0 0 -80 0 10 0 0 2.0
> moveTo 2.0 {588 -641 -493 123.42} 90 0 0;
> 
> (parameters obtained using "show moveto" in the console after manually 
> entering the original move)
> 
> 
> 2.
> Edit the button code to add the stopping commands, like this:
> Jmol.script(jmolview1, '!exit; set waitForMoveTo false; moveTo stop; load 
> s_dipep.pdb; script animation2.spt;');
> 
> 
> 3. 
> You probably need to reset to "set waitForMoveTo true" somewhere, at the 
> beginning of the scripts I think, so your moves within a script are displayed 
> sequentially as you want.
> 
> 
> 
> 
> ---
> El software de antivirus Avast ha analizado este correo electrónico en busca 
> de virus.
> https://www.avast.com/antivirus
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-15 Thread Angel Herráez
Hi Jeff

I've done a little testing.
It seems that the problem is in the "move" commands, that cannot be 
interrupted. I found about "set waitForMoveTo" and "moveTo stop", so this 
seems to work:

1.
Edit you spt files to change the move commands to equivalent moveTo 
commands.

// move 0 0 0 80 0 -10 0 0 2.0
moveTo 2.0 {588 -641 -493 123.42} 170 0 -10;

//move 0 0 0 -80 0 10 0 0 2.0
moveTo 2.0 {588 -641 -493 123.42} 90 0 0;

(parameters obtained using "show moveto" in the console after manually 
entering the original move)


2.
Edit the button code to add the stopping commands, like this:
 Jmol.script(jmolview1, '!exit; set waitForMoveTo false; moveTo stop; load 
s_dipep.pdb; script animation2.spt;');
 

3. 
You probably need to reset to "set waitForMoveTo true" somewhere, at the 
beginning of the scripts I think, so your moves within a script are displayed 
sequentially as you want.




---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] scripts persisting after quit or exit

2017-04-11 Thread Angel Herráez
Hi Jeff

That's a little strange. "exit" should do what you wish, at least according to
the documentation (I have no direct experience)

I suggest that you try this:

add
 !exit
as the first line of your script files or the first command of your inline 
scripts
that are callled from buttons.

Following your example, I would do this:
[1] scene is loaded with:
Jmol.script(jmolview1, '!exit; load model.pdb; script initial-view.spt;´);

[2] clicking a play button begins the animation with:
Jmol.script(jmolview1, '!exit; load model.pdb; script animation.spt;´);

[3] combined into [4]:
Jmol.script(jmolview1, '!exit; load model.pdb; script initial-view2.spt;´);


Let's see if that helps





---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers