Isis Developer Reference
ImportControlNetWorkOrder.h
Go to the documentation of this file.
1 #ifndef ImportControlNetWorkOrder_H
2 #define ImportControlNetWorkOrder_H
3 
25 #include "WorkOrder.h"
26 
27 #include <functional>
28 
29 #include <QDir>
30 #include <QFutureWatcher>
31 #include <QString>
32 
33 #include "IException.h"
34 
35 namespace Isis {
36  class Control;
37  class FileName;
38  class Progress;
39  class Project;
40 
73  Q_OBJECT
74  public:
78 
79  virtual ImportControlNetWorkOrder *clone() const;
80 
81  virtual bool isExecutable(ProjectItem *item);
82  bool setupExecution();
83  void execute();
84 
85  protected:
86  void postExecution();
87 
88  private slots:
89  void cnetReady(int ready);
90 
91  private:
93 // Control *createControls(const QString &cnetFilename);
94 
101  class CreateControlsFunctor : public std::unary_function<
102  const QPair<FileName, Progress *> &, Control *> {
103  public:
104  CreateControlsFunctor(Project *project, QDir destinationFolder);
105  Control *operator()(const QPair<FileName, Progress *> &cnetFilename);
106  IException errors() const;
107 
108  private:
109  Project *m_project;
110  QDir m_destinationFolder;
111  QSharedPointer<IException> m_errors;
112  };
113 
114  private:
115  QFutureWatcher<Control *> *m_watcher;
116  ControlList *m_list;
117  QList<Progress *> m_readProgresses;
118  QString m_warning;
119  };
120 }
121 #endif // ImportControlNetWorkOrder_H
ProjectItem.h
Isis::WorkOrder::setupExecution
virtual bool setupExecution()
This sets up the state for the work order.
Definition: WorkOrder.cpp:1261
Isis::ControlNet::SetMutex
void SetMutex(QMutex *mutex)
Set mutex to lock for making Naif calls.
Definition: ControlNet.cpp:1666
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::WorkOrder
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:311
Project.h
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Project::addControl
void addControl(Control *control)
Add the given Control's to the current project.
Definition: Project.cpp:958
Isis::ControlList
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition: ControlList.h:44
Isis::WorkOrder::setInternalData
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1318
Isis::ControlNet::Write
void Write(const QString &filename, bool pvl=false)
Writes out the control network.
Definition: ControlNet.cpp:311
Isis::Project::activeControl
Control * activeControl()
Return the Active Control (control network)
Definition: Project.cpp:1903
Isis::ImportControlNetWorkOrder::clone
virtual ImportControlNetWorkOrder * clone() const
This method clones the current ImportControlNetWorkOrder and returns it.
Definition: ImportControlNetWorkOrder.cpp:92
Isis::ImportControlNetWorkOrder::setupExecution
bool setupExecution()
Sets up the work order for execution.
Definition: ImportControlNetWorkOrder.cpp:126
Isis::Control
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:66
QSharedPointer
Definition: JigsawWorkOrder.h:28
Isis::ImportControlNetWorkOrder::postExecution
void postExecution()
Clears progress.
Definition: ImportControlNetWorkOrder.cpp:199
Isis::ImportControlNetWorkOrder::ImportControlNetWorkOrder
ImportControlNetWorkOrder(Project *project)
Creates a work order to import a control network.
Definition: ImportControlNetWorkOrder.cpp:47
Isis::WorkOrder::m_isSynchronous
bool m_isSynchronous
This is defaulted to true.
Definition: WorkOrder.h:530
Isis::ControlNet::ReadControl
void ReadControl(const QString &filename, Progress *progress=0)
Reads in the control points from the given file.
Definition: ControlNet.cpp:271
QStringList
ControlList.h
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::IException::append
void append(const IException &exceptionSource)
Appends the given exception (and its list of previous exceptions) to this exception's causational exc...
Definition: IException.cpp:409
WorkOrder.h
Isis::ImportControlNetWorkOrder::~ImportControlNetWorkOrder
~ImportControlNetWorkOrder()
Destructor.
Definition: ImportControlNetWorkOrder.cpp:81
Isis::Control::closeControlNet
void closeControlNet()
Cleans up the ControlNet pointer.
Definition: Control.cpp:214
ControlNet.h
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
ImportControlNetWorkOrder.h
Isis::Project::warn
void warn(QString text, Data relevantData)
Definition: Project.cpp:2643
Isis::WorkOrder::project
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1300
ProjectItemModel.h
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::ImportControlNetWorkOrder
Add control networks to a project c Asks the user for a list of control nets and copies them into the...
Definition: ImportControlNetWorkOrder.h:72
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::WorkOrder::setProgressRange
void setProgressRange(int, int)
Sets the progress range of the WorkOrder.
Definition: WorkOrder.cpp:1358
Isis::Project::controls
QList< ControlList * > controls()
Return controls in project.
Definition: Project.cpp:2038
IException.h
Isis::Progress::MaximumSteps
int MaximumSteps() const
Returns the maximum number of steps of the progress.
Definition: Progress.cpp:172
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::WorkOrder::WorkOrderFinished
@ WorkOrderFinished
This is used for work orders that will not undo or redo (See createsCleanState())
Definition: WorkOrder.h:331
Isis::WorkOrder::setProgressValue
void setProgressValue(int)
Sets the current progress value for the WorkOrder.
Definition: WorkOrder.cpp:1368
QFutureWatcher
This is free and unencumbered software released into the public domain.
Definition: AbstractTableModel.h:24
Isis::WorkOrder::internalData
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1377
Control.h
Isis::WorkOrder::setModifiesDiskState
void setModifiesDiskState(bool changesProjectOnDisk)
Definition: WorkOrder.cpp:1674
Isis::ImportControlNetWorkOrder::isExecutable
virtual bool isExecutable(ProjectItem *item)
This method returns true if the user clicked on a project tree node with the text "Control Networks".
Definition: ImportControlNetWorkOrder.cpp:107
Isis::Progress::DisableAutomaticDisplay
void DisableAutomaticDisplay()
Turns off updating the Isis Gui when CheckStatus() is called.
Definition: Progress.cpp:161
Isis::Project::addCnetFolder
QDir addCnetFolder(QString prefix)
Create and return the name of a folder for placing control networks.
Definition: Project.cpp:926
Isis::Progress::CurrentStep
int CurrentStep() const
Returns the current step of the progress.
Definition: Progress.cpp:185
Isis::Project::setClean
void setClean(bool value)
Function to change the clean state of the project.
Definition: Project.cpp:1595
Progress.h
Isis::ImportControlNetWorkOrder::execute
void execute()
Imports the control network asynchronously.
Definition: ImportControlNetWorkOrder.cpp:151
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::WorkOrder::m_status
WorkOrderStatus m_status
Definition: WorkOrder.h:539
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134