Revision: 18508
          http://sourceforge.net/p/jmol/code/18508
Author:   hansonr
Date:     2013-07-29 00:32:13 +0000 (Mon, 29 Jul 2013)
Log Message:
-----------


Modified Paths:
--------------
    branches/v13_2/Jmol/src/org/jmol/modelset/Measurement.java
    branches/v13_2/Jmol/src/org/jmol/quantum/NMRCalculation.java
    branches/v13_2/Jmol/src/org/jmol/symmetry/SymmetryOperation.java

Modified: branches/v13_2/Jmol/src/org/jmol/modelset/Measurement.java
===================================================================
--- branches/v13_2/Jmol/src/org/jmol/modelset/Measurement.java  2013-07-29 
00:31:59 UTC (rev 18507)
+++ branches/v13_2/Jmol/src/org/jmol/modelset/Measurement.java  2013-07-29 
00:32:13 UTC (rev 18508)
@@ -538,7 +538,9 @@
     Atom a1 = (Atom) getAtom(1);
     Atom a2 = (Atom) getAtom(2);
     float d = a2.distanceSquared(a1);
-    String key = (a1.index < a2.index ? a1.getAtomName() + a2.getAtomName() : 
a2.getAtomName() + a1.getAtomName());
+    String n1 = a1.getAtomName();
+    String n2 = a2.getAtomName();
+    String key = (n1.compareTo(n2) < 0 ? n1 + n2 : n2 + n1);
     Float min = htMin.get(key);
     return (min != null && d == min.floatValue());
   }

Modified: branches/v13_2/Jmol/src/org/jmol/quantum/NMRCalculation.java
===================================================================
--- branches/v13_2/Jmol/src/org/jmol/quantum/NMRCalculation.java        
2013-07-29 00:31:59 UTC (rev 18507)
+++ branches/v13_2/Jmol/src/org/jmol/quantum/NMRCalculation.java        
2013-07-29 00:32:13 UTC (rev 18508)
@@ -108,7 +108,8 @@
       int n = tensors.size();
       for (int j = 0; j < n; j++) {
         Tensor t = tensors.get(j);
-        if (t.type.equals(type) && t.isSelected(bs, iAtom)
+        if (t.type.equals(type) 
+            && t.isSelected(bs, iAtom)
             && (bs2 == null || bs2.get(getOtherAtom(t, iAtom))))
           
           list.addLast(t);
@@ -172,12 +173,13 @@
   public float getJCouplingHz(Atom a1, Atom a2, String type, Tensor isc) {
     if (isc == null) {
       type = getISCtype(a1, type);
-      if (type == null)
+      if (type == null || a1.modelIndex != a2.modelIndex)
         return 0;
       BS bs = new BS();
       BS bs2 = new BS();
-      bs.set(a1.index);
-      bs2.set(a2.index);
+      int i0 =  viewer.modelSet.models[a1.modelIndex].firstAtomIndex - 1;
+      bs.set(a1.atomSite + i0);
+      bs2.set(a2.atomSite + i0);
       JmolList<Tensor> list = getInteractionTensorList(type, bs, bs2);
       if (list.size() == 0)
         return Float.NaN;
@@ -427,7 +429,8 @@
         float d = a2.distanceSquared(a1);
         if (d == 0)
           continue;
-        String key = (i < j ? name + a2.getAtomName() : a2.getAtomName() + 
name);
+        String name1 = a2.getAtomName();
+        String key = (name.compareTo(name1) < 0 ? name + name1 : name1 + name);
         Float min = htMin.get(key);
         if (min == null) {
           min = Float.valueOf(d);

Modified: branches/v13_2/Jmol/src/org/jmol/symmetry/SymmetryOperation.java
===================================================================
--- branches/v13_2/Jmol/src/org/jmol/symmetry/SymmetryOperation.java    
2013-07-29 00:31:59 UTC (rev 18507)
+++ branches/v13_2/Jmol/src/org/jmol/symmetry/SymmetryOperation.java    
2013-07-29 00:32:13 UTC (rev 18508)
@@ -386,7 +386,7 @@
   }
 
   private static String plusMinus(String strT, float x, String sx) {
-    return (x == 0 ? "" : x < 0 ? "-" : strT.length() == 0 ? "" : "+") + sx;
+    return (x == 0 ? "" : (x < 0 ? "-" : strT.length() == 0 ? "" : "+") + sx);
   }
 
   private static float normalizeTwelfths(float iValue, boolean doNormalize) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to