Commit 0dca9a43 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

When saving bundle result images, the Cube DN values are not copied now. Fixes #4848.

parent 6bd6f024
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ namespace Isis {
   * @brief Copy the cub/ecub files associated with this image into the new project.
   * @param newProjectRoot  The root directory where the project is stored.
   */
  void Image::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) {
  void Image::copyToNewProjectRoot(const Project *project, FileName newProjectRoot, bool copyCubes) {
    if (FileName(newProjectRoot) != FileName(project->projectRoot())) {
      Cube origImage(m_fileName);

@@ -496,7 +496,7 @@ namespace Isis {

      // If this is an ecub (it should be) and is pointing to a relative file name,
      //   then we want to copy the DN cube also.
      if (!origImage.storesDnData() ) {
      if (!origImage.storesDnData() && copyCubes) {
        if (origImage.externalCubeFileName().path() == ".") {
          Cube dnFile(
              FileName(m_fileName).path() + "/" + origImage.externalCubeFileName().name());
+7 −2
Original line number Diff line number Diff line
@@ -85,7 +85,12 @@ namespace Isis {
   *                           (the Spacecraft name associated with this image).
   *   @history 2016-06-22 Tyler Wilson - Added documentation to member functions/variables.
   *                           Fixes #3950.
   *
   *   @history 2017-05-07 Tyler Wilson - Added a third bool parameter value (copyCubes)
   *                       to the function copyToNewProjectRoot which is true by default.
   *                       The default behavior is to copy cubes as well as ecub values from
   *                       ImageLists into the results folder.  If this parameter is false,
   *                       then only ecub values are saved (which is the desired behavior
   *                       for running cnetsuite).  Fixes #4848.
   */

  class Image : public QObject {
@@ -123,7 +128,7 @@ namespace Isis {
      Angle phaseAngle() const;
      double sampleResolution() const;

      void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
      void copyToNewProjectRoot(const Project *project, FileName newProjectRoot,bool copyCubes=true);
      void deleteFromDisk();
      void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;

+1 −1
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ namespace Isis {
   * @see save
   */
  void *ImageList::CopyImageDataFunctor::operator()(Image * const &imageToCopy) {
    imageToCopy->copyToNewProjectRoot(m_project, m_newProjectRoot);
    imageToCopy->copyToNewProjectRoot(m_project, m_newProjectRoot, m_project->copyCubes());
    return NULL;
  }

+7 −0
Original line number Diff line number Diff line
@@ -40,6 +40,13 @@ namespace Isis {
   *                         pointer. TODO:  Currently, serialNumberList created the list on the
   *                         fly.  For speed, this needs to change so that when the ImageList
   *                         changes, update the serial number list.
   * @history 2016-05-07 Tyler Wilson - Changed the CopyImageDataFunctor so that when
   *                         it calls Image::copyToNewProjectRoot it passes in a third
   *                         parameter:  A boolean flag variable indicating whether or
   *                         not cubes are being copied to the results folder in addition
   *                         to ecubs (the cube labels).  This variable is set in the Project
   *                         class.  References #4848.
   *
   */
  class ImageList : public QObject, public QList<Image *> {
    Q_OBJECT
+27 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ namespace Isis {
    m_isTemporaryProject = true;
    m_activeControl = NULL;
    m_activeImageList = NULL;
    m_copyCubes = false;

    m_numImagesCurrentlyReading = 0;

@@ -1514,6 +1515,32 @@ namespace Isis {
  }


  /**
   * Sets a boolean flag which determines whether to save the
   * Cubes in the project ImageLists as well as the ecubs (the labels)
   * False means we do not save the cubes, and true means we do.
   * @param copy
   *
   */
  void Project::setCopyCubes(bool copy) {

    m_copyCubes = copy;

  }

  /**
   * Returns the boolean flag indicating whether or not we are copying
   * the cubes in the ImageLists into the results folder upon save.
   * False means we are not (and are saving the ecubs only).  True means we are copying both.
   * @return True if saving the cubes, false otherwise.
   */
  bool Project::copyCubes() const {

    return m_copyCubes;

  }


  void Project::save() {
    if (m_isTemporaryProject) {
      QString newDestination = QFileDialog::getSaveFileName(NULL,
Loading