Commit 3b1bfd99 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Added documentation to Directory classes, prior to committing to ISIS. Fixes #3994.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6820 41f8697f-d340-4b68-9986-7bafba869bb8
parent ed837073
Loading
Loading
Loading
Loading
+31 −6
Original line number Diff line number Diff line
@@ -31,29 +31,50 @@

namespace Isis {

/**
 * @brief Constructor which creates a WorkOrder that will open a recent project.
 * @param project The Project that this work order should be interacting with
 *
 */
  OpenRecentProjectWorkOrder::OpenRecentProjectWorkOrder(Project *project) :
  WorkOrder(project) {
    QAction::setText(tr("Open &Recent Project") );

    setCreatesCleanState(true);
  }


  /**
   * @brief Copies the OpenRecentProjectWorkOrder 'other' into this new instance.
   * @param other The WorkOrder being copied.
   *
   */
  OpenRecentProjectWorkOrder::OpenRecentProjectWorkOrder(const OpenRecentProjectWorkOrder &other) :
      WorkOrder(other) {
  }


  /**
   * @brief The Destructor.
   */
  OpenRecentProjectWorkOrder::~OpenRecentProjectWorkOrder() {

  }


  /**
   * @brief Returns a copy of this OpenRecentProjectWorkOrder instance.
   * @return @b ( OpenRecentWorkOrder *) A pointer to a copy of this object.
   */
  OpenRecentProjectWorkOrder *OpenRecentProjectWorkOrder::clone() const {
    return new OpenRecentProjectWorkOrder(*this);
  }


  /**
   * @brief This function determines if the given project file name can be opened.
   * @param projectFileName  The path to the project file.
   * @return @b bool True if the file exists, False otherwise.
   */
  bool OpenRecentProjectWorkOrder::isExecutable(QString projectFileName) {
    FileName fname = projectFileName;
    if (!fname.fileExists() )
@@ -63,6 +84,10 @@ namespace Isis {
  }


  /**
   * @brief Attempts to open the recent project.
   * @return  @b bool True if successful, False if not.
   */
  bool OpenRecentProjectWorkOrder::execute() {
    bool success = WorkOrder::execute();

+11 −6
Original line number Diff line number Diff line
@@ -22,24 +22,29 @@
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */
#include "WorkOrder.h"
//#include "FileName.h"

//#include <functional>

//#include <QDir>
#include "WorkOrder.h"

class QString;

namespace Isis {


  /**
   * Shows recently opened projects
   *  @brief  This is a child of class WorkOrder which is used for anything that performs
   *  an action in a Project.  This class opens and displays a recent
   *  project.
   *
   * @author 2014-04-13 Ken Edmundson
   *
   *
   * @internal
   *   @author 2016-06-06 Tyler Wilson - Added documentation for the functions and
   *              brought the code into compliance with ISIS3 coding standards.
   *              References #3944.
   */


  class OpenRecentProjectWorkOrder : public WorkOrder {
      Q_OBJECT
    public:
+45 −4
Original line number Diff line number Diff line
@@ -35,26 +35,51 @@

namespace Isis {

  /**
  * @brief Constructor that creates a WorkOrder that will retrieve target body info.
  * @param project The Project that this WorkOrder should be interacting with.
  *
  */
  SensorGetInfoWorkOrder::SensorGetInfoWorkOrder(Project *project) :
      WorkOrder(project) {
    QAction::setText(tr("Get Info...") );
  }


  /**
   * @brief Copies the WorkOrder 'other' into this new instance.
   * @param other The WorkOrder being copied.
   */
  SensorGetInfoWorkOrder::SensorGetInfoWorkOrder(const SensorGetInfoWorkOrder &other) :
      WorkOrder(other) {
  }


  /**
   * @brief The Destructor.
   */
  SensorGetInfoWorkOrder::~SensorGetInfoWorkOrder() {
  }


  /**
   * @brief Returns a copy of the current instance of this WorkOrder.
   * @return  @b (SensorGetInfoWorkOrder *) A copy of this object.
   */
  SensorGetInfoWorkOrder *SensorGetInfoWorkOrder::clone() const {
    return new SensorGetInfoWorkOrder(*this);
  }


  /**
   * @brief Determines if this WorkOrder can be executed. It does this by determining
   * if we already have a view for this camera.  If we do, then do not
   * redisplay the view, and return false.
   *
   * @param guiCamera  A Camera object contained within a Project.
   * @return @b bool Return True if we we already have a view for the guiCamera object.
   * Return False otherwise.
   */
  bool SensorGetInfoWorkOrder::isExecutable(GuiCamera *guiCamera) {
    if (!guiCamera)
      return false;
@@ -70,6 +95,11 @@ namespace Isis {
  }


  /**
   * @brief Attempts to retrieve target body info from the camera and display it
   * in a view.
   * @return  @b bool True if successful, False if not.
   */
  bool SensorGetInfoWorkOrder::execute() {
    bool success = WorkOrder::execute();

@@ -86,12 +116,20 @@ namespace Isis {
  }


  /**
   * @brief Determines whether a WorkOrder depends upon SensorGetInfoWorkerOrder
   * @param other  The work order being checked for dependency.
   * @return @b bool True if dependent, False if not
   */
  bool SensorGetInfoWorkOrder::dependsOn(WorkOrder *other) const {
    // depend on types of ourselves.
    return dynamic_cast<SensorGetInfoWorkOrder *>(other);
  }


  /**
   * @brief  Redisplays the sensor view.
   */
  void SensorGetInfoWorkOrder::syncRedo() {
    SensorInfoWidget *sensorInfoWidget =
        project()->directory()->addSensorInfoView(guiCamera() );
@@ -104,6 +142,9 @@ namespace Isis {
  }


  /**
   * @brief  Deletes the last view.  Currently this function is not implemented.
   */
  void SensorGetInfoWorkOrder::syncUndo() {
    //delete project()->directory()->cnetEditorViews().last();
  }
+5 −1
Original line number Diff line number Diff line
@@ -28,11 +28,15 @@ namespace Isis {
  class GuiCamera;

  /**
   * This work order allows the user to view target body info.
   * @brief This is a child of class WorkOrder which is used for anything that performs
   *  an action in a Project. This work order allows the user to view target body info.
   *
   * @author 2015-07-10 Ken Edmundson
   *
   * @internal
   *   @author 2016-06-06 Tyler Wilson - Added documentation for the functions and
   *              brought the code into compliance with ISIS3 coding standards.
   *              References #3944.
   */

  class SensorGetInfoWorkOrder : public WorkOrder {
+39 −4
Original line number Diff line number Diff line
@@ -22,10 +22,9 @@
 */
#include "TargetGetInfoWorkOrder.h"

#include <QtDebug>

#include <QFileDialog>
#include <QInputDialog>
#include <QtDebug>

#include "Directory.h"
#include "IException.h"
@@ -35,26 +34,47 @@

namespace Isis {

/**
   * @brief Creates a WorkOrder that will retrieve Target info.
   * @param project  The Project that this work order should be interacting with.
   */
  TargetGetInfoWorkOrder::TargetGetInfoWorkOrder(Project *project) :
      WorkOrder(project) {
    QAction::setText(tr("Get Info...") );
  }


  /**
   * @brief Copies the 'other' WorkOrdeer instance into this new instance.
   * @param other The WorkOrder being copied.
   */
  TargetGetInfoWorkOrder::TargetGetInfoWorkOrder(const TargetGetInfoWorkOrder &other) :
      WorkOrder(other) {
  }


  /**
   * @brief The Destructor.
   */
  TargetGetInfoWorkOrder::~TargetGetInfoWorkOrder() {
  }


  /**
   * @brief Returns a copy of this TargetGetInfoWorkOrder instance.
   * @return @b (TargetGetInfoWorkOrder *) A pointer to a copy of this WorkOrder.
   */
  TargetGetInfoWorkOrder *TargetGetInfoWorkOrder::clone() const {
    return new TargetGetInfoWorkOrder(*this);
  }


  /**
   * @brief Determines if we already have a view for the target.  If we do, then we
   * do not need to redisplay the object.
   * @param targetBody
   * @return  @b bool True if a view already exists, False otherwise.
   */
  bool TargetGetInfoWorkOrder::isExecutable(TargetBody *targetBody) {
    if (!targetBody)
      return false;
@@ -70,6 +90,10 @@ namespace Isis {
  }


  /**
   * @brief Attempt to retrieve the Target info and view it.
   * @return @b bool True if successful, False otherwise.
   */
  bool TargetGetInfoWorkOrder::execute() {
    bool success = WorkOrder::execute();

@@ -86,12 +110,20 @@ namespace Isis {
  }


  /**
   * @brief Determines whether another WorkOrder depends upon TargetGetInfoWorkOrder.
   * @param other  The WorkOrder being checked for dependency.
   * @return @b bool  True if there is a dependency, False otherwise.
   */
  bool TargetGetInfoWorkOrder::dependsOn(WorkOrder *other) const {
    // depend on types of ourselves.
    return dynamic_cast<TargetGetInfoWorkOrder *>(other);
  }


  /**
   * @brief  Redisplays the Target info.
   */
  void TargetGetInfoWorkOrder::syncRedo() {
    TargetInfoWidget *targetInfoWidget =
        project()->directory()->addTargetInfoView(targetBody());
@@ -104,6 +136,9 @@ namespace Isis {
  }


  /**
   * @brief Deletes the last view. Currently this function is not implemented.
   */
  void TargetGetInfoWorkOrder::syncUndo() {
    //delete project()->directory()->cnetEditorViews().last();
  }
Loading