Commit faec2846 authored by Kelvin Rodriguez's avatar Kelvin Rodriguez
Browse files

Removed unused function from the KernelDb class. Fixes #1006

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6921 41f8697f-d340-4b68-9986-7bafba869bb8
parent 45c6c6fc
Loading
Loading
Loading
Loading
+290 −356
Original line number Diff line number Diff line
@@ -919,70 +919,4 @@ namespace Isis {

    return files;
  }

  /**
   * Determines which Kernel::Type is "better". Returns true if the newType is 
   * allowed and is better than the oldType.  That is, the method will 
   * return true if all of the following criteria are met: 
   * <ul> 
   *   <li>the new type is allowed</li>
   *   <li>the new type is greater than or equal to the old type</li>
   * </ul>
   *  
   * Recall the allowed kernel types is stored as a sum of the enumerations 
   * of the allowed Kernel Types: 
   * <ul> 
   *   <li> 0 = Unknown</li>
   *   <li> 1 = Predicted</li>
   *   <li> 2 = Nadir</li>
   *   <li> 4 = Reconstructed</li>
   *   <li> 8 = Smithed</li>
   * </ul> 
   *  
   *  
   * @param newType First Kernel::Type QString value to be compared
   * @param oldType Second Kernel::Type QString value to be compared
   *  
   * @return @b bool Indicates whether the new type is "better" than the old 
   *                 type
   *  
   *  @see better(Kernel::Type, Kernel::Type)
   */
  bool KernelDb::better(QString newType, QString oldType) {
    return better(Kernel::typeEnum(newType),
                  Kernel::typeEnum(oldType));
  }
  
  /**
   * Determines which Kernel::Type is "better". Returns true if the newType is 
   * allowed and is better than the oldType.  That is, the method will 
   * return true if all of the following criteria are met: 
   * <ul> 
   *   <li>the new type is allowed</li>
   *   <li>the new type is greater than or equal to the old type</li>
   * </ul>
   *  
   * Recall the allowed kernel types is stored as a sum of the enumerations 
   * of the allowed Kernel Types: 
   * <ul> 
   *   <li> 0 = Unknown</li>
   *   <li> 1 = Predicted</li>
   *   <li> 2 = Nadir</li>
   *   <li> 4 = Reconstructed</li>
   *   <li> 8 = Smithed</li>
   * </ul> 
   *  
   * @param newType First Kernel::Type enumeration value to be compared
   * @param oldType Second Kernel::Type enumeration value to be compared
   *  
   * @return @b bool Indicates whether the new type is "better" than the old 
   *                 type
   */
  bool KernelDb::better(Kernel::Type newType, Kernel::Type oldType) {
    // if new type is allowed and at least as big as the old type, return true
    if ((newType & m_allowedKernelTypes) 
        && (newType >= oldType)) return true;
    return false;
  }

} //end namespace isis
+39 −42
Original line number Diff line number Diff line
@@ -142,9 +142,6 @@ namespace Isis {

      static bool matches(const Pvl &lab, PvlGroup &kernelDbGrp,
                          iTime timeToMatch, int cameraVersion);
      bool better(QString newType, QString oldType);
      bool better(Kernel::Type newType, Kernel::Type oldType);
  
    private:
      void loadKernelDbFiles(PvlGroup &dataDir,
                             QString directory,
+0 −24
Original line number Diff line number Diff line
@@ -389,30 +389,6 @@ $mro/kernels/ck/mro_crm_psp_080101_080131.bc

SpacecraftPosition Kernels: 
$mro/kernels/spk/mro_psp6.bsp



Testing better(row, column) method ...

	When all kernel types are allowed, is row better than col?
			Unknown	Predicted	Nadir	Recon	Smithed
Unknown			0		0		0		0		0
Predicted		1		1		0		0		0
Nadir			1		1		1		0		0
Reconstructed	1		1		1		1		0
Smithed			1		1		1		1		1



Testing better(row, column) method ...

	When Nadir is not allowed, is row better than col?
			Unknown	Predicted	Nadir	Recon	Smithed
Unknown			0		0		0		0		0
Predicted		1		1		0		0		0
Nadir			0		0		0		0		0
Reconstructed	1		1		1		1		0
Smithed			1		1		1		1		1
/---------------------------------------/


+21 −70
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
using namespace std;
using namespace Isis;

void testBetter(KernelDb kdb, QString conditions);
void testLoadSystemDb(KernelDb &kdb, const QString &mission, const Pvl &lab);
void testKernelAccessors(KernelDb &kdb, Pvl &lab, bool timeBasedKernelsOnly);

@@ -106,9 +105,6 @@ int main(int argc, char *argv[]) {
  testLoadSystemDb(mroMatchCrism, "Mro", lab);
  testKernelAccessors(mroMatchCrism, lab, true);
  
  testBetter(kdb, "When all kernel types are allowed");
  testBetter(mroMatchCrism, "When Nadir is not allowed");

  // Not yet tested:

  // constructor stream db file, not label
@@ -190,51 +186,6 @@ int main(int argc, char *argv[]) {
  return 0;
}

/**
 * Method that prints a table of results that compare all Kernel::Types 
 * with for the given KernelDb using the better() method. This table will 
 * depend on the kernel types allowed. This should be described in the 
 * conditions parameter. 
 * 
 * @param kdb KernelDb object
 * @param conditions QString describing which Kernel::Types are allowed
 */
void testBetter(KernelDb kdb, QString conditions) {
  cout << endl; 
  cout << endl; 
  cout << endl; 
  cout << "Testing better(row, column) method ..." << endl; 
  cout << endl; 
  cout << "\t" << conditions << ", is row better than col?" << endl; 
  cout << "\t\t\tUnknown\tPredicted\tNadir\tRecon\tSmithed" << endl; 
  cout << "Unknown\t\t\t" << kdb.better("Unknown","Unknown") << "\t\t"
                          << kdb.better("Unknown","Predicted") << "\t\t"
                          << kdb.better("Unknown","Nadir") << "\t\t"
                          << kdb.better("Unknown","Reconstructed") << "\t\t" 
                          << kdb.better("Unknown","Smithed") << endl; 
  cout << "Predicted\t\t" << kdb.better("Predicted","Unknown") << "\t\t"
                          << kdb.better("Predicted","Predicted") << "\t\t" 
                          << kdb.better("Predicted","Nadir") << "\t\t" 
                          << kdb.better("Predicted","Reconstructed") << "\t\t" 
                          << kdb.better("Predicted","Smithed") << endl; 
  cout << "Nadir\t\t\t" << kdb.better("Nadir","Unknown") << "\t\t" 
                        << kdb.better("Nadir","Predicted") << "\t\t" 
                        << kdb.better("Nadir","Nadir") << "\t\t" 
                        << kdb.better("Nadir","Reconstructed") << "\t\t" 
                        << kdb.better("Nadir","Smithed") << endl; 
  cout << "Reconstructed\t" << kdb.better("Reconstructed","Unknown") << "\t\t" 
                            << kdb.better("Reconstructed","Predicted") << "\t\t" 
                            << kdb.better("Reconstructed","Nadir") << "\t\t" 
                            << kdb.better("Reconstructed","Reconstructed") << "\t\t" 
                            << kdb.better("Reconstructed","Smithed") << endl; 
  cout << "Smithed\t\t\t"   << kdb.better("Smithed","Unknown") << "\t\t" 
                            << kdb.better("Smithed","Predicted") << "\t\t" 
                            << kdb.better("Smithed","Nadir") << "\t\t" 
                            << kdb.better("Smithed","Reconstructed") << "\t\t" 
                            << kdb.better("Smithed","Smithed") << endl; 

}

/**
 * Method that prints the kernel database files that are read in by the
 * loadSystemDb() method.  These file names have the version numbers