Revision: 20350 http://sourceforge.net/p/jmol/code/20350 Author: hansonr Date: 2015-03-01 16:54:40 +0000 (Sun, 01 Mar 2015) Log Message: ----------- NBO tweaks
Modified Paths: -------------- trunk/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java Modified: trunk/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java =================================================================== --- trunk/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java 2015-03-01 15:58:44 UTC (rev 20349) +++ trunk/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java 2015-03-01 16:54:40 UTC (rev 20350) @@ -167,39 +167,45 @@ * @param s */ private void sendToNBO(int mode, String s) { - s = (mode == RAW ? s + "\n" : mode + "\n" + s + "\nexit" + (nboSync ? "\nexit" : "")); + s = (mode == RAW ? s : mode + "\n" + s + "\nexit" + (nboSync ? "\nexit" : "")); sendCmd(s); } - private void sendCmd(String s) { - System.out.println("sending: " + s + "\n"); + private void sendCmd(String s) { + vwr.log("sending:\n>>>\n" + s + "\n<<<"); stdinWriter.println(s); stdinWriter.flush(); } public void nboReport(String line) { - System.out.println("receiving: " + line); - if (nboDialog != null) - nboDialog.nboReport(line); + vwr.log("receiving: " + line); if (line.startsWith("DATA ")) { if (line.startsWith("DATA \"model")) { nboModel = PT.getQuotedStringAt(line, 0); line += " NBO " + nboModel; } inData = (line.indexOf("exit") < 0); + if (inData) + sbRet.append(line + "\n"); + return; } if (inData) { sbRet.append(line + "\n"); + if (line.indexOf("END") >= 0) { + inData = false; + String s = sbRet.toString(); + sbRet.setLength(0); + String m = "\"" + nboModel + "\""; + nboModel = "\0"; + if (!nboSync && line.indexOf(m) >= 0) { + vwr.log("running Jmol script:\n" + s); + vwr.script(s); + } + return; + } } - if (inData && line.indexOf("END") >= 0) { - inData = false; - String s = sbRet.toString(); - sbRet.setLength(0); - String m = "\"" + nboModel + "\""; - nboModel = "\0"; - if (!nboSync && line.indexOf(m) >= 0) - vwr.script(s); - } + if (nboDialog != null) + nboDialog.nboReport(line); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits