Unverified Commit 9cc64e5b authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Merge pull request #297 from AgoinsUSGS/cubeDn

Health Monitor populates CubeDnView with selected cubes.
parents 71590799 b667515c
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
@@ -36,10 +36,14 @@
#include "ControlPointEditView.h"
#include "ControlPointEditWidget.h"
#include "CnetEditorView.h"
#include "CubeDnView.h"

#include "ControlNet.h"
#include "ControlPoint.h"
#include "Directory.h"
#include "ProjectItem.h"
#include "ProjectItemModel.h"

#include "ToolPad.h"


@@ -59,8 +63,8 @@ namespace Isis {
    connect(m_controlHealthMonitorWidget, SIGNAL(openPointEditor(ControlPoint *)),
            this, SLOT(openPointEditor(ControlPoint *)));

    connect(m_controlHealthMonitorWidget, SIGNAL(openImageEditor()),
            this, SLOT(openImageEditor()));
    connect(m_controlHealthMonitorWidget, SIGNAL(openImageEditor(QList<QString>)),
            this, SLOT(openImageEditor(QList<QString>)));

    setCentralWidget(m_controlHealthMonitorWidget);

@@ -118,8 +122,22 @@ namespace Isis {
   *
   *  It is designed to open the CubeDnView and populate it with the selected cubes.
   */
  void ControlHealthMonitorView::openImageEditor() {
    m_directory->addCubeDnView();
  void ControlHealthMonitorView::openImageEditor(QList<QString> serials) {
    CubeDnView *cubeView = m_directory->addCubeDnView();
    foreach (QString serial, serials) {
      QList<ImageList*> imageLists = m_directory->project()->images();
      foreach(ImageList *list, imageLists) {
        foreach(Image *image, *list) {
          QString imageSerial = image->serialNumber();
          if (imageSerial == serial) {
            ProjectItem *item = m_directory->model()->findItemData(QVariant::fromValue(image));
            if (item) {
              cubeView->addItem(item);
            }
          }
        }
      }
    }
  }


+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class ControlHealthMonitorView : public AbstractProjectItemView {

  private slots:
    void openPointEditor(ControlPoint *point);
    void openImageEditor();
    void openImageEditor(QList<QString> serials);

  private:
    Directory *m_directory;
+9 −44
Original line number Diff line number Diff line
@@ -149,26 +149,6 @@ namespace Isis {
  }


  void ControlHealthMonitorWidget::broken() {
    updateStatus(0);
    m_statusLabel->setText("Broken!");
    m_statusDetails->setText("This network has more than one island.");
  }

  void ControlHealthMonitorWidget::weak() {
    updateStatus(1);
    m_statusLabel->setText("Weak!");
    m_statusDetails->setText("This network has " + toString(m_vitals->numPointsBelowMeasureThreshold()) + " points "
                             + "with less than 3 measures.");
  }

  void ControlHealthMonitorWidget::healthy() {
    updateStatus(2);
    m_statusLabel->setText("Healthy!");
    m_statusDetails->setText("This network is healthy.");
  }


  /*
   *  This SLOT is designed to update the values in the gui to properly represent
   *  The current state of the Control Network. This SLOT is triggered whenever the
@@ -362,7 +342,6 @@ namespace Isis {
    headers.append("New Value");
    headers.append("Timestamp");


    m_historyTable = new QTableWidget();
    m_historyTable->setColumnCount(5);
    m_historyTable->setHorizontalHeaderLabels(headers);
@@ -375,28 +354,8 @@ namespace Isis {
    m_historyTable->setGeometry(QApplication::desktop()->screenGeometry());

    overviewLayout->addWidget(m_historyTable);

    QWidget *tempWidget = new QWidget;
    QHBoxLayout *tempLayout = new QHBoxLayout;

    tempLayout->setSpacing(15);

    QPushButton *broken = new QPushButton("Broken");
    QPushButton *weak = new QPushButton("Weak");
    QPushButton *healthy = new QPushButton("Healthy");

    connect (broken,  SIGNAL(clicked()), this, SLOT(broken()));
    connect (weak,    SIGNAL(clicked()), this, SLOT(weak()));
    connect (healthy, SIGNAL(clicked()), this, SLOT(healthy()));

    tempLayout->addWidget(broken);
    tempLayout->addWidget(weak);
    tempLayout->addWidget(healthy);

    tempWidget->setLayout(tempLayout);
    overviewLayout->addWidget(tempWidget);

    overview->setLayout(overviewLayout);

    return overview;
  }

@@ -467,7 +426,8 @@ namespace Isis {
    m_imagesTable->verticalHeader()->setVisible(false);
    m_imagesTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
    m_imagesTable->setSelectionBehavior(QAbstractItemView::SelectRows);
    m_imagesTable->setSelectionMode(QAbstractItemView::SingleSelection);
    m_imagesTable->setSelectionMode(QAbstractItemView::ExtendedSelection);

    m_imagesTable->setShowGrid(true);
    m_imagesTable->setGeometry(QApplication::desktop()->screenGeometry());
    m_imagesTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -661,7 +621,12 @@ namespace Isis {
   *  and opens the CubeDnView with the images selected.
   */
  void ControlHealthMonitorWidget::emitOpenImageEditor() {
    emit openImageEditor();
    QList<QString> serials;
    QModelIndexList rows = m_imagesTable->selectionModel()->selectedRows(1);
    foreach (QModelIndex index, rows) {
      serials.append(index.data().toString());
    }
    emit openImageEditor(serials);
  }


+1 −5
Original line number Diff line number Diff line
@@ -76,15 +76,11 @@ namespace Isis {
      void viewImageFewMeasures();
      void viewImageHullTolerance();

      void broken();
      void weak();
      void healthy();

      void update();

    signals:
      void openPointEditor(ControlPoint *point);
      void openImageEditor();
      void openImageEditor(QList<QString> serials);

    private:
        void updateStatus(int code);