Commit fc318d60 authored by Adam Goins's avatar Adam Goins
Browse files

Added signal / slot to necessary members for health monitor

parent 617c6851
Loading
Loading
Loading
Loading
+34 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <QList>
#include <QStringList>
#include <QPoint>

#include "Application.h"
#include "Camera.h"
@@ -148,6 +149,9 @@ namespace Isis {
    if (IsEditLocked())
      return MeasureLocked;
    MeasureModified();
    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::AprioriLineModified, p_aprioriLine, aprioriLine);
    }
    p_aprioriLine = aprioriLine;
    return Success;
  }
@@ -158,6 +162,9 @@ namespace Isis {
    if (IsEditLocked())
      return MeasureLocked;
    MeasureModified();
    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::AprioriSampleModified, p_aprioriSample, aprioriSample);
    }
    p_aprioriSample = aprioriSample;
    return Success;
  }
@@ -245,8 +252,15 @@ namespace Isis {
    if (IsEditLocked())
      return MeasureLocked;
    MeasureModified();
    QPoint old(p_sample, p_line);
    QPoint newer(sample, line);
    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::CoordinatesModified, old, newer);
    }

    p_sample = sample;
    p_line = line;

    SetType(type);
    return Success;
  }
@@ -288,6 +302,9 @@ namespace Isis {


  ControlMeasure::Status ControlMeasure::SetEditLock(bool editLock) {
    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::EditLockModified, p_editLock, editLock);
    }
    p_editLock = editLock;
    return Success;
  }
@@ -360,6 +377,10 @@ namespace Isis {
    if (IsEditLocked())
      return MeasureLocked;

    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::IgnoredModified, p_ignore, newIgnoreStatus);
    }

    bool oldStatus = p_ignore;
    p_ignore = newIgnoreStatus;

@@ -403,6 +424,14 @@ namespace Isis {
      double lineResidual) {

    MeasureModified();

    QPoint old(p_sampleResidual, p_lineResidual);
    QPoint newer(sampResidual, lineResidual);

    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::ResidualModified, old, newer);
    }

    p_sampleResidual = sampResidual;
    p_lineResidual   = lineResidual;
    return Success;
@@ -423,6 +452,10 @@ namespace Isis {
    if (IsEditLocked())
      return MeasureLocked;
    MeasureModified();

    if (parentPoint) {
      parentPoint->emitMeasureModified(this, ControlMeasure::TypeModified, p_measureType, type);
    }
    p_measureType = type;
    return Success;
  }
+11 −1
Original line number Diff line number Diff line
@@ -226,6 +226,16 @@ namespace Isis {
        MeasureLocked
      };

      enum ModType {
        AprioriLineModified,
        AprioriSampleModified,
        CoordinatesModified,
        EditLockModified,
        IgnoredModified,
        ResidualModified,
        TypeModified
      };

      enum DataField {
        AprioriLine        = 1,
        AprioriSample      = 2,
+70 −46
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <QScopedPointer>
#include <QSet>
#include <QTime>
#include <QVariant>
#include <QVector>

#include <boost/numeric/ublas/symmetric.hpp>
@@ -126,6 +127,23 @@ namespace Isis {
    nullify();
  }

  void ControlNet::emitMeasureModified(ControlMeasure *measure, int type, QVariant oldValue, QVariant newValue) {
    std::cout << "Measure modified" << std::endl;
    std::cout << "Old value: " << oldValue.toString() << std::endl;
    std::cout << "New value: " << newValue.toString() << std::endl;
    emit measureModified(measure, type, oldValue, newValue);

  }

  void ControlNet::emitPointModified(ControlPoint *point, int type, QVariant oldValue, QVariant newValue) {
    std::cout << "Point modified" << std::endl;
    std::cout << point << std::endl;

    std::cout << "Old value: " << oldValue.toString() << std::endl;
    std::cout << "New value: " << newValue.toString() << std::endl;
    emit pointModified(point, type, oldValue, newValue);
  }


 /**
  *  @brief Clear the contents of this object
@@ -337,6 +355,7 @@ namespace Isis {
    pointAdded(point);

    emit networkStructureModified();
    emit networkModified(ControlNet::PointAdded, 0, point->GetId());
  }


@@ -750,6 +769,8 @@ namespace Isis {

    if (!wasIgnored)
      emit networkStructureModified();
      emit networkModified(ControlNet::PointDeleted, pointId, 0);


    return ControlPoint::Success;
  }
@@ -1654,6 +1675,9 @@ namespace Isis {
    while (i2.hasNext()) {
      i2.next().value()->parentNetwork = &other;
    }

    emit networkModified(ControlNet::Swapped, other.GetNetworkId(), this->GetNetworkId());

  }


+21 −4
Original line number Diff line number Diff line
@@ -29,7 +29,10 @@
#include <QSharedPointer>
#include <QString>
#include <QMap>
#include <QVariant>
#include <QVector>
#include <QVariant>


// Boost includes
#include <boost/graph/graph_traits.hpp>
@@ -237,6 +240,14 @@ namespace Isis {
      friend class ControlMeasure;
      friend class ControlPoint;

      enum ModType {
        Cleared,
        PointAdded,
        PointDeleted,
        PointModified,
        Swapped
      };

    public:

      QList< ControlCubeGraphNode * > GetCubeGraphNodes() {
@@ -306,6 +317,7 @@ namespace Isis {
      QList< QString > GetPointIds() const;
      std::vector<Distance> GetTargetRadii();


      void SetCreatedDate(const QString &date);
      void SetDescription(const QString &newDescription);
      void SetImages(const QString &imageListFile);
@@ -332,6 +344,9 @@ namespace Isis {

    signals:
      void networkStructureModified();
      void pointModified(ControlPoint *point, int type, QVariant oldValue, QVariant newValue);
      void measureModified(ControlMeasure *measure, int type, QVariant oldValue, QVariant newValue);
      void networkModified(int type, QVariant oldValue, QVariant newValue);

    private:
      void nullify();
@@ -343,6 +358,8 @@ namespace Isis {
      void measureUnIgnored(ControlMeasure *measure);
      void UpdatePointReference(ControlPoint *point, QString oldId);
      void emitNetworkStructureModified();
      void emitMeasureModified(ControlMeasure *measure, int type, QVariant oldValue, QVariant newValue);
      void emitPointModified(ControlPoint *point, int type, QVariant oldValue, QVariant newValue);


    private: // graphing functions
+7 −1
Original line number Diff line number Diff line
@@ -12,7 +12,11 @@ namespace Isis {

  ControlNetVitals::ControlNetVitals(ControlNet *cnet) {
    m_controlNet = cnet;
    connect(cnet, SIGNAL(networkStructureModified()),
    connect(cnet, SIGNAL(networkModified(int, QVariant, QVariant)),
            this, SLOT(validate()));
    connect(cnet, SIGNAL(pointModified(ControlPoint *, int, QVariant, QVariant)),
            this, SLOT(validate()));
    connect(cnet, SIGNAL(measureModified(ControlMeasure *, int, QVariant, QVariant)),
            this, SLOT(validate()));
    validate();
  }
@@ -221,6 +225,7 @@ namespace Isis {
  // }

  void ControlNetVitals::validate() {
    std::cout << "Vital update was called" << std::endl;
    QString status = "";
    QString details = "";
    if (hasIslands()) {
@@ -255,6 +260,7 @@ namespace Isis {
  void ControlNetVitals::updateStatus(QString status, QString details) {
    m_status = status;
    m_statusDetails = details;
    std::cout << "Emitting a change" << std::endl;
    emit networkChanged();
  }

Loading