Commit feb0293d authored by Jeannie Backer's avatar Jeannie Backer Committed by Makayla Shepherd
Browse files

Removed unneeded accessors.

parent a81f320c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
./libisis3.5.2.so: undefined reference to `Isis::ControlMeasureLogData::ControlMeasureLogData(Isis::ControlNetLogDataProtoV0001_Point_Measure_DataEntry const&)'
./libisis3.5.2.so: undefined reference to `Isis::ControlMeasure::JigsawRejected() const'
./libisis3.5.2.so: undefined reference to `Isis::ControlMeasureLogData::ControlMeasureLogData(Isis::ControlPointFileEntryV0002_Measure_MeasureLogData const&)'
./libisis3.5.2.so: undefined reference to `Isis::ControlMeasure::LogSize() const'
collect2: error: ld returned 1 exit status
make[1]: *** [unitTest] Error 1
+1 −0
Original line number Diff line number Diff line
[2017-12-28 11:27:56]    Testing [ControlNetStatistics]                          /scratch/ISIS3/isis/make/isismake.objs:270: recipe for target 'unitTest' failed
+23 −87
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ namespace Isis {
   */
  void ControlMeasure::SetLogData(ControlMeasureLogData data) {
    if (!data.IsValid()) {
      IString msg = "Cannot set log data with invalid information stored in "
      QString msg = "Cannot set log data with invalid information stored in "
                    "the ControlMeasureLogData";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
@@ -516,8 +516,8 @@ namespace Isis {
    }

    if (!updated) {
      IString msg = "Unable to update the log data for [" +
          newLogData.DataTypeToName(newLogData.GetDataType()) + "] because this"
      QString msg = "Unable to update the log data for ["
                    + newLogData.DataTypeToName(newLogData.GetDataType()) + "] because this"
                    " control measure does not have log data for this value. Please use "
                    "SetLogData instead";
      throw IException(IException::Programmer, msg, _FILEINFO_);
@@ -670,8 +670,8 @@ namespace Isis {
    }

    if (!validField) {
      IString msg = "Cannot test IsStatisticallyRelevant on Measure Data ["
          + IString(field) + "]";
      QString msg = "Cannot test IsStatisticallyRelevant on Measure Data ["
                    + QString(field) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }

@@ -734,7 +734,7 @@ namespace Isis {

  QString ControlMeasure::GetPointId() const {
    if (parentPoint == NULL) {
      IString msg = "Measure has no containing point";
      QString msg = "Measure has no containing point";
      throw IException(IException::User, msg, _FILEINFO_);
    }

@@ -796,20 +796,26 @@ namespace Isis {

  //! One Getter to rule them all
  double ControlMeasure::GetMeasureData(QString data) const {
    if (data == "SampleResidual")
    if (data == "SampleResidual") {
      return p_sampleResidual;
    else if (data == "LineResidual")
    }
    else if (data == "LineResidual") {
      return p_lineResidual;
    else if (data == "Type")
    }
    else if (data == "Type") {
      return p_measureType;
    else if (data == "IsMeasured")
    }
    else if (data == "IsMeasured") {
      return IsMeasured();
    else if (data == "IsRegistered")
    }
    else if (data == "IsRegistered") {
      return IsRegistered();
    else if (data == "Ignore")
    }
    else if (data == "Ignore") {
      return p_ignore;
    }
    else {
      IString msg = data + " passed to GetMeasureData but is invalid";
      QString msg = data + " passed to GetMeasureData but is invalid";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
@@ -904,8 +910,7 @@ namespace Isis {
   */
  ControlMeasure::MeasureType ControlMeasure::StringToMeasureType(QString str) {

    IString err = "String [";
    err += IString(str) + "] can not be converted to a MeasureType";
    QString err = "String [" + str + "] can not be converted to a MeasureType";

    str = str.toLower();
    MeasureType measureType;
@@ -965,75 +970,6 @@ namespace Isis {
    return sPrintable;
  }

//???  //! Returns true if the ControlMeasure has a choosername
//???  bool ControlMeasure::HasChooserName() const {
//???    return !p_chooserName->isEmpty();
//???  }
//???
//???  //! Returns true if the ControlMeasure has a datetime
//???  bool ControlMeasure::HasDateTime() const {
//???    return !p_dateTime->isEmpty();
//???  }
//???
//???  //! Returns true if the ControlMeasure has a sample
//???  bool ControlMeasure::HasSample() const {
//???    return p_sample ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a line
//???  bool ControlMeasure::HasLine() const {
//???    return p_line ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a diameter
//???  bool ControlMeasure::HasDiameter() const {
//???    return p_diameter ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has apriorisample
//???  bool ControlMeasure::HasAprioriSample() const {
//???    return p_aprioriSample ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has aprioriline
//???  bool ControlMeasure::HasAprioriLine() const {
//???    return p_aprioriLine ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a sample sigma
//???  bool ControlMeasure::HasSampleSigma() const {
//???    return p_sampleSigma ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a line sigma
//???  bool ControlMeasure::HasLineSigma() const {
//???    return p_lineSigma ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a sample residual
//???  bool ControlMeasure::HasSampleResidual() const {
//???    return p_sampleResidual ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure has a line residual
//???  bool ControlMeasure::HasLineResidual() const {
//???    return p_lineResidual ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure's jigsaw rejected is initialized
//???  bool ControlMeasure::HasJigsawRejected() const {
//???    return p_jigsawRejected ? true : false;
//???  }
//???
//???  //! Returns true if the ControlMeasure is jigsaw rejected
//???  bool ControlMeasure::JigsawRejected() const {
//???    return p_jigsawRejected ? true : false;
//???  }
//???
//???  //! Returns the logsize of the ControlMeasure logged data.
//???  int ControlMeasure::LogSize() const {
//???    return p_loggedData->size();
//???  }

  /**
   * Obtain a string representation of the MeasureType
+95 −92
Original line number Diff line number Diff line
#include <iostream>
#include <float.h>

#include <QDebug>
#include <QList>
#include <QString>
#include <QStringList>
@@ -33,7 +34,7 @@ int main() {
  */
  Preference::Preferences(true);
  ControlMeasure m;
  cout << "Test 1 Default values" << endl;
  qDebug() << "Test 1 Default values";
  m.SetChooserName("ManuallySet");
  m.SetDateTime("2001-01-01T00:00:00");
  outit(m);
@@ -50,55 +51,53 @@ int main() {
  m.SetLineSigma(.21);
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");
  cout << "Test 2" << endl;
  qDebug() << "Test 2";
  outit(m);

  m.SetType(ControlMeasure::Candidate);
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");
  cout << "Test 3" << endl;
  qDebug() << "Test 3";
  outit(m);

  m.SetType(ControlMeasure::Manual);
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");
  m.SetEditLock(true);
  cout << "Test 4" << endl;
  qDebug() << "Test 4";
  outit(m);

  m.SetType(ControlMeasure::RegisteredPixel);
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");
  m.SetEditLock(false);
  cout << "Test 5" << endl;
  qDebug() << "Test 5";
  outit(m);

  m.SetType(ControlMeasure::RegisteredSubPixel);
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");
  cout << "Test 6" << endl;
  qDebug() << "Test 6";
  outit(m);

  m.SetLogData(
    ControlMeasureLogData(ControlMeasureLogData::GoodnessOfFit, 5.0)
  );
  m.SetLogData(ControlMeasureLogData(ControlMeasureLogData::GoodnessOfFit, 5.0));
  m.SetChooserName("Bob");
  m.SetDateTime("2005-05-03T00:00:00");

  // Dump of all variables
  cout << "Test 7" << endl;
  qDebug() << "Test 7";
  QList< QStringList > printableMeasureData = m.PrintableClassData();
  QStringList nameValuePair;
  foreach(nameValuePair, printableMeasureData) {
    cout << nameValuePair.at(0).toStdString() << "=" <<
        nameValuePair.at(1).toStdString() << endl;
    qDebug() << nameValuePair.at(0).toStdString() << "=" <<
        nameValuePair.at(1).toStdString();
  }

  cout << "Test 8" << endl;
  cout << m.GetLogData(ControlMeasureLogData::GoodnessOfFit).
      GetNumericalValue() << endl;
  cout << m.GetLogValue(ControlMeasureLogData::GoodnessOfFit).
      toDouble() << endl;
  qDebug() << "Test 8";
  qDebug() << m.GetLogData(ControlMeasureLogData::GoodnessOfFit).
      GetNumericalValue();
  qDebug() << m.GetLogValue(ControlMeasureLogData::GoodnessOfFit).
      toDouble();

  // Test parent editLock on reference measure
  ControlPoint *cp = new ControlPoint("Parent1");
@@ -113,51 +112,56 @@ int main() {
  cp->Add(&m2);
  cp->SetRefMeasure(&m2);
  cp->SetEditLock(true);
  cout << endl << "Test 9" << endl;
  cout << "Testing point editLock on reference measure" << endl;
  qDebug() << "";
  qDebug() << "Test 9";
  qDebug() << "Testing point editLock on reference measure";
  if (m2.IsEditLocked())
    cout << "Reference point ok" << endl;
    qDebug() << "Reference point ok";
  else
    cout << "Reference point failed" << endl;
    qDebug() << "Reference point failed";
  if (m.IsEditLocked())
    cout << "Nonreference point failed" << endl;
    qDebug() << "Nonreference point failed";
  else
    cout << "Nonreference point ok" << endl;
    qDebug() << "Nonreference point ok";

  cout << endl << "Test 10" << endl;
  cout << "Testing == operator on the same measures" << endl;
  qDebug() << "";
  qDebug() << "Test 10";
  qDebug() << "Testing == operator on the same measures";
  if (m == m) {
    cout << "Measure1 == Measure1   TRUE" << endl;
    qDebug() << "Measure1 == Measure1   TRUE";
  }
  else {
    cout << "Measure1 == Measure1   FALSE" << endl;
    qDebug() << "Measure1 == Measure1   FALSE";
  }

  cout << endl << "Test 11" << endl;
  cout << "Testing == operator on two different measures" << endl;
  qDebug() << "";
  qDebug() << "Test 11";
  qDebug() << "Testing == operator on two different measures";
  if (m == m2) {
    cout << "Measure1 == Measure2   TRUE" << endl;
    qDebug() << "Measure1 == Measure2   TRUE";
  }
  else {
    cout << "Measure1 == Measure2   FALSE" << endl;
    qDebug() << "Measure1 == Measure2   FALSE";
  }

  cout << endl << "Test 12" << endl;
  cout << "Testing != operator on the same measures" << endl;
  qDebug() << "";
  qDebug() << "Test 12";
  qDebug() << "Testing != operator on the same measures";
  if (m != m) {
    cout << "Measure1 != Measure1   TRUE" << endl;
    qDebug() << "Measure1 != Measure1   TRUE";
  }
  else {
    cout << "Measure1 != Measure1   FALSE" << endl;
    qDebug() << "Measure1 != Measure1   FALSE";
  }

  cout << endl << "Test 13" << endl;
  cout << "Testing != operator on two different measures" << endl;
  qDebug() << "";
  qDebug() << "Test 13";
  qDebug() << "Testing != operator on two different measures";
  if (m != m2) {
    cout << "Measure1 != Measure2   TRUE" << endl;
    qDebug() << "Measure1 != Measure2   TRUE";
  }
  else {
    cout << "Measure1 != Measure2   FALSE" << endl;
    qDebug() << "Measure1 != Measure2   FALSE";
  }


@@ -168,63 +172,63 @@ int main() {
    e.print();
  }

  cout << endl; 
  cout << "Test 14: Testing accessor methods" << endl; 

  if (m.HasChooserName()) {
    cout << "Chooser Name: " << m.GetChooserName() << endl;
  }

  if (m.HasDateTime()) {
    cout << "DateTime: " << m.GetDateTime() << endl; 
  }

  if (m.HasSample()) {
    cout << "Sample: " << m.GetSample() << endl; 
  }

  if (m.HasLine()) {
    cout << "Line: " << m.GetLine() << endl; 
  }

  if (m.HasDiameter()) {
    cout << "Diameter: " << m.GetDiameter() << endl; 
  }

  if (m.HasAprioriSample()) {
    cout << "AprioriSample: " << m.GetAprioriSample() << endl; 
  }

  if (m.HasAprioriLine()) {
    cout << "AprioriLine: " << m.GetAprioriLine() << endl; 
  }

  if (m.HasSampleSigma()) {
    cout << "SampleSigma: " << m.GetSampleSigma() << endl; 
  }

  if (m.HasLineSigma()) {
    cout << "LineSigma: " << m.GetLineSigma() << endl; 
  }

  if (m.HasSampleResidual()) {
    cout << "SampleResidual: " << m.GetSampleResidual() << endl; 
  }

  if (m.HasLineResidual()) {
    cout << "LineResidual: " << m.GetLineResidual() << endl; 
  }

  if (m.HasJigsawRejected()) {
  qDebug(); 
  qDebug() << "Test 14: Testing accessor methods"; 

//  if (m.HasChooserName()) {
//    qDebug() << "Chooser Name: " << m.GetChooserName();
//  }
//
//  if (m.HasDateTime()) {
//    qDebug() << "DateTime: " << m.GetDateTime(); 
//  }
//
//  if (m.HasSample()) {
//    qDebug() << "Sample: " << m.GetSample(); 
//  }
//
//  if (m.HasLine()) {
//    qDebug() << "Line: " << m.GetLine(); 
//  }
//
//  if (m.HasDiameter()) {
//    qDebug() << "Diameter: " << m.GetDiameter(); 
//  }
//
//  if (m.HasAprioriSample()) {
//    qDebug() << "AprioriSample: " << m.GetAprioriSample(); 
//  }
//
//  if (m.HasAprioriLine()) {
//    qDebug() << "AprioriLine: " << m.GetAprioriLine(); 
//  }
//
//  if (m.HasSampleSigma()) {
//    qDebug() << "SampleSigma: " << m.GetSampleSigma(); 
//  }
//
//  if (m.HasLineSigma()) {
//    qDebug() << "LineSigma: " << m.GetLineSigma(); 
//  }
//
//  if (m.HasSampleResidual()) {
//    qDebug() << "SampleResidual: " << m.GetSampleResidual(); 
//  }
//
//  if (m.HasLineResidual()) {
//    qDebug() << "LineResidual: " << m.GetLineResidual(); 
//  }
//
  if (m.IsRejected()) {
    if (m.JigsawRejected()) {
      cout << "Measure was rejected by Jigsaw." << endl; 
      qDebug() << "Measure was rejected by Jigsaw."; 
    }
    else {
      cout << "Measure was not rejected by Jigsaw." << endl; 
      qDebug() << "Measure was not rejected by Jigsaw."; 
    }
  }

  cout << "Log Size: " << m.LogSize() << endl; 
  qDebug() << "Log Size: " << m.LogSize(); 
}

void outit(ControlMeasure &m) {
@@ -240,7 +244,6 @@ void outit(ControlMeasure &m) {
  net.SetModifiedDate("Yesterday");
  net.Write("./tmp.net", true);
  Pvl tmp("./tmp.net");
  cout << "Printing measure:\n" << tmp << "\nDone printing measure." << endl
       << endl;
  qDebug() << "Printing measure:\n" << tmp << "\nDone printing measure.";
  remove("./tmp.net");
}
+54 −51
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "PvlGroup.h"
#include "PvlKeyword.h"
#include "PvlObject.h"
#include "SpecialPixel.h"
#include "SurfacePoint.h"
#include "Target.h"

@@ -430,11 +431,11 @@ namespace Isis {
            break;
        }

        if ( controlMeasure.HasChooserName() ) {
        if ( !controlMeasure.GetChooserName().isEmpty() ) {
          pvlMeasure += PvlKeyword("ChooserName", controlMeasure.GetChooserName());
        }

        if ( controlMeasure.HasDateTime() ) {
        if ( !controlMeasure.GetDateTime().isEmpty() ) {
          pvlMeasure += PvlKeyword("DateTime", controlMeasure.GetDateTime());
        }

@@ -446,48 +447,50 @@ namespace Isis {
          pvlMeasure += PvlKeyword("Ignore", "True");
        }

        if ( controlMeasure.HasSample() ) {
        if ( controlMeasure.GetSample() != 0.0 ) {
          pvlMeasure += PvlKeyword("Sample", toString(controlMeasure.GetSample()));

        }

        if ( controlMeasure.HasLine() ) {
        if ( controlMeasure.GetLine() != 0.0 ) {
          pvlMeasure += PvlKeyword("Line", toString(controlMeasure.GetLine()));
        }

        if ( controlMeasure.HasDiameter() ) {
        if ( controlMeasure.GetDiameter() != Isis::Null ) {
          pvlMeasure += PvlKeyword("Diameter", toString(controlMeasure.GetDiameter()));
        }

        if ( controlMeasure.HasAprioriSample() ) {
        if ( controlMeasure.GetAprioriSample() != Isis::Null ) {
          pvlMeasure += PvlKeyword("AprioriSample", toString(controlMeasure.GetAprioriSample()));
        }

        if ( controlMeasure.HasAprioriLine() ) {
        if ( controlMeasure.GetAprioriLine() != Isis::Null ) {
          pvlMeasure += PvlKeyword("AprioriLine", toString(controlMeasure.GetAprioriLine()));
        }

        if ( controlMeasure.HasSampleSigma() ) {
        if ( controlMeasure.GetSampleSigma() != Isis::Null ) {
          pvlMeasure += PvlKeyword("SampleSigma", toString(controlMeasure.GetSampleSigma()),
                                   "pixels");
        }

        if ( controlMeasure.HasLineSigma() ) {
        if ( controlMeasure.GetLineSigma() != Isis::Null ) {
          pvlMeasure += PvlKeyword("LineSigma", toString(controlMeasure.GetLineSigma()),
                                   "pixels");
        }

        if ( controlMeasure.HasSampleResidual() ) {
        if ( controlMeasure.GetSampleResidual() != Isis::Null ) {
          pvlMeasure += PvlKeyword("SampleResidual", toString(controlMeasure.GetSampleResidual()),
                                   "pixels");
        }

        if ( controlMeasure.HasLineResidual() ) {
        if ( controlMeasure.GetLineResidual() != Isis::Null ) {
          pvlMeasure += PvlKeyword("LineResidual", toString(controlMeasure.GetLineResidual()),
                                   "pixels");
        }

        if ( controlMeasure.IsRejected() ) {
          pvlMeasure += PvlKeyword("JigsawRejected", toString(controlMeasure.JigsawRejected()));
        }

        for (int logEntry = 0;
            logEntry < controlMeasure.LogSize(); // DNE?
@@ -1832,11 +1835,11 @@ namespace Isis {
                break;
        }

        if ( controlMeasure.HasChooserName() ) {
        if ( !controlMeasure.GetChooserName().isEmpty() ) {
          protoMeasure.set_choosername(controlMeasure.GetChooserName().toLatin1().data());
        }

        if ( controlMeasure.HasDateTime() ) {
        if ( !controlMeasure.GetDateTime().isEmpty() ) {
          protoMeasure.set_datetime(controlMeasure.GetDateTime().toLatin1().data());
        }

@@ -1852,39 +1855,39 @@ namespace Isis {
          protoMeasure.set_jigsawrejected(true);
        }

        if ( controlMeasure.HasSample() ) {
        if ( controlMeasure.GetSample() != 0.0 ) {
          protoMeasure.set_sample(controlMeasure.GetSample());
        }

        if ( controlMeasure.HasLine() ) {
        if ( controlMeasure.GetLine() != 0.0 ) {
          protoMeasure.set_line(controlMeasure.GetLine());
        }

        if ( controlMeasure.HasDiameter() ) {
        if ( controlMeasure.GetDiameter() != Isis::Null ) {
          protoMeasure.set_diameter(controlMeasure.GetDiameter());
        }

        if ( controlMeasure.HasAprioriSample() ) {
        if ( controlMeasure.GetAprioriSample() != Isis::Null ) {
          protoMeasure.set_apriorisample(controlMeasure.GetAprioriSample());
        }

        if ( controlMeasure.HasAprioriLine() ) {
        if ( controlMeasure.GetAprioriLine() != Isis::Null ) {
          protoMeasure.set_aprioriline(controlMeasure.GetAprioriLine());
        }

        if ( controlMeasure.HasSampleSigma() ) {
        if ( controlMeasure.GetSampleSigma() != Isis::Null ) {
          protoMeasure.set_samplesigma(controlMeasure.GetSampleSigma());
        }

        if ( controlMeasure.HasLineSigma() ) {
        if ( controlMeasure.GetLineSigma() != Isis::Null ) {
          protoMeasure.set_linesigma(controlMeasure.GetLineSigma());
        }

        if ( controlMeasure.HasSampleResidual() ) {
        if ( controlMeasure.GetSampleResidual() != Isis::Null ) {
          protoMeasure.set_sampleresidual(controlMeasure.GetSampleResidual());
        }

        if ( controlMeasure.HasLineResidual() ) {
        if ( controlMeasure.GetLineResidual() != Isis::Null ) {
          protoMeasure.set_lineresidual(controlMeasure.GetLineResidual());
        }

Loading