Commit f4734d3b authored by John Bonn's avatar John Bonn
Browse files

Added csv files to project tree m4835

parent 853526b2
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
#include <QDataStream>
#include <QDebug>
#include <QList>
#include <QString>
#include <QStringList>
#include <QUuid>
#include <QXmlStreamWriter>
@@ -142,6 +143,17 @@ namespace Isis {
    return *this;
  }

  QString BundleSolutionInfo::getSavedImagesFilename() {
    return m_csvSavedImagesFilename;
  }

  QString BundleSolutionInfo::getSavedPointsFilename() {
    return m_csvSavedPointsFilename;
  }

  QString BundleSolutionInfo::getSavedResidualsFilename() {
    return m_csvSavedResidualsFilename;
  }

  /**
   * Sets the stat results.
+4 −0
Original line number Diff line number Diff line
@@ -120,6 +120,10 @@ namespace Isis {
      ~BundleSolutionInfo();
      BundleSolutionInfo &operator=(const BundleSolutionInfo &src);

      QString getSavedImagesFilename();
      QString getSavedPointsFilename();
      QString getSavedResidualsFilename();

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

+49 −0
Original line number Diff line number Diff line
#ifndef FileItem_h
#define FileItem_h
/**
 * @file
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are
 *   public domain. See individual third-party library and package descriptions
 *   for intellectual property information, user agreements, and related
 *   information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or
 *   implied, is made by the USGS as to the accuracy and functioning of such
 *   software and related material nor shall the fact of distribution
 *   constitute any such warranty, and no responsibility is assumed by the
 *   USGS in connection therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
 *   in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include <QSharedPointer>
#include <QObject>

namespace Isis {

  /**
   * @brief A container for a filename to be represented as a ProjectItem
   * on the project tree.
   *
   * @author 2017-05-04 J Bonn
   *
   * @internal
   */
  class FileItem : public QObject {
    public:
      FileItem(const QString filename) : m_filename(filename) {};
      QString getFileName() { return m_filename; };
    private:
      QString m_filename;
  };

  typedef QSharedPointer<FileItem> FileItemQsp; //!< A FileItem smart pointer

}

#endif // FileItem_h
+26 −1
Original line number Diff line number Diff line
@@ -66,6 +66,21 @@ namespace Isis {
  }


  /**
   * Constructs an item representing a file in the filesystem.
   *
   * @param[in] filename The full path to the file in the filesystem
   * @param[in] treetext The name displayed in the project tree
   * @param[in] filename A icon to display next to the treetext
   */
  ProjectItem::ProjectItem(FileItemQsp filename, QString treeText, QIcon icon) {
    setEditable(false);
    setData(QVariant::fromValue<FileItemQsp>(filename));
    setText(treeText);
    setIcon(icon);
  }


  /**
   * Constructs an item from a BundleResults.
   *
@@ -75,7 +90,6 @@ namespace Isis {
  ProjectItem::ProjectItem(BundleResults bundleResults) {
    setEditable(false);
    setBundleResults(bundleResults);
//  appendRow( new ProjectItem( bundleResults.correlationMatrix() ) );
  }


@@ -617,6 +631,17 @@ namespace Isis {
  }


  /**
   * Returns true if a FileItemQsp is stored in the data of the item.
   * Returns false otherwise.
   *
   * @return @b bool If a FileItemQsp is stored in the item or not.
   */
  bool ProjectItem::isFileItem() const {
    return data().canConvert<FileItemQsp>();
  }


  /**
   * Sets the text, icon, and data to those of another item.
   *
+7 −2
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@
#define ProjectItem_h
/**
 * @file
 * $Date$
 * $Revision$
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are
 *   public domain. See individual third-party library and package descriptions
@@ -29,6 +27,7 @@
#include "BundleSettings.h"
#include "GuiCamera.h"
#include "TargetBody.h"
#include "FileItem.h"

class QVariant;

@@ -48,6 +47,7 @@ namespace Isis {
  class Shape;
  class ShapeList;
  class TargetBodyList;
  class FileItemData;

  /**
   * Represents an item of a ProjectItemModel in Qt's model-view
@@ -117,6 +117,8 @@ namespace Isis {
   *     @history 2017-05-02 Tracie Sucharski - Get rid of Correlation Matrix in BundleResults,
   *                               change order of objects under BundleSolutionInfo.  Change text on
   *                               some of BundleSolutionInfo items.  Fixes #4822.
   *     @history 2017-05-04 J Bonn -Added FileItem to project tree. m4838
   *
   */
  class ProjectItem : public QStandardItem {
    public:
@@ -141,6 +143,8 @@ namespace Isis {
      ProjectItem(QList<BundleSolutionInfo *> results);
      ProjectItem(TargetBodyQsp targetBody);
      ProjectItem(TargetBodyList *targetBodyList);
      ProjectItem(FileItemQsp filename, QString treeText, QIcon icon);


      ~ProjectItem();

@@ -171,6 +175,7 @@ namespace Isis {
      bool isProject() const;
      bool isGuiCamera() const;
      bool isTargetBody() const;
      bool isFileItem() const;

      void setProjectItem(ProjectItem *item);
      void setBundleResults(BundleResults bundleResults);
Loading