Unverified Commit a08b7ae9 authored by Tracie Sucharski's avatar Tracie Sucharski Committed by GitHub
Browse files

Merge pull request #111 from kledmundson/ipce

Ipce
parents 1a4e41c1 75fe5800
Loading
Loading
Loading
Loading
+14 −21
Original line number Diff line number Diff line
@@ -1595,16 +1595,8 @@ namespace Isis {
                             .arg(bundleSolutionInfoRoot.path()),
                           _FILEINFO_);
        }
        QString oldFile = oldPath + "/" + m_inputControlNetFileName->name();
        QString newFile = newPath + "/" + m_inputControlNetFileName->name();
        if (!QFile::copy(oldFile, newFile)) {
          throw IException(IException::Io,
                           QString("Failed to copy file [%1] to new file [%2]")
                             .arg(m_inputControlNetFileName->name()).arg(newFile),
                           _FILEINFO_);
        }
        oldFile = oldPath + "/" + m_outputControl->fileName();
        newFile = newPath + "/" + m_outputControl->fileName();
        QString oldFile = oldPath + "/" + FileName(m_outputControl->fileName()).name();
        QString newFile = newPath + "/" + FileName(m_outputControl->fileName()).name();
        if (!QFile::copy(oldFile, newFile)) {
          throw IException(IException::Io,
                           QString("Failed to copy file [%1] to new file [%2]")
@@ -1658,8 +1650,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 +1659,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 +1684,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 +1760,12 @@ namespace Isis {
        m_xmlHandlerBundleSolutionInfo->m_adjustedImages->append(
            new ImageList(m_xmlHandlerProject, reader()));
      }
      else if (localName == "outputControl") {
        FileName outputControlPath = FileName(m_xmlHandlerProject->bundleSolutionInfoRoot() + "/"
                                              + m_xmlHandlerBundleSolutionInfo->runTime());

        m_xmlHandlerBundleSolutionInfo->m_outputControl = new Control(outputControlPath, reader());
      }
    }
    return true;
  }
@@ -1806,13 +1806,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;
+8 −0
Original line number Diff line number Diff line
@@ -128,6 +128,14 @@ 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.
   *   @history 2018-03-26 Ken Edmundson - modified save method to properly save output control
   *                           network file.
   */
  class BundleSolutionInfo : public QObject {
    Q_OBJECT
+7 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include <QDebug>
#include <QFile>
#include <QFontDatabase>
#include <QHeaderView>
#include <QSizePolicy>
#include <QStandardItem>
@@ -171,7 +172,12 @@ namespace Isis {

    QTextStream in(&file);
    QTextEdit *qText=new QTextEdit();
    qText->setFontFamily("Courier");

    // From QFontDatabase::systemFont(SystemFont type) method description: returns most adequate
    //      font for a given typecase (here FixedFont) for proper integration with system's look and
    //      feel.
    const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
    qText->setFontFamily(fixedFont.family());

    while (!in.atEnd()) {
      qText->append(in.readLine());
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ namespace Isis{
   *                           Set SectionResizeMode to QHeaderView::ResizeToContents so columns are
   *                           displayed at the width of the maximum size of the column content.
   *                           Fixes #4850.
   *   @history 2018-03-26 Ken Edmundson - Modified displayTextFile method to query for system's
   *                           fixed width font.
   */

  class BundleObservationView : public AbstractProjectItemView
+0 −20
Original line number Diff line number Diff line
@@ -178,28 +178,8 @@ namespace Isis {
    // Get the selected control and bundle settings and give them to the JigsawDialog for now.
    Control *selectedControl = proj->control(internalData().first());

    // if selectedControl is NULL, maybe the Control we want is an output Control in a
    // BundleSolutionInfo, so let's look there (I think the project()->control() method above should
    // look in the results area for this automatically
    // this is a workaround because the BundleSolutionInfo's Control is not in the project's control
    // list
    if (!selectedControl) {
      int nBundles = proj->bundleSolutionInfo().size();
      for (int i = 0; i < nBundles; i++) {
        BundleSolutionInfo *bundleSolution = proj->bundleSolutionInfo().at(i);
        Control *bundleControl = bundleSolution->control();
        if (bundleControl->id() != internalData().first()) {
            continue;
        }
        else {
          selectedControl = bundleControl;
        }
      }
    }

    QString outputControlFileName = internalData().at(1);

//    JigsawDialog *runDialog = new JigsawDialog(project(), m_bundleSettings, selectedControl);
    JigsawDialog *runDialog = new JigsawDialog(project(), m_bundleSettings, selectedControl,
                                               outputControlFileName);
    runDialog->setAttribute(Qt::WA_DeleteOnClose);
Loading