Revision: 5174
Author:   hansonr
Date:     2006-05-25 08:43:34 -0700 (Thu, 25 May 2006)
ViewCVS:  http://svn.sourceforge.net/jmol/?rev=5174&view=rev

Log Message:
-----------
bob200603 resolver for NWChem files -- was picking up "TITLE" and declaring it 
a PDB file;
now added "fileStartsWith" and check for " argument 1 = ", which is done first,
but is very specific to NWChem files.

Modified Paths:
--------------
    branches/bob200603/Jmol/src/org/jmol/adapter/smarter/Resolver.java
Modified: branches/bob200603/Jmol/src/org/jmol/adapter/smarter/Resolver.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/adapter/smarter/Resolver.java  
2006-05-25 15:42:02 UTC (rev 5173)
+++ branches/bob200603/Jmol/src/org/jmol/adapter/smarter/Resolver.java  
2006-05-25 15:43:34 UTC (rev 5174)
@@ -148,14 +148,24 @@
       return "FoldingXyz";
     if (checkCube(lines))
       return "Cube";
+    
     // run these loops forward ... easier for people to understand
-    for (int i = 0; i < startsWithRecords.length; ++i) {
-      String[] recordTags = startsWithRecords[i];
+    //file starts with added 4/26 to ensure no issue with NWChem files
+    for (int i = 0; i < fileStartsWithRecords.length; ++i) {
+      String[] recordTags = fileStartsWithRecords[i];
       for (int j = 0; j < recordTags.length; ++j) {
         String recordTag = recordTags[j];
+        if (lines[0].startsWith(recordTag))
+            return fileStartsWithFormats[i];
+      }
+    }
+    for (int i = 0; i < lineStartsWithRecords.length; ++i) {
+      String[] recordTags = lineStartsWithRecords[i];
+      for (int j = 0; j < recordTags.length; ++j) {
+        String recordTag = recordTags[j];
         for (int k = 0; k < lines.length; ++k) {
           if (lines[k].startsWith(recordTag))
-            return startsWithFormats[i];
+            return lineStartsWithFormats[i];
         }
       }
     }
@@ -247,6 +257,19 @@
   }
 
   ////////////////////////////////////////////////////////////////
+  // these test files that startWith one of these strings
+  ////////////////////////////////////////////////////////////////
+
+  final static String[] nwchemRecords =
+  {" argument  1 = "};
+
+  final static String[][] fileStartsWithRecords =
+  { nwchemRecords};
+
+  final static String[] fileStartsWithFormats =
+  { "NWChem"};
+
+  ////////////////////////////////////////////////////////////////
   // these test lines that startWith one of these strings
   ////////////////////////////////////////////////////////////////
 
@@ -281,23 +304,20 @@
   final static String[] mdlRecords = 
   {"$MDL "};
 
-  final static String[] nwchemRecords =
-  {" argument  1"};
-
   final static String[] spartanSmolRecords =
   {"INPUT="};
 
   final static String[] csfRecords =
   {"local_transform"};
   
-  final static String[][] startsWithRecords =
+  final static String[][] lineStartsWithRecords =
   { pdbRecords, shelxRecords, cifRecords, ghemicalMMRecords,
-    jaguarRecords, hinRecords , mdlRecords, nwchemRecords,
+    jaguarRecords, hinRecords , mdlRecords, 
     spartanSmolRecords, csfRecords};
 
-  final static String[] startsWithFormats =
+  final static String[] lineStartsWithFormats =
   { "Pdb", "Shelx", "Cif", "GhemicalMM",
-    "Jaguar", "Hin", "Mol", "NWChem", "SpartanSmol", "Csf"};
+    "Jaguar", "Hin", "Mol", "SpartanSmol", "Csf"};
 
   ////////////////////////////////////////////////////////////////
   // contains formats


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



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Jmol-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to