isis/src/system/apps/kerneldbgen/SpiceDbGen.cpp
PvlObject SpiceDbGen::Direct(QString quality, FileList fileList,
                             double startOffset, double endOffset) {
  PvlObject result;

  // Throw an error if no files are being added to this database for
  // this filter/regex
  if (fileList.empty()) {
    QString message = "Input filelist is empty!";
    throw IException(IException::User, message, _FILEINFO_);
  }

  for (int fileNum = 0 ; fileNum < fileList.size() ; fileNum++) {
    FileName currFile = fileList[fileNum];
    PvlGroup selection = AddSelection(currFile, startOffset, endOffset);
    selection += PvlKeyword("Type", quality);
    result.addGroup(selection);
  }

  // Check each group to make sure it is the same type as others
  PvlObject::PvlGroupIterator grp = result.beginGroup();

  while (grp != result.endGroup()) {
    // The kernel did not have any time coverage, so ignore it
    if (grp->name() == "No coverage" || grp->name() == "Null") {
      result.deleteGroup(grp->name());
    }
    else if (grp->name() == p_type) {
      grp->setName("Selection");
      grp++;
    }
    else {
      QString message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type + "]" ;
      throw IException(IException::Programmer, message, _FILEINFO_);
      break;
    }
  }

  if (p_type == "SPK") {
    result.setName("SpacecraftPosition");
  }
  else if (p_type == "CK") {
    result.setName("SpacecraftPointing");
  }

  return result;
}
/**
 * Creates a Pvl object that stores all of the kernels specified by a list
 *
 * @param quality   The quality of the kernels that are being filtered into
 *                  the database. For example, "Reconstructed".
 *
 * @param fileList  The list of files to create a database for. The files must
 *                  be ordered in ascending priority. That is, if two kernels
 *                  cover the same time period, the kernel later in the file
 *                  will be used.
 *
 * @return PvlObject
 *
 * @internal
 *   @history 2019-08-13 Jesse Mapel Created method that takes a file list.
 *
 * @throws Isis::iException::Message
*/
Creates a Pvl object that stores all of the kernels specified by a list
@param quality   The quality of the kernels that are being filtered into
the database. For example, "Reconstructed".

@param fileList  The list of files to create a database for. The files must
be ordered in ascending priority. That is, if two kernels
cover the same time period, the kernel later in the file
will be used.



@internal
@history 2019-08-13 Jesse Mapel Created method that takes a file list.

@throws Isis::iException::Message
Creates a Pvl object that stores all of the kernels specified by a list @param quality The quality of the kernels that are being filtered into the database . For example " Reconstructed " . @param fileList The list of files to create a database for . The files must be ordered in ascending priority . That is if two kernels cover the same time period the kernel later in the file will be used . @internal @history 2019 - 08 - 13 Jesse Mapel Created method that takes a file list . @throws Isis :: iException :: Message
PvlObject SpiceDbGen::Direct(QString quality, FileList fileList,
                             double startOffset, double endOffset) {
  PvlObject result;
  if (fileList.empty()) {
    QString message = "Input filelist is empty!";
    throw IException(IException::User, message, _FILEINFO_);
  }
  for (int fileNum = 0 ; fileNum < fileList.size() ; fileNum++) {
    FileName currFile = fileList[fileNum];
    PvlGroup selection = AddSelection(currFile, startOffset, endOffset);
    selection += PvlKeyword("Type", quality);
    result.addGroup(selection);
  }
  PvlObject::PvlGroupIterator grp = result.beginGroup();
  while (grp != result.endGroup()) {
    if (grp->name() == "No coverage" || grp->name() == "Null") {
      result.deleteGroup(grp->name());
    }
    else if (grp->name() == p_type) {
      grp->setName("Selection");
      grp++;
    }
    else {
      QString message = "A kernel of type [" + grp->name() + "] has been found in a directory for type [" + p_type + "]" ;
      throw IException(IException::Programmer, message, _FILEINFO_);
      break;
    }
  }
  if (p_type == "SPK") {
    result.setName("SpacecraftPosition");
  }
  else if (p_type == "CK") {
    result.setName("SpacecraftPointing");
  }
  return result;
}
PvlObject SpiceDbGen :: Direct ( QString quality , FileList fileList , double startOffset , double endOffset ) { PvlObject result ; if ( fileList . empty ( ) ) { QString message = " " ; throw IException ( IException :: User , message , _FILEINFO_ ) ; } for ( int fileNum = 0 ; fileNum < fileList . size ( ) ; fileNum ++ ) { FileName currFile = fileList [ fileNum ] ; PvlGroup selection = AddSelection ( currFile , startOffset , endOffset ) ; selection += PvlKeyword ( " " , quality ) ; result . addGroup ( selection ) ; } PvlObject :: PvlGroupIterator grp = result . beginGroup ( ) ; while ( grp != result . endGroup ( ) ) { if ( grp -> name ( ) == " " || grp -> name ( ) == " " ) { result . deleteGroup ( grp -> name ( ) ) ; } else if ( grp -> name ( ) == p_type ) { grp -> setName ( " " ) ; grp ++ ; } else { QString message = " " + grp -> name ( ) + " " + p_type + " " ; throw IException ( IException :: Programmer , message , _FILEINFO_ ) ; break ; } } if ( p_type == " " ) { result . setName ( " " ) ; } else if ( p_type == " " ) { result . setName ( " " ) ; } return result ; }
Creates a Pvl object that stores all of the kernels specified by a list
 @param quality   The quality of the kernels that are being filtered into
                  the database.
Creates a Pvl object that stores all of the kernels specified by a list @param quality The quality of the kernels that are being filtered into the database .
// Throw an error if no files are being added to this database for // this filter/regex // Check each group to make sure it is the same type as others // The kernel did not have any time coverage, so ignore it