Commit cc43e328 authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Product Id will take on the ObservationId value if not specified by the user.

parent 605f47b6
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -43,16 +43,20 @@ void IsisMain() {
    throw  IException(IException::User, msg, _FILEINFO_);
  }

  if ( ui.WasEntered("PRODUCTID") ) {
  // Add the ProductId keyword for translation. If a product id is not specified
  // by the user, set it to the Observation Id.
  // This is added before the translation instead of adding it to the exported xml
  // because of the ease of editing pvl vs xml.
  PvlGroup &archiveGroup = label->findObject("IsisCube").findGroup("Archive");
    try {
      PvlKeyword &prodId = archiveGroup.findKeyword("ProductId");
      prodId.setValue( ui.GetString("PRODUCTID") );
    }
    catch (IException &e) {
      archiveGroup.addKeyword( PvlKeyword("ProductId", ui.GetString("PRODUCTID")) );
  PvlKeyword productId = PvlKeyword("ProductId");
  if ( ui.WasEntered("PRODUCTID") ) {
    productId.setValue( ui.GetString("PRODUCTID") );
  }
  else {
    QString observationId = archiveGroup.findKeyword("ObservationId").QString();
    productId.setValue(observationId);
  }
  archiveGroup.addKeyword(productId);

  /*
  * Add additional pds label data here