Commit 8747addc authored by chrisryancombs's avatar chrisryancombs
Browse files

Resolved merge conflict, updated history.

parents 4f5832cb 778c54d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ namespace Isis {
   *                              is for creating and displaying the correlation matrix, which is
   *                              currently not working.
   *                           2) commented out hdf5 header includes in cpp
   *   @history 2018-06-26 Christopher Combs - Added observationSolveSettings() method to retrieve
   *   @history 2018-06-28 Christopher Combs - Added observationSolveSettings() method to retrieve
   *                            m_observationSolveSettings. Fixes #497.
   *
   *   @todo Determine which XmlStackedHandlerReader constructor is preferred
+20 −4
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ namespace Isis {
                                           bool solvePolynomialOverExisting,
                                           double anglesAprioriSigma,
                                           double angularVelocityAprioriSigma,
                                           double angularAccelerationAprioriSigma) {
                                           double angularAccelerationAprioriSigma,QList<double> * additionalPointingSigmas) {

    // automatically set the solve option and ck degree to the user entered values
    m_instrumentPointingSolveOption = option;
@@ -434,6 +434,16 @@ namespace Isis {
      }
    }

    if (additionalPointingSigmas) {
      for (int i=0;i < additionalPointingSigmas->count();i++) {         
          m_anglesAprioriSigma.append(additionalPointingSigmas->value(i));
      }
    }





    m_solveTwist = solveTwist; // dependent on solve option???

    // Set the SpiceRotation interpolation type enum appropriately
@@ -622,14 +632,14 @@ namespace Isis {
   * @param velocityAprioriSigma A priori velocity sigma
   * @param accelerationAprioriSigma A priori acceleration sigma
   */
  void BundleObservationSolveSettings::setInstrumentPositionSettings(
                                           InstrumentPositionSolveOption option,
  void BundleObservationSolveSettings::setInstrumentPositionSettings(InstrumentPositionSolveOption option,
                                           int spkDegree,
                                           int spkSolveDegree,
                                           bool positionOverHermite,
                                           double positionAprioriSigma,
                                           double velocityAprioriSigma,
                                           double accelerationAprioriSigma) {
                                           double accelerationAprioriSigma,
                                           QList<double> *additionalPositionSigmas) {
    // automatically set the solve option and spk degree to the user entered values
    m_instrumentPositionSolveOption = option;

@@ -680,6 +690,12 @@ namespace Isis {
      }
    }

    if (additionalPositionSigmas) {
      for (int i=0;i < additionalPositionSigmas->count();i++) {
          m_positionAprioriSigma.append(additionalPositionSigmas->value(i));
      }
    }

    // Set the SpicePosition interpolation type enum appropriately
    m_solvePositionOverHermiteSpline = positionOverHermite;
    if (m_solvePositionOverHermiteSpline) {
+8 −3
Original line number Diff line number Diff line
@@ -78,7 +78,10 @@ namespace Isis {
   *   @history 2018-06-21 Ian Humphrey - Added removeObservationNumber() to be able to remove an
   *                           observation number from a BundleObservationSolveSettings.
   *                           References #497.
   *
   *   @history 2018-06-26 Tyler Wilson - Added support for adding an arbitrary number of
   *                           additional apriori sigma values in setInstrumentPositionSettings/
   *                           setInstrumentPointingSettings beyond position/velocity/acceleration.
   *                           References #497.
   *
   *   @todo Figure out why solve degree and num coefficients does not match solve option.
   *   @todo Determine whether xml stuff needs a Project pointer.
@@ -128,7 +131,8 @@ class BundleObservationSolveSettings {
                                         bool solvePolynomialOverExisting = false,
                                         double anglesAprioriSigma = -1.0,
                                         double angularVelocityAprioriSigma = -1.0,
                                         double angularAccelerationAprioriSigma = -1.0);
                                         double angularAccelerationAprioriSigma = -1.0,
                                         QList<double> * additionalPointingSigmas=nullptr);
      InstrumentPointingSolveOption instrumentPointingSolveOption() const;
      bool solveTwist() const;
      int ckDegree() const;
@@ -159,7 +163,8 @@ class BundleObservationSolveSettings {
                                         bool positionOverHermite = false,
                                         double positionAprioriSigma = -1.0,
                                         double velocityAprioriSigma = -1.0,
                                         double accelerationAprioriSigma = -1.0);
                                         double accelerationAprioriSigma = -1.0,
                                         QList<double> * additionalPositionSigmas=nullptr);
      InstrumentPositionSolveOption instrumentPositionSolveOption() const;
      int spkDegree() const;
      int spkSolveDegree() const;
+63 −7
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ namespace Isis {

    const QStringList pointingOptions{"NONE", "ANGLES", "VELOCITY", "ACCELERATION", "ALL"};
    m_ui->pointingComboBox->insertItems(0, pointingOptions);
    m_ui->pointingComboBox->setCurrentIndex(0);
    m_ui->pointingComboBox->setCurrentIndex(1);

    // The degree solve options' minimums are -1 (set in ui file), make the -1's display as N/A
    m_ui->spkSolveDegreeSpinBox->setSpecialValueText("N/A");
@@ -160,13 +160,19 @@ namespace Isis {
    QStringList tableHeaders;
    tableHeaders << "coefficients" << "description" << "units" << "a priori sigma";
    m_ui->positionAprioriSigmaTable->setHorizontalHeaderLabels(tableHeaders);
    m_ui->pointingAprioriSigmaTable->setHorizontalHeaderLabels(tableHeaders);

    // Set the default size of the columns
    m_ui->positionAprioriSigmaTable->setColumnWidth(0, fontMetrics().width(tableHeaders.at(0)) + 10);
    m_ui->positionAprioriSigmaTable->setColumnWidth(1, fontMetrics().width(tableHeaders.at(1)) + 10);
    m_ui->positionAprioriSigmaTable->setColumnWidth(2, fontMetrics().width(tableHeaders.at(2)) + 10);
    m_ui->positionAprioriSigmaTable->setColumnWidth(3, fontMetrics().width(tableHeaders.at(3)) + 10);

    m_ui->pointingAprioriSigmaTable->setHorizontalHeaderLabels(tableHeaders);
    m_ui->pointingAprioriSigmaTable->setColumnWidth(0, fontMetrics().width(tableHeaders.at(0)) + 10);
    m_ui->pointingAprioriSigmaTable->setColumnWidth(1, fontMetrics().width(tableHeaders.at(1)) + 10);
    m_ui->pointingAprioriSigmaTable->setColumnWidth(2, fontMetrics().width(tableHeaders.at(2)) + 10);
    m_ui->pointingAprioriSigmaTable->setColumnWidth(3, fontMetrics().width(tableHeaders.at(3)) + 10);


    // Add validators to the tables in the observation solve settings tab to validate the a priori
    // sigma items
@@ -865,10 +871,12 @@ namespace Isis {


      boss.setInstrumentPositionSettings(positionSolvingOption,spkDegree,spkSolveDegree,positionOverHermite,
                                         positionAprioriSigma,velocityAprioriSigma,accelerationAprioriSigma);
                                         positionAprioriSigma,velocityAprioriSigma,accelerationAprioriSigma,
                                         &additionalPositionCoefficients);

      boss.setInstrumentPointingSettings(pointSolvingOption,solveTwist,ckDegree,ckSolveDegree,solvePolynomialOverExisting,
                                         anglesAprioriSigma,angularVelocityAprioriSigma,angularAccelerationAprioriSigma);
                                         anglesAprioriSigma,angularVelocityAprioriSigma,angularAccelerationAprioriSigma,
                                         &additionalAngularCoefficients);

      //What if multiple instrument IDs are represented?
      boss.setInstrumentId("");
@@ -888,7 +896,7 @@ namespace Isis {
          if (projItem->isImage() ) {
            Image * img = projItem->data().value<Image *>();
            boss.addObservationNumber(img->serialNumber() );
            //qDebug() << "serial num:  " << img->serialNumber();

          }
        }

@@ -1428,7 +1436,7 @@ namespace Isis {
    }

    // FREE is a valid value for the a priori sigma column
    int free = item->text().compare("FREE", Qt::CaseInsensitive);
    int free = item->text().simplified().compare("FREE", Qt::CaseInsensitive);
    if (free == 0) {
      item->setText("FREE");
    }
@@ -1438,6 +1446,7 @@ namespace Isis {
    double sigma = item->text().toDouble(&convertSuccess);
    if ((convertSuccess && sigma >= 0.0) || free == 0) {
      const QTableWidget *table = item->tableWidget();
      item->setData(Qt::UserRole, QVariant(true));
      // Set background color depending on if the table has alternating row colors and row is odd
      if (table->alternatingRowColors() && item->row() % 2 != 0) {
        item->setBackground(table->palette().color(QPalette::AlternateBase));
@@ -1447,8 +1456,45 @@ namespace Isis {
      }
    }
    else {
      item->setData(Qt::UserRole, QVariant(false));
      item->setBackground(Qt::red);
    }

    validateSigmaTables();
  }


  /**
   * Validates the tables in the observation solve settings tab and enables/disables the OK
   * button appropriately.
   *
   * This method validates both the position and pointing a priori sigma tables in the observation
   * solve settings tab. If any of the sigma values are invalid, the JigsawSetupDialog's OK button
   * is disabled. If all of the sigma values are valid, the JigsawSetupDialog's OK button is
   * (re)enabled.
   */
  void JigsawSetupDialog::validateSigmaTables() {
    bool tablesAreValid = true;
    
    // Evaluate both tables; if any value is invalid, the table is invalid
    QList<const QTableWidget *> tables{m_ui->positionAprioriSigmaTable,
                                       m_ui->pointingAprioriSigmaTable};
                                       
    for (const auto &table : tables) {
      for (int i = 0; i < table->rowCount(); i++) {
        // a priori sigma column is column 3
        const QTableWidgetItem *item = table->item(i,3);
        if (item) { 
          if (item->data(Qt::UserRole).toBool() == false) {
            tablesAreValid = false;
            break;
          }
        }
      }
    }

    m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(tablesAreValid);
    m_ui->applySettingsPushButton->setEnabled(tablesAreValid);
  }


@@ -1468,6 +1514,11 @@ namespace Isis {
    table->setRowCount(i + 1);
    const int newRowCount = table->rowCount();

    // Need to check if table is valid in case a row is removed (a row is removed implicitly when
    // the setRowCount() is called when newRowCount < oldRowCount
    validateSigmaTables();

    // Rows need to be added
    if (newRowCount > oldRowCount) {
      for (int row = oldRowCount; row < newRowCount; row++) {
        // Headers : coefficient, description, units, a priori sigma
@@ -1489,6 +1540,7 @@ namespace Isis {
        QTableWidgetItem *sigma = new QTableWidgetItem();
        sigma->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
        sigma->setText("0.0");
        sigma->setData(Qt::UserRole, QVariant(true));
        table->setItem(row, 3, sigma);

        // Solve option: spk degree { NONE: -1, POSITION: 0, VELOCITY: 1, ACCELERATION: 2, ALL: 2 }
@@ -1542,8 +1594,11 @@ namespace Isis {
    table->setRowCount(i + 1);
    const int newRowCount = table->rowCount();

    if (newRowCount > oldRowCount) {
    // Need to check if table is valid in case a row is removed (a row is removed implicitly when
    // the setRowCount() is called when newRowCount < oldRowCount
    validateSigmaTables();

    if (newRowCount > oldRowCount) {
      for (int row = oldRowCount; row < newRowCount; row++) {
        // Headers : coefficient, description, units, a priori sigma
        QTableWidgetItem *coefficient = new QTableWidgetItem();
@@ -1564,6 +1619,7 @@ namespace Isis {
        QTableWidgetItem *sigma = new QTableWidgetItem();
        sigma->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
        sigma->setText("0.0");
        sigma->setData(Qt::UserRole, QVariant(true));
        table->setItem(row, 3, sigma);

        // { NONE: N/A, ANGLES: 0, ANGULAR VELOCITY: 1, ANGULAR ACCELERATION: 2, ALL: 2 }
+12 −4
Original line number Diff line number Diff line
@@ -77,10 +77,17 @@ namespace Isis {
   *                           updateBundleObservationSolveSettings(BundleObservationSolveSettings &) 
   *                           which grabs BOSS settings from the JSD BOSS tab for selected images 
   *                           in the BOSS QTreeView and saves them in a BOSS object.
   *   @history 2018-06-26 Christopher Combs - Implemented pseudocode in on_applySettings... method.
   *                           References #497.
   *   @history 2018-06-26 Tyler Wilson - Added support in
   *                           updateBundleObservationSolveSettings(BundleObservationSolveSettings &)
   *                           for the user to set an arbitrary number of position/pointing Apriori
   *                           Sigma values beyond position/velocity/acceleration.  References #497.
   *   @history 2018-06-27 Ian Humphrey - Added validateSigmaTables() that checks if there are any
   *                           invalid a priori sigma values whenever an a priori sigma values changes.
   *                           If any value is invalid, the OK and Apply Settings buttons are disabled
   *                           until all the a priori sigma values are valid again. References #497.
   *   @history 2018-06-28 Christopher Combs - Implemented pseudocode in on_applySettings... method.
   *                           Added selected images to default BOSS object. References #497.
   */

  class JigsawSetupDialog : public QDialog {
    Q_OBJECT

@@ -155,6 +162,7 @@ namespace Isis {
    void on_pointingComboBox_currentIndexChanged(const QString &arg1);

    void validateSigmaValue(QTableWidgetItem *);
    void validateSigmaTables();
    

    public slots: