Commit a03013a9 authored by Ken Edmundson's avatar Ken Edmundson
Browse files

Added member variable QString m_outputControlName. Added argument QString...

Added member variable QString m_outputControlName. Added argument QString outputControlFileName to constructor.
parent 8b6bc142
Loading
Loading
Loading
Loading
+26 −7
Original line number Diff line number Diff line
@@ -56,12 +56,13 @@ namespace Isis {
  JigsawDialog::JigsawDialog(Project *project,
                             BundleSettingsQsp bundleSettings,
                             Control *selectedControl,
                             QString outputControlFileName,
                             QWidget *parent) : QDialog(parent), m_ui(new Ui::JigsawDialog) {

    m_project = project;
    m_bundleSettings = bundleSettings;
    m_selectedControl = selectedControl;
    m_selectedControlName = FileName(selectedControl->fileName()).name();
    m_outputControlName = outputControlFileName;
    init();
  }

@@ -175,6 +176,7 @@ namespace Isis {

    if (setupdlg.exec() == QDialog::Accepted) {
      m_selectedControlName = setupdlg.selectedControlName();
      m_outputControlName = setupdlg.outputControlName();
      m_selectedControl = setupdlg.selectedControl();
      m_bundleSettings = setupdlg.bundleSettings();
      // The settings have been modified, might be misleading to keep this check after setup.
@@ -209,7 +211,8 @@ namespace Isis {
         }

         // Grab the control name that was used in that bundle adjustment.
         m_selectedControlName = FileName(bundleSolutionInfo.last()->controlNetworkFileName()).name();
         m_selectedControlName
             = FileName(bundleSolutionInfo.last()->inputControlNetFileName()).name();
      }

      // Clear the dialog displays.
@@ -379,12 +382,28 @@ namespace Isis {
    //  Write text summary file
    m_bundleSolutionInfo->outputText();

    // create output control net
    // Write the new jigged control net with correct path to results folder + runtime
    FileName jiggedControlName(m_project->bundleSolutionInfoRoot() + "/" + runTime + "/" +
                               FileName(m_bundleSolutionInfo->controlNetworkFileName()).name());
    // create output control net file name
    FileName outputControlName;
    if (!m_outputControlName.isEmpty()) {
      outputControlName
          = FileName(m_project->bundleSolutionInfoRoot() + "/" + runTime + "/" +
                     m_outputControlName + ".net");
    }
    else {
      outputControlName = FileName(m_project->bundleSolutionInfoRoot() + "/" + runTime + "/Out-" +
                                 runTime + "-" +
                                 FileName(m_bundleSolutionInfo->inputControlNetFileName()).name());
    }

    // Write output control net with correct path to results folder + runtime
    m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(outputControlName.toString());

    // create Control with output control net and add to m_bundleSolutionInfo
    m_bundleSolutionInfo->setOutputControl(new Control(m_project, outputControlName.expanded()));

    m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(jiggedControlName.toString());
    // TODO: it seems like this new Control should be added to the Project, but this doesn't work
    //       need to make it work, the alternative is the kluge in the JigsawWorkOrder::execute
    //       method

    // Iterate through all of the image lists (the "imports" in the project).
    QList<ImageList *> imageLists = m_bundleSolutionInfo->imageList();
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ namespace Isis {
   *                           accepted. Fixes #4960
   *   @history 2017-11-01 Ian Humphrey - Create ecubs in the bundle results directory which contain
   *                           updated SPICE.  Fixes #4804, #4849.
   *   @history 2018-03-22 Ken Edmundson - Added member variable QString m_outputControlName.
   *                           Added argument QString outputControlFileName to constructor.
   */
  class JigsawDialog : public QDialog {
    Q_OBJECT
@@ -88,6 +90,7 @@ namespace Isis {
    explicit JigsawDialog(Project *project,
                          BundleSettingsQsp bundleSettings,
                          Control *selectedControl,
                          QString outputControlFileName,
                          QWidget *parent = 0);

    ~JigsawDialog();
@@ -106,6 +109,7 @@ namespace Isis {
    Project *m_project;
    Control *m_selectedControl;
    QString m_selectedControlName;
    QString m_outputControlName;
    BundleSettingsQsp m_bundleSettings;

  private: