Unverified Commit 02be8255 authored by kledmundson's avatar kledmundson Committed by GitHub
Browse files

Merge pull request #92 from dcookastro/LroLidar_Infrastructure

Lro lidar infrastructure
parents 14736ae0 8514cf16
Loading
Loading
Loading
Loading
+26 −11
Original line number Diff line number Diff line
@@ -214,6 +214,18 @@ namespace Isis {
                                                 Longitude(longitude, Angle::Units::Degrees),
                                                 Distance(radius, Distance::Units::Kilometers)));

        if (pointObject.contains("simultaneousImages") &&
                                 pointObject["simultaneousImages"].isArray()) {
          QJsonArray simultaneousArray =
                pointObject["simultaneousImages"].toArray();
           
              for (int simIndex = 0; simIndex < simultaneousArray.size(); simIndex ++) {
                QString newSerial;
                // Unserialize each simultaneous image serial number
                newSerial =  simultaneousArray[simIndex].toString();
                lcp->addSimultaneous(newSerial);
              }              
        }
        
        // Unserialize ControlMeasures
        if (pointObject.contains("measures") && pointObject["measures"].isArray()) {
@@ -237,17 +249,15 @@ namespace Isis {
              serialNumber = measureObject["serialNumber"].toString();
            }

            QString type;
            if (measureObject.contains("type") && measureObject["type"].isString()) {
              type = measureObject["type"].toString();
            }
            // QString type;
            // if (measureObject.contains("type") && measureObject["type"].isString()) {
            //   type = measureObject["type"].toString();
            // }

            ControlMeasure *measure = new ControlMeasure();
            measure->SetCoordinate(sample, line);
            measure->SetCubeSerialNumber(serialNumber);
            measure->SetType(measure->StringToMeasureType(type));
            // std::cout << "InLidarData read type was set to " <<
            //   measure->StringToMeasureType(type) << std::endl;
            // measure->SetType(measure->StringToMeasureType(type));
            lcp->Add(measure);
          }
        }
@@ -301,6 +311,13 @@ namespace Isis {
      pointObject["longitude"] = aprioriSurfacePoint.GetLongitude().positiveEast(Angle::Units::Degrees);
      pointObject["radius"] = aprioriSurfacePoint.GetLocalRadius().kilometers();
      
      // Serialize the list of simultaneous images
     QJsonArray simultaneousArray;
      foreach (QString sn, lcp->snSimultaneous()) {
        simultaneousArray.append(sn);
      }
      pointObject["simultaneousImages"] = simultaneousArray;

      QJsonArray measureArray;
      // Serialize the ControlMeasures it contains
      foreach (ControlMeasure *measure, lcp->getMeasures()) {
@@ -309,9 +326,7 @@ namespace Isis {
        measureObject["line"] = measure->GetLine();
        measureObject["sample"] = measure->GetSample();
        measureObject["serialNumber"] = measure->GetCubeSerialNumber();
        measureObject["type"] = measure->GetMeasureTypeString();
        // std::cout << "InLidarData output measure type was set to "
        //           << measure->GetMeasureTypeString() << std::endl;
        // measureObject["type"] = measure->GetMeasureTypeString();
        measureArray.append(measureObject);

      }
+0 −6
Original line number Diff line number Diff line
@@ -942,8 +942,6 @@ namespace Isis {
      measureType = ControlMeasure::RegisteredPixel;
    else if (str == "registeredsubpixel")
      measureType = ControlMeasure::RegisteredSubPixel;
    else if (str == "lidar")
      measureType = ControlMeasure::Lidar;
    else
      throw IException(IException::Programmer, err, _FILEINFO_);

@@ -981,10 +979,6 @@ namespace Isis {
      case ControlMeasure::RegisteredSubPixel:
        sPrintable = "RegisteredSubPixel";
        break;

      case ControlMeasure::Lidar:
        sPrintable = "Lidar";
        break;
    }

    if (sPrintable == "") {
+0 −3
Original line number Diff line number Diff line
@@ -175,7 +175,6 @@ namespace Isis {
   *   @history 2018-01-05 Adam Goins - Added HasDateTime() and HasChooserName() methods to allow
   *                           to allow the value of these variables to be read without being
   *                           overriden if they're empty. (Getters override if they're empty).
   *   @history 2018-02-14 Debbie A. Cook - Added Lidar measure type.
   */
  class ControlMeasure : public QObject {

@@ -218,8 +217,6 @@ namespace Isis {
        RegisteredPixel,
        //! Registered to sub-pixel (e.g., pointreg)
        RegisteredSubPixel,
        //! Backprojected from Lidar point to simultaneous image
        Lidar,
      };

      enum Status {
+29 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ namespace Isis {
    m_time = iTime();
    m_range = -1.0;
    m_sigmaRange = -1.0;
    m_snSimultaneous = NULL;

    m_snSimultaneous = new QStringList;
  }
  
  
@@ -28,6 +31,11 @@ namespace Isis {
   * Destructor
   */
  LidarControlPoint::~LidarControlPoint() {
    if (m_snSimultaneous) {
      delete m_snSimultaneous;
      m_snSimultaneous = NULL;
    }
    
  }
  
  
@@ -73,6 +81,17 @@ namespace Isis {
  }
  
  
  /**
   * Add a measure to the list of simultaneous images of a  LidarControlPoint
   * 
   * @param time The serial number of the simultaneous image to add
   */
  ControlPoint::Status LidarControlPoint::addSimultaneous(QString newSerial) {
    m_snSimultaneous->append(newSerial);
    return ControlPoint::Status::Success;
  }
  
  
  /**
   * Returns the range of the point
   * 
@@ -101,4 +120,14 @@ namespace Isis {
  double LidarControlPoint::sigmaRange() {
    return m_sigmaRange;
  }
  
  
  /**
   * Returns the list of serial numbers of simultaneous images of the Lidar point
   * 
   * @return QList The list of serial numbers
   */
  QList < QString > LidarControlPoint::snSimultaneous() const{
    return *m_snSimultaneous;
  }
}
+4 −0
Original line number Diff line number Diff line
@@ -55,15 +55,19 @@ namespace Isis {
    ControlPoint::Status setRange(double range);
    ControlPoint::Status setSigmaRange(double sigmaRange);
    ControlPoint::Status setTime(iTime time);
    ControlPoint::Status addSimultaneous(QString newSerial);
    
    double range();
    double sigmaRange();
    iTime time();
    QList < QString > snSimultaneous() const;
    
  private:
    double m_range;       //!< The range
    double m_sigmaRange;  //!< The sigma range
    iTime m_time;         //!< The time the lidar point was taken
    QStringList *m_snSimultaneous;  //!< Serial number(s) of
    //!                                                               simultaneous image(s)
    
  };

Loading