From: <ha...@us...> - 2011-12-06 04:46:05
|
Revision: 16559 http://jmol.svn.sourceforge.net/jmol/?rev=16559&view=rev Author: hansonr Date: 2011-12-06 04:45:59 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt Modified: trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt =================================================================== --- trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt 2011-12-06 04:13:23 UTC (rev 16558) +++ trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt 2011-12-06 04:45:59 UTC (rev 16559) @@ -16,9 +16,9 @@ */ remotedir = "" // leaving this empty disables remote operation -password= "" // set in MPJmolAppRemoteConfig.spt -remotestatus = // PHP file to call for topic/subtopic/delay reading -remoteupdate = // PHP file to call for updating banner and image +password = "" // set in MPJmolAppRemoteConfig.spt +remotestatus = "" // PHP file to call for topic/subtopic/delay reading +remoteupdate = "" // PHP file to call for updating banner and image try { @@ -43,9 +43,15 @@ // get remote status -- topic, subtopic, and delay - if (remotedir == "") { return } + print "remotedir: " + remotedir + if (remotedir == "") { return } + + print remoteStatus + + var scr = load(remoteStatus) + print scr try { - script @remoteStatus // sets topic, and subtopic, and mydelay + script inline @scr // sets topic, and subtopic, and mydelay } message remotedir = @{remotedir} @@ -58,8 +64,11 @@ // update remote information for banner and image - if (remotedir == "") { return } - var x=load(remoteupdate + s) + if (remotedir == "") { return } + print "remotest " + remoteupdate+s + try { + var x=load(remoteupdate + s) + } } function setDirectory() { @@ -72,9 +81,6 @@ NIOcontentScript=topic + "/" + topic + ".spt" cd "" cd @topic - print "setDirectory..." - cd - } function setMPStatus(doCheckTopic) { @@ -85,6 +91,11 @@ var oldtopic = topic getRemoteStatus() setDirectory() + +print topic + ".spt" + +print load(topic + ".spt") + if (load(topic + ".spt").find("java.") == 1) { topic = "" setDirectory() @@ -105,20 +116,23 @@ // just words, not phrases // for example: substitution or elimination - if (subtopic == "") { return false } + if (subtopic == "") { return true } if (subtopic.find(" and ") == 0 && subtopic.find(" or ") == 0 - && subtopic.find(" not ") == 0) { return (info.find(subtopic) > 0) } + && subtopic.find("not ") == 0) { return (info.find(subtopic) > 0) } var S = subtopic.replace("("," ( ").replace(")"," ) ").split(" ") for (var i = S.length; i > 0; --i) { var item = S[i] - if (item == "(" || item == ")" || item == "and" || item == "or" || item == "not") { continue } + if (item == "" || item == "(" || item == ")" || item == "and" || item == "or" || item == "not") { continue } S[i] = (info.find(item) > 0) } x = false try { script inline @{"x=" + S.join(" ")} - } + } + +print "x = " + x + " " + S.join(" ") + return x } @@ -136,31 +150,37 @@ that will be checked but removed before display */ + +print "load model " + jmolFile + " " + more + " " + banner setMPStatus(true) if (!jmolFile) { return } - if (!checkSubtopic(banner)) { return } + if (!checkSubtopic(banner)) { return } zap message banner: try { remoteSet("log&info=loading " + jmolFile) load @jmolFile if (more) { script inline @more } - banner = banner.split("##")[1] - message @{"banner:" + banner} - remoteSet("log&info=" + _modelFile) - remoteSet("setbanner&banner=" + banner) - remoteSet("setimage&?POST?_PNG_") + banner = banner.split("##")[1] + var msg = "banner:" + banner + message @msg + try { + remoteSet("log&info=" + _modelFile) + remoteSet("setbanner&banner=" + banner) + remoteSet("setimage&?POST?_PNG_") + } + catch (err) { print err } + + } + - print "delay = " + mydelay + delay @mydelay - delay @mydelay - } - // send terminator message to keep Hub happy + + print "terminatormessage=" + NIOterminatormessage - print "terminatormessage=" + NIOTerminatorMessage - message @NIOterminatorMessage } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ha...@us...> - 2011-12-21 20:12:32
|
Revision: 16623 http://jmol.svn.sourceforge.net/jmol/?rev=16623&view=rev Author: hansonr Date: 2011-12-21 20:12:26 +0000 (Wed, 21 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt Modified: trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt =================================================================== --- trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt 2011-12-21 19:25:39 UTC (rev 16622) +++ trunk/Jmol/src/org/molecularplayground/MPJmolAppConfig.spt 2011-12-21 20:12:26 UTC (rev 16623) @@ -1,7 +1,7 @@ /* Molecular Playground Configuration File -Bob Hanson, St. Olaf College 12/4/2011 +Bob Hanson, St. Olaf College 12/21/2011 See also MPJmolAppRemoteConfig.spt and MPJmolAppDefaultConfig.spt @@ -43,12 +43,12 @@ // get remote status -- topic, subtopic, and delay - print "remotedir: " + remotedir - if (remotedir == "") { return } - - print remoteStatus - - var scr = load(remoteStatus) + print "remotedir: " + remotedir + if (remotedir == "") { return } + + print remoteStatus + + var scr = load(remoteStatus) print scr try { script inline @scr // sets topic, and subtopic, and mydelay @@ -64,10 +64,10 @@ // update remote information for banner and image - if (remotedir == "") { return } - print "remotest " + remoteupdate+s + if (remotedir == "") { return } + print "remotest " + remoteupdate+s try { - var x=load(remoteupdate + s) + var x=load(remoteupdate + s) } } @@ -91,11 +91,11 @@ var oldtopic = topic getRemoteStatus() setDirectory() - -print topic + ".spt" - -print load(topic + ".spt") - + +print topic + ".spt" + +print load(topic + ".spt") + if (load(topic + ".spt").find("java.") == 1) { topic = "" setDirectory() @@ -129,10 +129,10 @@ x = false try { script inline @{"x=" + S.join(" ")} - } - -print "x = " + x + " " + S.join(" ") + } +print "x = " + x + " " + S.join(" ") + return x } @@ -150,37 +150,37 @@ that will be checked but removed before display */ - -print "load model " + jmolFile + " " + more + " " + banner +print "load model " + jmolFile + " " + more + " " + banner + setMPStatus(true) if (!jmolFile) { return } - if (!checkSubtopic(banner)) { return } + if (!checkSubtopic(banner)) { return } zap message banner: + var d = 0 try { remoteSet("log&info=loading " + jmolFile) load @jmolFile if (more) { script inline @more } - banner = banner.split("##")[1] + banner = banner.split("##")[1] var msg = "banner:" + banner - message @msg + message @msg try { remoteSet("log&info=" + _modelFile) remoteSet("setbanner&banner=" + banner) - remoteSet("setimage&?POST?_PNG_") - } - catch (err) { print err } - + remoteSet("setimage&?POST?_PNG_") + } + catch (err) { print err } + d = [300, (_animating ? [myDelay,_animTimeSec * 2].max : myDelay)].min } - - delay @mydelay + delay @d // send terminator message to keep Hub happy - - print "terminatormessage=" + NIOterminatormessage + print "terminatormessage=" + NIOterminatormessage + message @NIOterminatorMessage } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |