Commit 6153e565 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated JigsawDialog to give JigsawSetupDialog its current settings if not...

Updated JigsawDialog to give JigsawSetupDialog its current settings if not using the use last settings option. Fixes #4817.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce_FY17-Sprint1@7613 41f8697f-d340-4b68-9986-7bafba869bb8
parent 3d84c0c4
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -110,6 +110,13 @@ namespace Isis {
    m_ui->sigma0LcdNumber->setMode(QLCDNumber::Dec);
    m_ui->sigma0LcdNumber->setDigitCount(5);

    QString lastSettingsToolTip("Use the settings from the most recently accepted bundle adjust.");
    QString lastSettingsWhat("When checked, the settings from the most recently accepted bundle "
                             "adjust (i.e. the most recent bundle results in the project) will be "
                             "used for running the next bundle adjust when \"Run\" is clicked.");
    m_ui->useLastSettings->setToolTip(lastSettingsToolTip);
    m_ui->useLastSettings->setWhatsThis(lastSettingsWhat);

    setWindowFlags(Qt::WindowStaysOnTopHint);
  }

@@ -141,10 +148,19 @@ namespace Isis {
                               false,
                               this);

    // We want to use the current settings if not use the most recently accepted bundle settings.
    // This allows user to click "Setup", make changes, "OK", then click "Setup", and those changes
    // are present in the setup dialog.
    if (m_bundleSettings && !m_ui->useLastSettings->isChecked()) {
      setupdlg.loadSettings(m_bundleSettings);
    }

    if (setupdlg.exec() == QDialog::Accepted) {
      m_selectedControlName = setupdlg.selectedControlName();
      m_selectedControl = setupdlg.selectedControl();
      m_bundleSettings = setupdlg.bundleSettings();
      // The settings have been modified, might be misleading to keep this check after setup.
      m_ui->useLastSettings->setChecked(false);
    }
  }

@@ -240,8 +256,6 @@ namespace Isis {
        m_close->setEnabled(true);
      }
    }

    m_ui->useLastSettings->setEnabled(true);
  }


@@ -262,6 +276,8 @@ namespace Isis {
                               FileName(m_bundleSolutionInfo->controlNetworkFileName()).name());
    m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(jiggedControlName.toString());

    // Make sure that when we add our results, we let the use last settings box be checkable.
    m_ui->useLastSettings->setEnabled(true);

      //TODO: move correlation matrix to correct position in project directory
  //
+3 −0
Original line number Diff line number Diff line
@@ -49,6 +49,9 @@ namespace Isis {
   *                           default OK and Cancel buttons from UI file. Fixes #4781.
   *   @history 2017-04-18 Tracie Sucharski - Write the updated control net to the runtime
   *                           folder under results folder.  Fixes #4783.
   *   @history 2017-04-25 Ian Humphrey - Updated the setup clicked slot to load the current
   *                           settings into the setup dialog if we are not using the last
   *                           (most recent) settings in the project. Fixes #4817.
   */
  class JigsawDialog : public QDialog {
    Q_OBJECT
+27 −50
Original line number Diff line number Diff line
@@ -18,42 +18,6 @@
#include "ui_JigsawSetupDialog.h"

namespace Isis {
//  JigsawSetupDialog::JigsawSetupDialog(Project *project, QWidget *parent) :
//                                QDialog(parent), m_ui(new Ui::JigsawSetupDialog) {
//    //
//    // Note: When the ui is set up, all intializations to enabled/disabled
//    // are taken care of. Also connections between some widgets will be taken
//    // care of in the ui setup.

//    // For example:
//    //   radiusCheckBox is connected to pointRadiusSigmaLabel and pointRadiusSigmaLineEdit
//    //   outlierRejectionCheckBox is connected
//    //       to outlierRejectionMultiplierLabel and outlierRejectionMultiplierLineEdit
//    //
//    // These connections and settings can be found in the JigsawSetupDialog.ui file
//    // created by QtDesigner and may be edited by opening the ui file in QtDesigner.
//    //
//    // More complex connections such as the relationship between positionSolveOption and
//    // spkDegree are handled in this file by the on_widgetName_signal methods.
//    m_ui->setupUi(this);

//    m_project = project;

//    // fill control net combo box from project
//    for (int i = 0; i < project->controls().size(); i++) {
//      ControlList* conlist = project->controls().at(i);
//      for (int j = 0; j < conlist->size(); j++) {
//        Control *control = conlist->at(j);

//        QVariant v = qVariantFromValue((void*)control);

//        m_ui->controlNetworkComboBox->addItem(control->displayProperties()->displayName(), v);
//      }
//    }

//    m_ui->JigsawSetup->setCurrentIndex(0);
//  }


  JigsawSetupDialog::JigsawSetupDialog(Project *project, bool useLastSettings, bool readOnly,
                                       QWidget *parent) : QDialog(parent),
@@ -103,6 +67,8 @@ namespace Isis {
     fillFromSettings(lastBundleSettings);
    }

    // Update setup dialog with settings from any active (current) settings in jigsaw dialog.

    // initializations for observation solve settings tab
    m_ui->spkSolveDegreeSpinBox_2->setValue(-1);

@@ -322,7 +288,7 @@ namespace Isis {
  }


  void JigsawSetupDialog::fillFromSettings(BundleSettingsQsp settings) {
  void JigsawSetupDialog::fillFromSettings(const BundleSettingsQsp settings) {

    BundleObservationSolveSettings observationSolveSettings = settings->observationSolveSettings(0);

@@ -639,6 +605,17 @@ namespace Isis {
  }


  /**
   * Loads the passed bundle settings into the setup dialog. This is used by JigsawDialog to
   * load its current settings when not using the last (most recent) bundle settings in the project.
   *
   * @param const BundleSettingsQsp settings Shared pointer to the settings to load up.
   */
  void JigsawSetupDialog::loadSettings(const BundleSettingsQsp settings) {
    fillFromSettings(settings);
  }


  Control *JigsawSetupDialog::selectedControl() {

      int nIndex = m_ui->controlNetworkComboBox->currentIndex();
+11 −5
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ namespace Isis {
   *   @history 2016-08-18 Jeannie Backer - Removed all references to deprecated solve methods
   *                           SpeckialK and OldSparse. References #4162.
   *   @history 2016-08-25 Adam Paquette - Updated documentation. Fixes #4299.
   *   @history 2017-04-25 Ian Humphrey - Added public loadSettings() to allow JigsawDialog to
   *                           load its current settings into the setup dialog. Fixes #4817.
   */

  class JigsawSetupDialog : public QDialog {
@@ -43,14 +45,18 @@ namespace Isis {

  public:
//    explicit JigsawSetupDialog(Project* project, QWidget *parent = 0);
    explicit JigsawSetupDialog(Project* project, bool useLastSettings = true,
                               bool readOnly = false, QWidget *parent = 0);
    explicit JigsawSetupDialog(Project* project,
                               bool useLastSettings = true,
                               bool readOnly = false,
                               QWidget *parent = 0);
    ~JigsawSetupDialog();

    Control *selectedControl();// TODO: return const references ???
    QString *selectedControlName();// TODO: return const references ???
    BundleSettingsQsp bundleSettings();// TODO: return const references ???

    void loadSettings(const BundleSettingsQsp settings);

  private slots:

    void on_radiusCheckBox_toggled(bool checked);
@@ -90,7 +96,7 @@ namespace Isis {

    private:
    void makeReadOnly()    ;
    void fillFromSettings(BundleSettingsQsp settings);
    void fillFromSettings(const BundleSettingsQsp settings);
    void showTargetAngleWidgets();
    void hideTargetAngleWidgets();