Hello Everyone
I'm a grad student who is interested in adding some specialized functions
for muon spectroscopy to JMOL. I was wondering if there is any special
tricks to adding new console commands to jmol. I've gotten to the point
where It accepts the new function (no script error command expected) but
the function doesn't seem to want to run. (I've included some cope
fragments and output below). I went and added some debuging statements
(just system.out.println) into the main functions in the script evaluator
but once the molecule is loaded into jmol none of the functions print out
when a command is entered. Does anything else need to be added besides a
couple lines in tokens (in order to be recognized) and adding a case in the
instruction dispatch loop? At this point I have a feeling I might be
missing something. Thanks for your time
Cheers Andrew
Console output
$ asdfasdf
script ERROR: command expected
----
>> asdfasdf <<
$ examplecommand
$ write xyz
4
H -4.47785 -0.17300 0.00000
H -3.87856 0.17300 0.00000
H 0.00000 0.00000 0.34600
H 0.00000 0.00000 -0.34600
$
excerpt from scriptevaluator
..........
case Token.unbind:
unbind();
break;
case Token.vibration:
vibration();
break;
case Token.write:
write(null);
break;
case Token.exampleCommand:
System.out.println("case Token.exampleCommand:");
//
break;
case Token.zap:
zap(true);
break;
case Token.zoom:
zoom(false);
break;
...........
excerpt from Token
................
final static int quaternion = 17 | 0 << 9 | mathfunc | scriptCommand;
final static int sort = 18 | 0 << 9 | mathfunc | mathproperty;
final static int count = 19 | 0 << 9 | mathfunc | mathproperty;
public final static int within = 20 | 0 << 9 | mathfunc;
final static int write = 21 | 0 << 9 | mathfunc |
scriptCommand;
final static int exampleCommand = 22 | 0 << 9 | mathfunc |
scriptCommand;
// xxx(a)
final static int acos = 3 | 1 << 9 | mathfunc;
final static int sin = 4 | 1 << 9 | mathfunc;
final static int cos = 5 | 1 << 9 | mathfunc;
final static int sqrt = 6 | 1 << 9 | mathfunc;
......................
More from Token
....................
"vector", new Token(vector),
"vectors", null,
"vibration", new Token(vibration),
"while", new Token(whilecmd),
"wireframe", new Token(wireframe),
"write", new Token(write),
"exampleCommand", new Token(exampleCommand), //exampleCommand
"zap", new Token(zap),
"zoom", new Token(zoom),
"zoomTo", new Token(zoomTo),
.............................
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers