Commit 0f23cb89 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

add validation for both tables in JSD observation solve settings tab

parent cf022843
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -1361,10 +1361,13 @@ namespace Isis {
    bool tablesAreValid = true;
    
    // Evaluate both tables; if any value is invalid, the table is invalid
    const QTableWidget *positionTable = m_ui->positionAprioriSigmaTable;
    QList<const QTableWidget *> tables{m_ui->positionAprioriSigmaTable,
                                       m_ui->pointingAprioriSigmaTable};
                                       
    for (int i = 0; i < positionTable->rowCount(); i++) {
      const QTableWidgetItem *item = positionTable->item(i,3);
    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;
@@ -1372,6 +1375,7 @@ namespace Isis {
          }
        }
      }
    }

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