File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
TargetGetInfoWorkOrder.cpp
Go to the documentation of this file.
1 
23 #include "TargetGetInfoWorkOrder.h"
24 
25 #include <QFileDialog>
26 #include <QInputDialog>
27 #include <QtDebug>
28 
29 #include "Directory.h"
30 #include "IException.h"
31 #include "Project.h"
32 #include "TargetBody.h"
33 #include "TargetInfoWidget.h"
34 
35 namespace Isis {
36 
46  WorkOrder(project) {
47  QAction::setText(tr("Get Info...") );
48  // This work order is not undoable
49  m_isUndoable = false;
50  m_isSavedToHistory = false;
51  }
52 
53 
59  WorkOrder(other) {
60  }
61 
62 
67  }
68 
69 
75  return new TargetGetInfoWorkOrder(*this);
76  }
77 
78 
90  if (!targetBody)
91  return false;
92 
93  // if we already have a view for this target, don't redisplay
95  for (int i = 0; i < existingViews.size(); i++) {
96  if (existingViews.at(i)->objectName() == targetBody->displayProperties()->displayName() )
97  return false;
98  }
99 
100  return true;
101  }
102 
103 
112  bool success = WorkOrder::setupExecution();
113 
114  if (success) {
115  QString targetDisplayName = targetBody()->displayProperties()->displayName();
116  QUndoCommand::setText(tr("Get %1 target info").arg(targetDisplayName));
117 
119  internalData.append(targetDisplayName);
121  }
122 
123  return success;
124  }
125 
126 
133 
134  TargetInfoWidget *targetInfoWidget =
136 
137  if (!targetInfoWidget) {
138  QString msg = "error displaying target info";
139  throw IException(IException::Programmer, msg, _FILEINFO_);
140  }
141  }
142 
143 
150  // depend on types of ourselves.
151  return dynamic_cast<TargetGetInfoWorkOrder *>(other);
152  }
153 }
Isis::TargetGetInfoWorkOrder::dependsOn
bool dependsOn(WorkOrder *other) const
Determines whether another WorkOrder depends upon TargetGetInfoWorkOrder.
Definition: TargetGetInfoWorkOrder.cpp:149
Isis::TargetGetInfoWorkOrder::clone
virtual TargetGetInfoWorkOrder * clone() const
Returns a copy of this TargetGetInfoWorkOrder instance.
Definition: TargetGetInfoWorkOrder.cpp:74
Isis::WorkOrder::setupExecution
virtual bool setupExecution()
This sets up the state for the work order.
Definition: WorkOrder.cpp:1261
Isis::TargetGetInfoWorkOrder::isExecutable
virtual bool isExecutable(TargetBodyQsp targetBody)
Determines if we can get target info.
Definition: TargetGetInfoWorkOrder.cpp:89
TargetGetInfoWorkOrder.h
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::TargetGetInfoWorkOrder
This work order allows the user to view target body info.
Definition: TargetGetInfoWorkOrder.h:49
Isis::WorkOrder
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:311
Project.h
Isis::WorkOrder::m_isSavedToHistory
bool m_isSavedToHistory
Set the work order to be shown in the HistoryTreeWidget.
Definition: WorkOrder.h:537
Isis::WorkOrder::setInternalData
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1318
Isis::Directory::addTargetInfoView
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
Definition: Directory.cpp:945
QSharedPointer< TargetBody >
Isis::TargetGetInfoWorkOrder::setupExecution
virtual bool setupExecution()
Attempt to retrieve the Target info.
Definition: TargetGetInfoWorkOrder.cpp:111
QStringList
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Project::directory
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:1229
Isis::WorkOrder::m_isUndoable
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
Definition: WorkOrder.h:523
Isis::WorkOrder::targetBody
TargetBodyQsp targetBody()
WorkOrder::targetBody.
Definition: WorkOrder.cpp:746
Isis::TargetGetInfoWorkOrder::execute
virtual void execute()
Executes this work order.
Definition: TargetGetInfoWorkOrder.cpp:132
Isis::TargetGetInfoWorkOrder::TargetGetInfoWorkOrder
TargetGetInfoWorkOrder(Project *project)
Creates a WorkOrder that will retrieve Target info.
Definition: TargetGetInfoWorkOrder.cpp:45
Isis::WorkOrder::project
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1300
Isis::TargetInfoWidget
Widget for displaying information about a target.
Definition: TargetInfoWidget.h:35
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::WorkOrder::internalData
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1377
Isis::Directory::targetInfoViews
QList< TargetInfoWidget * > targetInfoViews()
Accessor for the list of TargetInfoWidgets currently available.
Definition: Directory.cpp:1380
Isis::TargetGetInfoWorkOrder::~TargetGetInfoWorkOrder
~TargetGetInfoWorkOrder()
The Destructor.
Definition: TargetGetInfoWorkOrder.cpp:66
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:17:22