Commit 6b69f1d1 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Added bundle solution, image list, and shape list naming capabilities. Fixes #4855, #4979, #4980.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7857 41f8697f-d340-4b68-9986-7bafba869bb8
parent 0f0beaaf
Loading
Loading
Loading
Loading
+37 −5
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ namespace Isis {

    m_runTime = "";
    
    m_name = m_runTime; 

    m_controlNetworkFileName = new FileName(controlNetworkFileName);

    m_settings = inputSettings;
@@ -64,6 +66,7 @@ namespace Isis {
                                         //TODO does xml stuff need project???
    m_id = new QUuid(QUuid::createUuid());
    m_runTime = "";
    m_name = m_runTime;
    m_controlNetworkFileName = NULL;
    m_statisticsResults = NULL;
    // what about the rest of the member data ? should we set defaults ??? CREATE INITIALIZE METHOD
@@ -81,6 +84,7 @@ namespace Isis {
   */
  BundleSolutionInfo::BundleSolutionInfo(const BundleSolutionInfo &src)
      : m_id(new QUuid(QUuid::createUuid())),
        m_name(src.m_name),
        m_runTime(src.m_runTime),
        m_controlNetworkFileName(new FileName(src.m_controlNetworkFileName->expanded())),
        m_settings(new BundleSettings(*src.m_settings)),
@@ -127,6 +131,8 @@ namespace Isis {

      m_runTime = src.m_runTime;
      
      m_name = m_runTime;

      delete m_controlNetworkFileName;
      m_controlNetworkFileName = new FileName(src.m_controlNetworkFileName->expanded());

@@ -263,6 +269,7 @@ namespace Isis {
    }
  }

  
  /**
   * Returns the images used in the bundle
   *
@@ -273,6 +280,27 @@ namespace Isis {
  }
  
  
  /**
   * Sets the name of the bundle.
   * 
   * @param name QString of the new name
   */
  void BundleSolutionInfo::setName(QString name) {
    m_name = name;
  }
  
  
  /** 
   * Returns the name of the bundle. The name defaults to the id, unless the name has been set using 
   * setName()
   * 
   * @return QString Name of the bundle
   */
  QString BundleSolutionInfo::name() const {
    return m_name;
  }


  /**
   * @brief Outputs the header for the bundleout_images.csv file
   * @param fpOut The output file stream.
@@ -1433,6 +1461,7 @@ namespace Isis {
    // save ID, cnet file name, and run time to stream
    stream.writeStartElement("generalAttributes");
    stream.writeTextElement("id", m_id->toString());
    stream.writeTextElement("name", m_name);
    stream.writeTextElement("runTime", runTime());
    stream.writeTextElement("fileName", m_controlNetworkFileName->expanded());
    stream.writeTextElement("imagesCSV", m_csvSavedImagesFilename);
@@ -1548,6 +1577,9 @@ namespace Isis {
      delete m_xmlHandlerBundleSolutionInfo->m_id;
      m_xmlHandlerBundleSolutionInfo->m_id = new QUuid(m_xmlHandlerCharacters);
    }
    else if (localName == "name") {
      m_xmlHandlerBundleSolutionInfo->m_name = m_xmlHandlerCharacters;
    }
    else if (localName == "runTime") {
      m_xmlHandlerBundleSolutionInfo->m_runTime = m_xmlHandlerCharacters;
    }
+4 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ namespace Isis {
   *   @history 2017-05-04 Ian Humphrey & Makayla Shepherd - Modified save() to write the bundle
   *                           solution info images to the correct directory in the project on disk.
   *                           Fixes #4804, #4837.
   *   @history 2017-07-11 Makayla Shepherd - Added bundle naming capabilities. Fixes #4855.
   */
  class BundleSolutionInfo : public QObject {
    Q_OBJECT
@@ -126,6 +127,7 @@ namespace Isis {

      void setOutputStatistics(BundleResults statisticsResults);
      void setRunTime(QString runTime);
      void setName(QString name);

      QString id() const;
      QString controlNetworkFileName() const;
@@ -133,6 +135,7 @@ namespace Isis {
      BundleResults bundleResults();
      QList<ImageList *> imageList();
      QString runTime() const;
      QString name() const;


      bool outputImagesCSVHeader(std::ofstream &fpOut);
@@ -184,6 +187,7 @@ namespace Isis {
      //! A unique ID for this BundleSolutionInfo object (useful for others to reference this
      //! object when saving to disk).
      QUuid              *m_id;
      QString             m_name; //!< The name of the bundle. Defaults to the id
      QString             m_runTime; //!< The run time of the bundle adjust
      FileName           *m_controlNetworkFileName; //!< The name of the control network
      BundleSettingsQsp   m_settings; //!< The settings from the bundle adjust
+2 −3
Original line number Diff line number Diff line
@@ -1835,7 +1835,7 @@ namespace Isis {
              image, SLOT(updateFileName(Project *)));

      (*m_idToImageMap)[image->id()] = image;
      createOrRetrieveImageList(FileName(images[0]->fileName()).dir().dirName())->append(image);
      createOrRetrieveImageList(images.name())->append(image);
    }

    // We really can't have all of the cubes in memory before
@@ -2087,8 +2087,7 @@ namespace Isis {
              shape, SLOT(updateFileName(Project *)));

      (*m_idToShapeMap)[shape->id()] = shape;
      createOrRetrieveShapeList(
         FileName(shapes[0]->fileName()).dir().dirName())->append(shape);
      createOrRetrieveShapeList(shapes.name())->append(shape);
    }

    // We really can't have all of the cubes in memory before
+3 −0
Original line number Diff line number Diff line
@@ -143,6 +143,9 @@ namespace Isis {
   *   @history 2017-05-17 Tracie Sucharski - Changed activeControl and activeImageList methods to
   *                           return default values if project contains a single control and a
   *                           single image list.  Fixes #4867.
   *   @history 2017-07-13 Makayla Shepherd - Added the ability to change the name of image 
   *                           imports, shape imports, and bundle solution info. Fixes #4855, 
   *                           #4979, #4980.
   *                
   */
  class Project : public QObject {
+8 −3
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ namespace Isis {
   * @param[in] image (Image *) The Image to construct from.
   */
  ProjectItem::ProjectItem(Image *image) {
    setEditable(false);
    setEditable(true);
    setImage(image);
  }

@@ -209,7 +209,7 @@ namespace Isis {
   * @param[in] imageList (ImageList *) The ImageList to construct from.
   */
  ProjectItem::ProjectItem(ImageList *imageList) {
    setEditable(false);
    setEditable(true);
    setImageList(imageList);
    foreach (Image *image, *imageList) {
      appendRow( new ProjectItem(image) );
@@ -711,7 +711,12 @@ namespace Isis {
   * @param[in] bundleSolutionInfo (BundleSolutionInfo *) The BundleSolutionInfo.
   */
  void ProjectItem::setBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo) {
    if (bundleSolutionInfo->name() != "") {
      setText( bundleSolutionInfo->name() );
    }
    else {
      setText( bundleSolutionInfo->runTime() );
    }
    setIcon( QIcon(":results") );
    setData( QVariant::fromValue<BundleSolutionInfo *>(bundleSolutionInfo) );
  }
Loading