Пример #1
0
std::string Frame::GetSpiceName() const
{
	char frameName[FRAME_NAME_MAX_LENGTH];
	CSPICE_ASSERT( frmnam_c(spiceId, FRAME_NAME_MAX_LENGTH, frameName) );

	return std::string(frameName);
}
Пример #2
0
/**
 * @brief Convert NAIF code to frame or body name
 *
 * This routine will convert a NAIF integer code to either the frame (first) or
 * body (second) name.
 *
 * @author kbecker (3/26/2011)
 *
 * @param naifid NAIF integer code to convert to a name
 *
 * @return QString Returns the frame or body name.
 */
QString SpiceSegment::getNaifName(int naifid) const {
  SpiceChar naifBuf[40];
  frmnam_c ( (SpiceInt) naifid, sizeof(naifBuf), naifBuf);
  string cframe(naifBuf);

  if ( cframe.empty() ) {
    SpiceBoolean found;
    bodc2n_c((SpiceInt) naifid, sizeof(naifBuf), naifBuf, &found);
    if ( found ) cframe = naifBuf;
  }

  // If it fails, just report it missing
  if ( cframe.empty() ) {
    string mess = "Failed to convert FrameId (" + IString(naifid) +
                  ") to string - perhaps the frame kernel is missing or not" +
                  " loaded.";
    cframe = "_UNKNOWN_";
  //  throw iException::Message(iException::User, mess.c_str(), _FILEINFO_);
  }


  return (cframe.c_str());
}