Commit 3da6d0dd authored by Adam Goins's avatar Adam Goins
Browse files

Added code cleanup and some documentation for work this far. Created necessary...

Added code cleanup and some documentation for work this far. Created necessary methods for the ContorlHealthMonitorWorkOrder.
parent a02b8320
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@
#include <QVBoxLayout>
#include <QWidgetAction>

#include "ControlHealthMonitorWidget.h"
#include "ControlNet.h"
#include "ControlPoint.h"
#include "ControlHealthMonitorWidget.h"
#include "Directory.h"
#include "ToolPad.h"

@@ -43,19 +43,12 @@ namespace Isis {
  /**
   * Constructor.
   */
  ControlHealthMonitorView::ControlHealthMonitorView(Directory *directory, QWidget *parent) :
  ControlHealthMonitorView::ControlHealthMonitorView(ControlNet *controlNet, QWidget *parent) :
                        AbstractProjectItemView(parent) {

    ControlNetVitals *vitals = new ControlNetVitals(directory->project()->activeControl()->controlNet());

    ControlNetVitals *vitals = new ControlNetVitals(controlNet);
    m_ControlHealthMonitorWidget = new ControlHealthMonitorWidget(vitals, parent);

    //  TODO How are control nets and serial number lists going to be handled?  I assume there can
    //       be several active control nets depending on the view, ie. jigsaw might operate on one
    //       net, while the editors might be using a different net.  Will Directory keep track?
    //


    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);

@@ -111,8 +104,7 @@ namespace Isis {
  /**
   * Returns the ControlHealthMonitorWidget.
   *
   * @return (ControlHealthMonitorWidget *) The ControlHealthMonitorWidget used to
   *         display the footprints.
   * @return (ControlHealthMonitorWidget *) The currently active ControlHealthMonitorWidget.
   */
  ControlHealthMonitorWidget *ControlHealthMonitorView::controlHealthMonitorWidget() {
    return m_ControlHealthMonitorWidget;
+7 −7
Original line number Diff line number Diff line
@@ -34,16 +34,16 @@ namespace Isis {
  class Directory;
  class ProjectItem;
  class ControlHealthMonitorWidget;
  class ControlNet;
  class ToolPad;

  /**
   * View for editing a single ControlPoint
   * View for the Control Net Health Monitor
   *
   * @author 2016-04-06 Tracie Sucharski
   * @author 2018-06-07 Adam Goins
   *
   * @internal
   *   @history 2016-09-30 Tracie Sucharski - Pass in directory to constructor, so that we can
   *                           query for shapes and other data from the project.
   *   @history 2018-06-07 Adam Goins - Initial Version.
   */

class ControlHealthMonitorView : public AbstractProjectItemView {
@@ -51,7 +51,7 @@ class ControlHealthMonitorView : public AbstractProjectItemView {
  Q_OBJECT

  public:
    ControlHealthMonitorView(Directory *directory, QWidget *parent = 0);
    ControlHealthMonitorView(ControlNet *controlNet, QWidget *parent = 0);
    ~ControlHealthMonitorView();

    virtual QList<QAction *> permToolBarActions();
@@ -69,9 +69,9 @@ class ControlHealthMonitorView : public AbstractProjectItemView {
  private:
    QPointer<ControlHealthMonitorWidget> m_ControlHealthMonitorWidget;

    ToolPad *m_toolPad;        //!< The tool pad
    QToolBar *m_permToolBar;   //!< The permanent tool bar
    QToolBar *m_activeToolBar; //!< The active tool bar
    ToolPad *m_toolPad; //!< The tool pad

    QWidgetAction *m_activeToolBarAction; //!< Stores the active tool bar
  };
+443 −465

File changed.

Preview size limit exceeded, changes collapsed.

+16 −25
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ QT_CHARTS_USE_NAMESPACE
      QWidget* createPointsTab();
      QWidget* createOverviewTab();
      QWidget* createGraphTab();
      void setVitals(ControlNetVitals *vitals) 
      void setVitals(ControlNetVitals *vitals);
      void initializeEverything();

    public slots:
@@ -73,9 +73,6 @@ QT_CHARTS_USE_NAMESPACE
      void viewImageFewMeasures();
      void viewImageHullTolerance();

      void breakNet();
      void weak();
      void healthy();
      void update();


@@ -85,38 +82,32 @@ QT_CHARTS_USE_NAMESPACE
        void updatePointTable(QList<ControlPoint*> points);

        QChartView *m_pointChartView;

        ControlNetVitals *m_vitals;

        QProgressBar *m_statusBar;

        QLabel *m_sizeLabel;
        QLabel *m_numImagesLabel;
        QLabel *m_numPointsLabel;
        QLabel *m_numMeasuresLabel;
        QLabel *m_lastModLabel;
        QLabel *m_netLabel;
        QTableWidget *m_historyTable;
        QTableWidget *m_imagesTable;
        QTableWidget *m_pointsTable;

        QLabel *m_imagesMeasuresValue;
        QLabel *m_imagesHullValue;
        QLabel *m_imagesMeasuresValue;
        QLabel *m_imagesShowingLabel;
        QLabel *m_statusLabel;
        QLabel *m_statusDetails;

        QLabel *m_pointsIgnoredLabel;
        QLabel *m_lastModLabel;
        QLabel *m_netLabel;
        QLabel *m_numImagesLabel;
        QLabel *m_numMeasuresLabel;
        QLabel *m_numPointsLabel;
        QLabel *m_pointsConstrainedLabel;
        QLabel *m_pointsEditLockedLabel;
        QLabel *m_pointsFewMeasuresLabel;
        QLabel *m_pointsShowingLabel;
        QLabel *m_pointsFixedLabel;
        QLabel *m_pointsFreeLabel;
        QLabel *m_pointsConstrainedLabel;

        QTableWidget *m_historyTable;
        QTableWidget *m_imagesTable;
        QTableWidget *m_pointsTable;
        QLabel *m_pointsIgnoredLabel;
        QLabel *m_pointsShowingLabel;
        QLabel *m_sizeLabel;
        QLabel *m_statusDetails;
        QLabel *m_statusLabel;

        QStringList *activeImageList;
        QStringList *activePointsList;
  };
}

+54 −12
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@
#include "CloseProjectWorkOrder.h"
#include "CnetEditorView.h"
#include "CnetEditorViewWorkOrder.h"
#include "ControlHealthMonitorView.h"
#include "ControlHealthMonitorWorkOrder.h"
#include "CnetEditorWidget.h"
#include "Control.h"
#include "ControlDisplayProperties.h"
@@ -158,6 +160,7 @@ namespace Isis {
      createWorkOrder<TargetGetInfoWorkOrder>();
      createWorkOrder<BundleObservationViewWorkOrder>();
      createWorkOrder<TemplateEditViewWorkOrder>();
      createWorkOrder<ControlHealthMonitorWorkOrder>();

      //  Main menu actions
      m_exportControlNetWorkOrder = createWorkOrder<ExportControlNetWorkOrder>();
@@ -790,6 +793,32 @@ namespace Isis {
    return result;
  }

  ControlHealthMonitorView *Directory::controlHealthMonitorView() {
    return m_controlHealthMonitorView;
  }


  ControlHealthMonitorView *Directory::addControlHealthMonitorView() {

    if (!controlHealthMonitorView()) {

      Control *activeControl = project()->activeControl();
      if (activeControl == NULL) {
        QString message = "No active control network chosen.  Choose active control network on "
                          "project tree.\n";
        QMessageBox::critical(qobject_cast<QWidget *>(parent()), "Error", message);
        return NULL;
      }

      ControlHealthMonitorView *result = new ControlHealthMonitorView(project()->activeControl()->controlNet());
      result->setWindowTitle(tr("Control Net Health Monitor"));
      result->setObjectName(result->windowTitle());

      m_controlHealthMonitorView = result;
      emit newWidgetAvailable(result);
    }
    return controlHealthMonitorView();
  }

  ControlPointEditView *Directory::addControlPointEditView() {

@@ -1039,6 +1068,19 @@ namespace Isis {
    m_project->setClean(false);
  }

  // /**
  //  * @brief Removes pointers to deleted Control Health Monitor objects.
  //  */
  // void Directory::cleanupControlHealthMonitorView(QObject *obj) {
  //
  //   ControlHealthMonitorView *healthMonitorView = static_cast<ControlHealthMonitorView *>(obj);
  //   if (!healthMonitorView) {
  //     return;
  //   }
  //
  //   m_project->setClean(false);
  // }


  /**
   * @brief Removes pointers to deleted CnetEditorWidget objects.
Loading