Commit 00ef12a7 authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Updated documentation for SensorInfoWidget, TargetBodyList, and...

Updated documentation for SensorInfoWidget, TargetBodyList, and TargetInfoWidget in preparation for merge from IPCE into ISIS.  Fixes #4007, #4065

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6840 41f8697f-d340-4b68-9986-7bafba869bb8
parent 61f83db4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -11,6 +11,13 @@

namespace Isis {

  /**
   * Constructor
   * 
   * @param camera The camera whose information is being displayed
   * @param directory unused
   * @param parent The parent widget
   */
  SensorInfoWidget::SensorInfoWidget(GuiCamera* camera, Directory *directory,
                                     QWidget *parent) : m_ui(new Ui::SensorInfoWidget) {
    m_ui->setupUi(this);
@@ -59,6 +66,9 @@ namespace Isis {
  }


  /**
   * Destructor
   */
  SensorInfoWidget::~SensorInfoWidget() {
    delete m_ui;
  }
+4 −4
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ namespace Isis {
  class Directory;

  /**
   * @brief
   * @brief Widget for displaying information about a sensor
   *
   * @ingroup ControlNetworks
   *
@@ -31,14 +31,14 @@ namespace Isis {
      ~SensorInfoWidget();

    private:
      Ui::SensorInfoWidget *m_ui;
      Ui::SensorInfoWidget *m_ui; //!< The widget ui

//      QString formatPoleRaString();
//      QString formatPoleDecString();
//      QString formatPmString();

      Directory *m_directory;
      GuiCamera *m_camera;
      Directory *m_directory; //!< Unused
      GuiCamera *m_camera; //!< The sensor whose information is being displayed
  };
}

+165 −26
Original line number Diff line number Diff line
@@ -124,6 +124,10 @@ namespace Isis {


  /**
   * Appends a TargetBody to the list.
   * 
   * @param value The TargetBody to append
   * 
   * @see QList<TargetBodyQsp>::append()
   */
  void TargetBodyList::append(TargetBodyQsp const &value) {
@@ -133,6 +137,10 @@ namespace Isis {


  /**
   * Appends a TargetBodyList to the list.
   * 
   * @param value the TargetBodyList to append
   * 
   * @see QList<TargetBodyQsp>::append()
   */
  void TargetBodyList::append(const QList<TargetBodyQsp> &value) {
@@ -142,6 +150,8 @@ namespace Isis {


  /**
   * clears the list.
   * 
   * @see QList<TargetBodyQsp>::clear()
   */
  void TargetBodyList::clear() {
@@ -154,6 +164,10 @@ namespace Isis {


  /**
   * Erases the TargetBody associated with an iterator.
   * 
   * @param pos An iterator associated with the TaretBody to be erased
   * 
   * @see QList<TargetBodyQsp>::erase()
   */
  QList<TargetBodyQsp>::iterator TargetBodyList::erase(iterator pos) {
@@ -164,6 +178,15 @@ namespace Isis {


  /**
   * Erases all TargetBodies starting with the TargetBody associated with begin up to,
   * but not including, the TargetBody associated with end.
   * 
   * @param begin An iterator associated with the first TargetBody to be erased.
   * @param end An iterator associated with the TargetBody after the last TargetBody to be erased
   * 
   * @return @b QList<TargetBodyQsp>::iterator An iterator associated with the TargetBody
   *                                               end was associated with before erasing.
   * 
   * @see QList<TargetBodyQsp>::erase()
   */
  QList<TargetBodyQsp>::iterator TargetBodyList::erase(iterator begin, iterator end) {
@@ -174,6 +197,11 @@ namespace Isis {


  /**
   * Inserts a TargetBody at a specific index.
   * 
   * @param i The index at which to insert the TargetBody
   * @param value The TargetBody to insert
   * 
   * @see QList<TargetBodyQsp>::insert()
   */
  void TargetBodyList::insert(int i, TargetBodyQsp const &value) {
@@ -184,6 +212,14 @@ namespace Isis {


  /**
   * Inserts a TargetBody after the TargetBody associated with an iterator.
   * 
   * @param before An iterator associated with the TargetBody that will be before
   *                   the inserted TargetBody
   * @param value The TargetBody to be inserted
   * 
   * @return @b QList<TargetBodyQsp>::iterator An iterator associated with the inserted TargetBody
   * 
   * @see QList<TargetBodyQsp>::insert()
   */
  QList<TargetBodyQsp>::iterator TargetBodyList::insert(iterator before, TargetBodyQsp const &value) {
@@ -194,6 +230,10 @@ namespace Isis {


  /**
   * Inserts a TargetBody at the front of the list
   * 
   * @param value the TargetBody to be inserted
   * 
   * @see QList<TargetBodyQsp>::prepend()
   */
  void TargetBodyList::prepend(TargetBodyQsp const &value) {
@@ -203,6 +243,10 @@ namespace Isis {


  /**
   * Appends a TargetBody to the end of the list
   * 
   * @param value The TargetBody to be append
   * 
   * @see QList<TargetBodyQsp>::push_back()
   */
  void TargetBodyList::push_back(TargetBodyQsp const &value) {
@@ -212,6 +256,10 @@ namespace Isis {


  /**
   * Insertes a TargetBody at the front of the list
   * 
   * @param value The TargetBody to be prepend
   * 
   * @see QList<TargetBodyQsp>::push_front()
   */
  void TargetBodyList::push_front(TargetBodyQsp const &value) {
@@ -221,6 +269,12 @@ namespace Isis {


  /**
   * Removes all occurrences of a TargetBody and returns the number removed.
   * 
   * @param value The TargetBody to be removed.
   * 
   * @return @b int The Number of TargetBodies removed.
   * 
   * @see QList<TargetBodyQsp>::removeAll()
   */
  int TargetBodyList::removeAll(TargetBodyQsp const &value) {
@@ -235,6 +289,10 @@ namespace Isis {


  /**
   * Removes the TargetBody at a specific index.
   * 
   * @param i The index of the TargetBody to be removed
   * 
   * @see QList<TargetBodyQsp>::removeAt()
   */
  void TargetBodyList::removeAt(int i) {
@@ -244,6 +302,8 @@ namespace Isis {


  /**
   * Removes the first TargetBody from the list.
   * 
   * @see QList<TargetBodyQsp>::removeFirst()
   */
  void TargetBodyList::removeFirst() {
@@ -253,6 +313,8 @@ namespace Isis {


  /**
   * Removes the last TargetBody from the list.
   * 
   * @see QList<TargetBodyQsp>::removeLast()
   */
  void TargetBodyList::removeLast() {
@@ -262,6 +324,12 @@ namespace Isis {


  /**
   * Removes the first occurrence of a TargetBody from the list.
   * 
   * @param value the TargetBody to be removed
   * 
   * @return @b bool If the removal was successful
   * 
   * @see QList<TargetBodyQsp>::removeOne()
   */
  bool TargetBodyList::removeOne(TargetBodyQsp const &value) {
@@ -276,6 +344,10 @@ namespace Isis {


  /**
   * Swaps the list with another TargetBodyList.
   * 
   * @param other The TargetBodyList to swap with
   * 
   * @see QList<TargetBodyQsp>::swap()
   */
  void TargetBodyList::swap(QList<TargetBodyQsp> &other) {
@@ -288,6 +360,12 @@ namespace Isis {


  /**
   * Removes and returns the TargetBody at a specific index.
   * 
   * @param i The index of the TargetBody to takeAt
   * 
   * @return @b TargetBodyQsp The removed TargetBody
   * 
   * @see QList<TargetBodyQsp>::takeAt()
   */
  TargetBodyQsp TargetBodyList::takeAt(int i) {
@@ -298,6 +376,10 @@ namespace Isis {


  /**
   * Removes and returns the first TargetBody in the list.
   * 
   * @return @b TargetBodyQsp The first TargetBody in the list
   * 
   * @see QList<TargetBodyQsp>::takeFirst()
   */
  TargetBodyQsp TargetBodyList::takeFirst() {
@@ -308,6 +390,10 @@ namespace Isis {


  /**
   * Removes and returns the last TargetBody in the list.
   * 
   * @return @b TargetBodyQsp The last TargetBody in the list.
   * 
   * @see QList<TargetBodyQsp>::takeLast()
   */
  TargetBodyQsp TargetBodyList::takeLast() {
@@ -318,6 +404,12 @@ namespace Isis {


  /**
   * Appends another TargetBodyList to the list.
   * 
   * @param other The TargetBodyList to be appended
   * 
   * @return @b TargetBodyList & A reference to this list.
   * 
   * @see QList<TargetBodyQsp>::operator+=()
   */
  TargetBodyList &TargetBodyList::operator+=(const QList<TargetBodyQsp> &other) {
@@ -332,6 +424,12 @@ namespace Isis {


  /**
   * Appends a TargetBody to the list.
   * 
   * @param other The TargetBody to be appended
   * 
   * @return @b TargetBodyList & A reference to this list.
   * 
   * @see QList<TargetBodyQsp>::operator+=()
   */
  TargetBodyList &TargetBodyList::operator+=(TargetBodyQsp const &other) {
@@ -342,6 +440,12 @@ namespace Isis {


  /**
   * Appends another TargetBodyList to the list.
   * 
   * @param other The TargetBodyList to be appended
   * 
   * @return @b TargetBodyList & A reference to this list.
   * 
   * @see QList<TargetBodyQsp>::operator<<()
   */
  TargetBodyList &TargetBodyList::operator<<(const QList<TargetBodyQsp> &other) {
@@ -356,6 +460,12 @@ namespace Isis {


  /**
   * Appends a TargetBody to the list.
   * 
   * @param other The TargetBody to be appended
   * 
   * @return @b TargetBodyList & A reference to this list.
   * 
   * @see QList<TargetBodyQsp>::operator<<()
   */
  TargetBodyList &TargetBodyList::operator<<(TargetBodyQsp const &other) {
@@ -366,6 +476,12 @@ namespace Isis {


  /**
   * Assignment operator for a QList of TargetBodyQsp
   * 
   * @param rhs The right hand side of the '=' operator
   * 
   * @return @b TargetBodyList & A reference to this list
   * 
   * @see QList<TargetBodyQsp>::operator=()
   */
  TargetBodyList &TargetBodyList::operator=(const QList<TargetBodyQsp> &rhs) {
@@ -384,7 +500,8 @@ namespace Isis {
   * Assignment operator
   *
   * @param rhs The right hand side of the '=' operator
   * @return *this
   * 
   * @return @b TargetBodyList & A reference to this list
   */
  TargetBodyList &TargetBodyList::operator=(const TargetBodyList &rhs) {
    bool countChanging = (rhs.count() != count());
@@ -563,7 +680,7 @@ namespace Isis {
  /**
   * Get the human-readable name of this target body list
   *
   * @return The name of the target body list (or an empty string if anonymous).
   * @return @b QString The name of the target body list (or an empty string if anonymous).
   */
  QString TargetBodyList::name() const {
    return m_name;
@@ -574,7 +691,8 @@ namespace Isis {
   * Get the path to these target body objects in the list (relative to project root). This only
   *  applies to a target body list from the project.
   *
   * @return The path to the target body objects in the list (or an empty string if unknown).
   * @return @b QString The path to the target body objects in the list
   *                        (or an empty string if unknown).
   */
  QString TargetBodyList::path() const {
    return m_path;
@@ -614,6 +732,10 @@ namespace Isis {
   *     ...
   *   </targets>
   * </pre>
   * 
   * @param stream The QXmlStreamWriter that will be used to convert the TargetBodyList
   * @param project The Project the TargetBodyList belongs to
   * @param newProjectRoot The root of the project folder where the TargetBodyList will be saved
   */
  void TargetBodyList::save(QXmlStreamWriter &stream, const Project *project,
                            FileName newProjectRoot) const {
@@ -694,7 +816,8 @@ namespace Isis {
//  }


//  TargetBodyList::CopyTargetBodyDataFunctor::CopyTargetBodyDataFunctor(const CopyTargetBodyDataFunctor &other) {
//  TargetBodyList::CopyTargetBodyDataFunctor::CopyTargetBodyDataFunctor(
//                  const CopyTargetBodyDataFunctor &other) {
//    m_project = other.m_project;
//    m_newProjectRoot = other.m_newProjectRoot;
//  }
@@ -757,13 +880,20 @@ namespace Isis {


  /**
   * Handle an XML start element. This expects <TargetBodyList/> and <target/> elements (it reads both
   *   the project XML and the targets.xml file).
   * Handle an XML start element. This expects <TargetBodyList/> and <target/> elements
   *   (it reads both the project XML and the targets.xml file).
   * 
   * @return If we should continue reading the XML (usually true).
   * @param namespaceURI ???
   * @param localName The name of the element the XmlReader is at
   * @param qName ???
   * @param atts The attributes of the element the XmlReader is at
   *
   * @return @b bool If we should continue reading the XML (usually true).
   */
  bool TargetBodyList::XmlHandler::startElement(const QString &namespaceURI, const QString &localName,
                                           const QString &qName, const QXmlAttributes &atts) {
  bool TargetBodyList::XmlHandler::startElement(const QString &namespaceURI,
                                                const QString &localName,
                                                const QString &qName,
                                                const QXmlAttributes &atts) {
    if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
      if (localName == "TargetBodyList") {
        QString name = atts.value("name");
@@ -778,7 +908,8 @@ namespace Isis {
        }
      }
      else if (localName == "target") {
//        m_TargetBodyList->append(TargetBodyQsp(new TargetBody(m_project->targetBodyRoot() + "/" + m_TargetBodyList->path(),
//        m_TargetBodyList->append(TargetBodyQsp(new TargetBody(m_project->targetBodyRoot()
//                                           + "/" + m_TargetBodyList->path(),
//                                           reader())));
      }
    }
@@ -788,12 +919,20 @@ namespace Isis {


  /**
   * Handle an XML end element. This handles <TargetBodyList /> by opening and reading the images.xml
   *   file.
   * Handle an XML end element. This handles <TargetBodyList /> by opening and reading the
   *   images.xml file.
   * 
   * @param namespaceURI ???
   * @param localName The name of the element the XmlReader is at
   * @param qName ???
   *
   * @return @b bool If we should continue reading the XML (usually true).
   * 
   * @return If we should continue reading the XML (usually true).
   * @throws IException::Io "Unable to open with read access"
   * @throws IException::Io "Failed to open target body list XML"
   */
  bool TargetBodyList::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
  bool TargetBodyList::XmlHandler::endElement(const QString &namespaceURI,
                                              const QString &localName,
                                              const QString &qName) {
    if (localName == "TargetBodyList") {
      XmlHandler handler(m_TargetBodyList, m_project);
@@ -802,8 +941,8 @@ namespace Isis {
      reader.pushContentHandler(&handler);
      reader.setErrorHandler(&handler);

      QString TargetBodyListXmlPath = m_project->targetBodyRoot() + "/" + m_TargetBodyList->path() +
                                 "/targets.xml";
      QString TargetBodyListXmlPath = m_project->targetBodyRoot() + "/" + 
                                m_TargetBodyList->path() + "/targets.xml";
      QFile file(TargetBodyListXmlPath);

      if (!file.open(QFile::ReadOnly)) {
+23 −16
Original line number Diff line number Diff line
@@ -20,10 +20,15 @@ namespace Isis {
  class XmlStackedHandlerReader;

  /**
   * List for holding TargetBodies.  Overrides several QList methods in order to emit
   * signals about the list changing.  TargetBodies are stored as QSharedPointer<TargetBody>.
   * 
   * @author 2015-06-11 Ken Edmundson
   *
   * @internal 
   *   @history 2015-06-11 Ken Edmundson - original version
   *   @history 2016-06-17 Jesse Mapel - Updated documentation before merging from IPCE into ISIS.
   *                           Fixes #4007.
   */
  class TargetBodyList : public QObject, public QList<TargetBodyQsp> {
    Q_OBJECT
@@ -95,6 +100,8 @@ namespace Isis {

    private:
      /**
       * XmlReader for working with TargetBody XML files
       * 
       * @author 2012-07-01 Steven Lambright
       *
       * @internal
@@ -111,15 +118,15 @@ namespace Isis {
        private:
          Q_DISABLE_COPY(XmlHandler);

          TargetBodyList *m_TargetBodyList;
          Project *m_project;
          TargetBodyList *m_TargetBodyList; //!< The TargetBodyList to read into/save from
          Project *m_project; //!< The project that contains the TargetBodies
      };


      /**
       * This functor is used for copying the TargetBody objects between two projects quickly. This is designed
       *   to work with QtConcurrentMap, though the results are all NULL (QtConcurrentMap is much
       *   faster than many QtConcurrentRun calls).
       * This functor is used for copying the TargetBody objects between two projects quickly. This
       *   is designed to work with QtConcurrentMap, though the results are all NULL 
       *   (QtConcurrentMap is much faster than many QtConcurrentRun calls).
       *
       * @author 2015-06-11 Ken Edmundson (after Steven Lambright)
       *
@@ -180,7 +187,7 @@ namespace Isis {
//      QStringList saveAndToggleShowOutline();

    private:
      QString m_name;
      QString m_name; //!< The display name of the TaregetBodyList

      /**
       * This stores the directory name that contains the TargetBody objects in this list.
+41 −8
Original line number Diff line number Diff line
@@ -10,6 +10,13 @@

namespace Isis {

  /**
   * Constructor.  Sets up the widget based on the target.
   * 
   * @param target The target whose information will be displayed
   * @param directory Currently unused
   * @param parent The parent widget
   */
  TargetInfoWidget::TargetInfoWidget(TargetBody* target, Directory *directory,
                                     QWidget *parent) : m_ui(new Ui::TargetInfoWidget) {
    m_ui->setupUi(this);
@@ -71,11 +78,19 @@ namespace Isis {
  }


  /**
   * Destructor
   */
  TargetInfoWidget::~TargetInfoWidget() {
    delete m_ui;
  }


  /**
   * Make the poleRightAscensionLabel text using information from the target.
   * 
   * @return @b QString The poleRightAscensionLabel text
   */
  QString TargetInfoWidget::formatPoleRaString() {
    std::vector<Angle> poleRaCoefs = m_target->poleRaCoefs();
    std::vector<double> poleRaNutPrecCoefs = m_target->poleRaNutPrecCoefs();
@@ -84,12 +99,14 @@ namespace Isis {
    QString poleRaString = "";
    QString coefLetter = m_target->naifPlanetSystemName().at(0);

    if (poleRaCoefs[1].degrees() < 0.0 )
    if (poleRaCoefs[1].degrees() < 0.0 ) {
      poleRaString.append(tr("%1%3 - %2T").arg(poleRaCoefs[0].degrees()).arg(-poleRaCoefs[1]
          .degrees()).arg(degChar));
    else
    }
    else {
      poleRaString.append(tr("%1%3 + %2T").arg(poleRaCoefs[0].degrees()).arg(poleRaCoefs[1]
          .degrees()).arg(degChar));
    }

    QString tmp;
    int nCoefs = poleRaNutPrecCoefs.size();;
@@ -110,6 +127,11 @@ namespace Isis {
  }


  /**
   * Make the poleDeclinationLabel text using information from the target.
   * 
   * @return @b QString The poleDeclinationLabel text
   */
  QString TargetInfoWidget::formatPoleDecString() {
    std::vector<Angle> poleDecCoefs = m_target->poleDecCoefs();
    std::vector<double> poleDecNutPrecCoefs = m_target->poleDecNutPrecCoefs();
@@ -118,12 +140,14 @@ namespace Isis {
    QString poleDecString = "";
    QString coefLetter = m_target->naifPlanetSystemName().at(0);

    if (poleDecCoefs[1].degrees() < 0.0 )
    if (poleDecCoefs[1].degrees() < 0.0 ) {
      poleDecString.append(tr("%1%3 - %2T").arg(poleDecCoefs[0].degrees()).arg(-poleDecCoefs[1]
          .degrees()).arg(degChar));
    else
    }
    else {
      poleDecString.append(tr("%1%3 + %2T").arg(poleDecCoefs[0].degrees()).arg(poleDecCoefs[1]
          .degrees()).arg(degChar));
    }

    QString tmp;
    int nCoefs = poleDecNutPrecCoefs.size();;
@@ -144,6 +168,11 @@ namespace Isis {
  }


  /**
   * Make the polePMOffsetLabel text using information from the target.
   * 
   * @return @b QString The polePMOffsetLabel text
   */
  QString TargetInfoWidget::formatPmString() {
    std::vector<Angle> pmCoefs = m_target->pmCoefs();
    std::vector<double> pmNutPrecCoefs = m_target->pmNutPrecCoefs();
@@ -152,17 +181,21 @@ namespace Isis {
    QString pmString = "";
    QString coefLetter = m_target->naifPlanetSystemName().at(0);

    if (pmCoefs[1].degrees() < 0.0 )
    if (pmCoefs[1].degrees() < 0.0 ) {
      pmString.append(tr("%1%3 - %2d").arg(pmCoefs[0].degrees()).arg(-pmCoefs[1].degrees())
          .arg(degChar));
    else if (pmCoefs[1].degrees() > 0.0 )
    }
    else if (pmCoefs[1].degrees() > 0.0 ) {
      pmString.append(tr("%1%3 + %2d").arg(pmCoefs[0].degrees()).arg(pmCoefs[1].degrees())
          .arg(degChar));
    }

    if (pmCoefs[2].degrees() < 0.0 )
    if (pmCoefs[2].degrees() < 0.0 ) {
      pmString.append(tr(" - %2d^2").arg(-pmCoefs[2].degrees()));
    else if (pmCoefs[2].degrees() > 0.0 )
    }
    else if (pmCoefs[2].degrees() > 0.0 ) {
      pmString.append(tr(" + %2d^2").arg(pmCoefs[2].degrees()));
    }


    QString tmp;
Loading