From: <ha...@us...> - 2010-06-17 15:57:33
|
Revision: 13409 http://jmol.svn.sourceforge.net/jmol/?rev=13409&view=rev Author: hansonr Date: 2010-06-17 15:57:26 +0000 (Thu, 17 Jun 2010) Log Message: ----------- version=12.0.RC20_dev # bug fix: log "NOW" changed to log "$NOW$" # bug fix: log "$CLEAR$" clears the log file # bug fix: syntax "else { [eol]" not functional Modified Paths: -------------- trunk/Jmol/src/org/jmol/api/MepCalculationInterface.java trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java trunk/Jmol/src/org/jmol/multitouch/ActionManagerMT.java trunk/Jmol/src/org/jmol/quantum/MepCalculation.java trunk/Jmol/src/org/jmol/quantum/MlpCalculation.java trunk/Jmol/src/org/jmol/script/ScriptCompiler.java trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java trunk/Jmol/src/org/jmol/viewer/ActionManager.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/api/MepCalculationInterface.java =================================================================== --- trunk/Jmol/src/org/jmol/api/MepCalculationInterface.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/api/MepCalculationInterface.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -12,6 +12,6 @@ public abstract void calculate(VolumeDataInterface volumeData, BitSet bsSelected, Point3f[] atomCoordAngstroms, float[] charges, int calcType); - public abstract void assignPotentials(Atom[] atoms, float[] potentials, BitSet bsAromatic, BitSet bsCarbonyl, String data); + public abstract void assignPotentials(Atom[] atoms, float[] potentials, BitSet bsAromatic, BitSet bsCarbonyl, BitSet bsIgnore, String data); } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -573,7 +573,7 @@ } public int addVertexCopy(Point3f vertexXYZ, float value, int assocVertex) { - if (Float.isNaN(value)) + if (Float.isNaN(value) && assocVertex != MarchingSquares.EDGE_POINT) return -1; if (meshDataServer == null) return meshData.addVertexCopy(vertexXYZ, value, assocVertex); Modified: trunk/Jmol/src/org/jmol/multitouch/ActionManagerMT.java =================================================================== --- trunk/Jmol/src/org/jmol/multitouch/ActionManagerMT.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/multitouch/ActionManagerMT.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -287,7 +287,7 @@ long time = System.currentTimeMillis(); // at most every 10 seconds if (time - lastLogTime > 10000) { - viewer.log("NOW multitouch " + type + " pt= " + pt); + viewer.log("$NOW$ multitouch " + type + " pt= " + pt); lastLogTime = time; } } Modified: trunk/Jmol/src/org/jmol/quantum/MepCalculation.java =================================================================== --- trunk/Jmol/src/org/jmol/quantum/MepCalculation.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/quantum/MepCalculation.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -94,12 +94,18 @@ } public void assignPotentials(Atom[] atoms, float[] potentials, - BitSet bsAromatic, BitSet bsCarbonyl, String data) { + BitSet bsAromatic, BitSet bsCarbonyl, + BitSet bsIgnore, String data) { getAtomicPotentials(data, null); for (int i = 0; i < atoms.length; i++) { - float f = getTabulatedPotential(atoms[i]); + float f; + if (bsIgnore != null && bsIgnore.get(i)) { + f = Float.NaN; + } else { + f = getTabulatedPotential(atoms[i]); if (Float.isNaN(f)) f = 0; + } if (Logger.debugging) Logger.info(atoms[i].getInfo() + " " + f); potentials[i] = f; Modified: trunk/Jmol/src/org/jmol/quantum/MlpCalculation.java =================================================================== --- trunk/Jmol/src/org/jmol/quantum/MlpCalculation.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/quantum/MlpCalculation.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -41,26 +41,33 @@ } public void assignPotentials(Atom[] atoms, float[] potentials, - BitSet bsAromatic, BitSet bsCarbonyl, String data) { + BitSet bsAromatic, BitSet bsCarbonyl, + BitSet bsIgnore, String data) { getAtomicPotentials(data, "atomicLipophilicity.txt"); for (int i = 0; i < atoms.length; i++) { float f = Math.abs(atoms[i].getFormalCharge()); if (f == 0) { - f = getTabulatedPotential(atoms[i]); - if (Float.isNaN(f)) - switch (atoms[i].getElementNumber()) { - case 6: - f = (bsAromatic.get(i) ? 0.31f : bsCarbonyl.get(i) ? -0.54f : 0.45f); - break; - case 7: - f = (bsAromatic.get(i) ? -0.6f : bsCarbonyl.get(i) ? -0.44f : -1.0f); - break; - case 8: - f = (bsCarbonyl.get(i) ? -0.9f : -0.17f); - break; - default: - f = 0; - } + if (bsIgnore != null && bsIgnore.get(i)) { + f = Float.NaN; + } else { + f = getTabulatedPotential(atoms[i]); + if (Float.isNaN(f)) + switch (atoms[i].getElementNumber()) { + case 6: + f = (bsAromatic.get(i) ? 0.31f : bsCarbonyl.get(i) ? -0.54f + : 0.45f); + break; + case 7: + f = (bsAromatic.get(i) ? -0.6f : bsCarbonyl.get(i) ? -0.44f + : -1.0f); + break; + case 8: + f = (bsCarbonyl.get(i) ? -0.9f : -0.17f); + break; + default: + f = Float.NaN; + } + } } if (Logger.debugging) Logger.info(atoms[i].getInfo() + " " + f); Modified: trunk/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -608,7 +608,7 @@ } else { parenCount = setBraceCount = 0; setCommand(lastFlowCommand); - if (lastFlowCommand.tok != Token.process) + if (lastFlowCommand.tok != Token.process && tokAt(0) == Token.leftbrace) ltoken.removeElementAt(0); } } Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -14132,6 +14132,7 @@ Boolean smoothing = null; BitSet bs; BitSet bsSelect = null; + BitSet bsIgnore = null; StringBuffer sbCommand = new StringBuffer(); Point3f[] pts; String str = null; @@ -14531,7 +14532,7 @@ if (!isSyntaxCheck) try { data = (fname == null && isMep ? viewer.getPartialCharges() - : viewer.getAtomicPotentials(isMep, bsSelect, fname)); + : viewer.getAtomicPotentials(isMep, bsSelect, bsIgnore, fname)); } catch (Exception e) { // ignore } @@ -14830,7 +14831,7 @@ break; case Token.ignore: propertyName = "ignore"; - propertyValue = expression(++i); + propertyValue = bsIgnore = expression(++i); sbCommand.append(" ignore ").append( Escape.escape((BitSet) propertyValue)); i = iToken; Modified: trunk/Jmol/src/org/jmol/viewer/ActionManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -907,7 +907,7 @@ viewer.spinXYBy(dragGesture.getDX(4, 2), dragGesture.getDY(4, 2), speed * 30 * gestureSwipeFactor); if (viewer.getLogGestures()) - viewer.log("NOW swipe " + dragGesture + " " + speed); + viewer.log("$NOW$ swipe " + dragGesture + " " + speed); return; } Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-06-17 15:57:26 UTC (rev 13409) @@ -3,6 +3,10 @@ version=12.0.RC20_dev +# bug fix: log "NOW" changed to log "$NOW$" +# bug fix: log "$CLEAR$" clears the log file +# bug fix: syntax "else { [eol]" not functional + # -------------------------------------------------------------- #version=12.0.RC19 @@ -1045,10 +1049,10 @@ # set logFile "test" # # new feature: LOG command -- same as print but to the log file -# can be prepended with nicely formatted date with "NOW" as the -# first three characters +# can be prepended with nicely formatted date with "$NOW$" as the +# first five characters # -# log "NOW\n" + getProperty("modelInfo") +# log "$NOW$\n" + getProperty("modelInfo") # # new feature: show state [name] # new feature: all saved orientations now saved in state Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-06-17 00:58:58 UTC (rev 13408) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-06-17 15:57:26 UTC (rev 13409) @@ -8044,12 +8044,12 @@ return modelSet.getPartialCharges(); } - public float[] getAtomicPotentials(boolean isMep, BitSet bsSelected, String fileName) { + public float[] getAtomicPotentials(boolean isMep, BitSet bsSelected, BitSet bsIgnore, String fileName) { float[] potentials = new float[getAtomCount()]; MepCalculationInterface m = (MepCalculationInterface) Interface.getOptionInterface("quantum.MlpCalculation"); String data = (fileName == null ? null : getFileAsString(fileName)); m.assignPotentials(modelSet.atoms, potentials, getSmartsMatch("a", bsSelected), - getSmartsMatch("/noAromatic/C(=O)*", bsSelected), data); + getSmartsMatch("/noAromatic/[$(C=O),$(O=C), $(NC=O)]", bsSelected), bsIgnore, data); return potentials; } @@ -8503,12 +8503,15 @@ try { if (logFile == null || data == null) return; - if (data.startsWith("NOW")) + boolean doClear = (data.equals("$CLEAR$")); + if (data.startsWith("$NOW$")) data = (new Date()).toString() + "\t" + data.substring(3); - FileWriter fstream = new FileWriter(logFile, true); + FileWriter fstream = new FileWriter(logFile, !doClear); BufferedWriter out = new BufferedWriter(fstream); - out.write(data); - out.write('\n'); + if (!doClear) { + out.write(data); + out.write('\n'); + } out.close(); } catch (Exception e) { Logger.debug("cannot log " + data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |