Commit 39502ad8 authored by Ken Edmundson's avatar Ken Edmundson
Browse files

PROG: Removed serialization of output control filename. Modified serialization...

PROG: Removed serialization of output control filename. Modified serialization of output control to be more robust, ensuring that the control's id is added to project upon reading back in. Also ensures that an open cneteditor widget containing a bundlesolutioninfo's output control is serialized properly.
parent b21e6beb
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -1658,8 +1658,6 @@ namespace Isis {
    stream.writeTextElement("id", m_id->toString());
    stream.writeTextElement("name", m_name);
    stream.writeTextElement("runTime", runTime());
//    stream.writeTextElement("inputFileName",
//                            relativeBundlePath + m_inputControlNetFileName->name());

    QString relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot());
    // Get rid of any preceding "/" , but add on ending "/"
@@ -1669,8 +1667,6 @@ namespace Isis {

    stream.writeTextElement("inputFileName",
                            relativePath);
    stream.writeTextElement("outputFileName",
                            relativeBundlePath + FileName(m_outputControl->fileName()).name());
    stream.writeTextElement("bundleOutTXT",
                            relativeBundlePath + FileName(m_txtBundleOutputFilename).name());
    stream.writeTextElement("imagesCSV",
@@ -1696,7 +1692,13 @@ namespace Isis {
        }
        stream.writeEndElement();
      }

      // save output control
      stream.writeStartElement("outputControl");
      m_outputControl->save(stream, project, relativeBundlePath);
      stream.writeEndElement();
    }

    stream.writeEndElement(); //end bundleSolutionInfo
  }

@@ -1766,6 +1768,18 @@ namespace Isis {
        m_xmlHandlerBundleSolutionInfo->m_adjustedImages->append(
            new ImageList(m_xmlHandlerProject, reader()));
      }
      // TODO: Ken Edmundson - Need to make file handling more automatic instead of always having to
      //       explicitly create these paths, do we need a
      //       project->projectBundleSolutionPath() method? And can we let the BundleSolutionInfo
      //       object create the full path automatically by adding the runTime to the
      //       projectBundleSolutionPath()?
      else if (localName == "outputControl") {
        FileName outputControlPath
            = FileName(m_xmlHandlerProject->projectRoot() + "/results/bundle/"
                       + m_xmlHandlerBundleSolutionInfo->runTime());
        m_xmlHandlerBundleSolutionInfo->m_outputControl =
            new Control(outputControlPath, reader());
      }
    }
    return true;
  }
@@ -1806,13 +1820,6 @@ namespace Isis {
      m_xmlHandlerBundleSolutionInfo->m_inputControlNetFileName = new FileName(
        projectRoot + m_xmlHandlerCharacters);
    }
    else if (localName == "outputFileName") {
      assert(m_xmlHandlerBundleSolutionInfo->m_outputControl == NULL);
      delete m_xmlHandlerBundleSolutionInfo->m_outputControl;
      FileName fname(projectRoot + m_xmlHandlerCharacters);
      m_xmlHandlerBundleSolutionInfo->m_outputControl
          = new Control(fname.expanded());
    }
    else if (localName == "bundleOutTXT") {
      m_xmlHandlerBundleSolutionInfo->m_txtBundleOutputFilename =
        projectRoot + m_xmlHandlerCharacters;
+6 −0
Original line number Diff line number Diff line
@@ -128,6 +128,12 @@ namespace Isis {
   *                              serialization support.
   *                           3) member variable m_txtBundleOutputFilename and associated accessor
   *                              for bundleout.txt file.
   *   @history 2018-03-23 Ken Edmundson - modified...
   *                           1) removed serialization of output control filename
   *                           2) serialization of output control to be more robust, ensuring that
   *                              the control's id is added to project upon reading back in. Also
   *                              ensures that an open cneteditor widget containing a
   *                              bundlesolutioninfo's output control is serialized properly.
   */
  class BundleSolutionInfo : public QObject {
    Q_OBJECT