Isis Developer Reference
Isis::WorkOrder Class Referenceabstract

Provide Undo/redo abilities, serialization, and history for an operation. More...

#include <WorkOrder.h>

Inheritance diagram for Isis::WorkOrder:
Inheritance graph
Collaboration diagram for Isis::WorkOrder:
Collaboration graph

Public Types

enum  WorkOrderStatus {
  WorkOrderUnknownStatus = 0 , WorkOrderNotStarted , WorkOrderRedoing , WorkOrderRedone ,
  WorkOrderUndoing , WorkOrderUndone , WorkOrderFinished , WorkOrderLastStatus = WorkOrderFinished
}
 This enumeration is used by other functions to set and retrieve the current state of the WorkOrder. More...
 
enum  Context { NoContext , ProjectContext }
 This enumeration is for recording the context of the current Workorder (whether it is part of a project or not). More...
 

Public Slots

void enableWorkOrder ()
 Enables the work order.
 
void disableWorkOrder ()
 Disables the work order.
 
virtual bool setupExecution ()
 This sets up the state for the work order.
 
virtual void execute ()
 Execute the workorder.
 
virtual void redo ()
 Starts (or enqueues) a redo.
 
virtual void undo ()
 Starts (or enqueues) an undo.
 

Signals

void creatingProgress (WorkOrder *)
 
void deletingProgress (WorkOrder *)
 
void finished (WorkOrder *)
 
void statusChanged (WorkOrder *)
 

Public Member Functions

 WorkOrder (Project *project)
 Create a work order that will work with the given project.
 
virtual ~WorkOrder ()
 The Destructor.
 
virtual WorkOrderclone () const =0
 
virtual bool isExecutable (Context)
 Re-implement this method if your work order utilizes controls for data in order to operate.
 
virtual bool isExecutable (ImageList *images)
 Re-implement this method if your work order utilizes images for data in order to operate.
 
virtual bool isExecutable (ShapeList *shapes)
 Re-implement this method if your work order utilizes shapes for data in order to operate.
 
virtual bool isExecutable (ControlList *controls)
 Re-implement this method if your work order utilizes a control for data in order to operate.
 
virtual bool isExecutable (CorrelationMatrix)
 
virtual bool isExecutable (TargetBodyQsp targetBody)
 Re-implement this method if your work order utilizes a control list (a list of control networks) for data in order to operate.
 
virtual bool isExecutable (Template *currentTemplate)
 Re-implement this method if your work order utilizes a control list (a list of control networks) for data in order to operate.
 
virtual bool isExecutable (GuiCameraQsp guiCamera)
 Re-implement this method if your WorkOrder utilizes GuiCameraQsp (a QSharedPointer to a GuiCamera object) for data in order to operate.
 
virtual bool isExecutable (FileItemQsp fileItem)
 Re-implement this method if your WorkOrder utilizes FileItemQsp (a QSharedPointer to a FileItem object) for data in order to operate.
 
virtual bool isExecutable (ProjectItem *item)
 Determines if the WorkOrder is execuatable on the data stored in a ProjectItem.
 
void read (XmlStackedHandlerReader *xmlReader)
 Read this work order's data from disk.
 
void save (QXmlStreamWriter &stream) const
 : Saves a WorkOrder to a data stream.
 
virtual void setData (Context)
 Sets the context data for this WorkOrder.
 
virtual void setData (QString data)
 
virtual void setData (ImageList *images)
 Sets the ImageList data for this WorkOrder.
 
virtual void setData (ShapeList *shapes)
 Sets the ShapeList data for this WorkOrder.
 
virtual void setData (ControlList *controls)
 Sets the Control data for this WorkOrder.
 
virtual void setData (Template *currentTemplate)
 Sets the TargetBody data for this WorkOrder.
 
virtual void setData (CorrelationMatrix)
 Sets the CorrelationMatrix data for this WorkOrder.
 
virtual void setData (TargetBodyQsp targetBody)
 Sets the TargetBody data for this WorkOrder.
 
virtual void setData (GuiCameraQsp guiCamera)
 Sets the GuiCamera data for this WorkOrder.
 
virtual void setData (FileItemQsp fileItem)
 Sets the FileItem data for this WorkOrder.
 
virtual void setData (ProjectItem *item)
 Sets the internal data to the data stored in a ProjectItem.
 
void setNext (WorkOrder *nextWorkOrder)
 Sets the next WorkOrder in the sequence.
 
void setPrevious (WorkOrder *previousWorkOrder)
 Sets the previous WorkOrder in the sequence.
 
QString bestText () const
 Generate unique action names We don't use action text anymore because Directory likes to rename our actions.
 
bool isUndoable () const
 Returns true if this work order is undoable, otherwise false.
 
bool isSavedToHistory () const
 Returns true if this work order is to be shown in History, otherwise false.
 
bool isSynchronous () const
 Returns true if this work order is run synchronously, otherwise false.
 
bool createsCleanState () const
 Returns the CleanState status (whether the Project has been saved to disk or not).
 
QDateTime executionTime () const
 Gets the execution time of this WorkOrder.
 
bool isFinished () const
 Returns the finished state of this WorkOrder.
 
bool isRedoing () const
 Returns the redoing status of this WorkOrder.
 
bool isRedone () const
 Returns the WorkOrder redone status.
 
bool isUndoing () const
 Returns the WorkOrderUndoing state.
 
bool isUndone () const
 Returns the WorkOrder undo status.
 
bool modifiesDiskState () const
 Returns the modified disk state.
 
WorkOrdernext () const
 Gets the next WorkOrder.
 
WorkOrderprevious () const
 Gets the previous WorkOrder.
 
QString statusText () const
 WorkOrder::statusText.
 
ProgressBarprogressBar ()
 Returns the ProgressBar.
 

Static Public Member Functions

static WorkOrderStatus fromStatusString (QString)
 Attempts to query the current status of the WorkOrder.
 
static QString toString (WorkOrderStatus)
 Gets the current status of the WorkOrder.
 

Protected Slots

void addCloneToProject ()
 Runs a copy of the current WorkOrder and stores it in the project.
 

Protected Member Functions

 WorkOrder (const WorkOrder &other)
 Copy the work order 'other' into this (new) instance.
 
ImageListimageList ()
 Returns a pointer to the ImageList for this WorkOrder.
 
const ImageListimageList () const
 A thread-safe method for retrieving a pointer to the imageList.
 
ShapeListshapeList ()
 @briefReturns a pointer to the ShapeList for this WorkOrder.
 
const ShapeListshapeList () const
 A thread-safe method for retrieving a pointer to the shapeList.
 
CorrelationMatrix correlationMatrix ()
 Returns the CorrleationMatrix for this WorkOrder.
 
QPointer< ControlListcontrolList ()
 Returns the Control List for this WorkOrder (a list of control networks).
 
TemplategetTemplate ()
 WorkOrder::getTemplate.
 
TargetBodyQsp targetBody ()
 WorkOrder::targetBody.
 
GuiCameraQsp guiCamera ()
 WorkOrder::guiCamera.
 
FileItemQsp fileItem ()
 WorkOrder::fileItem.
 
virtual bool dependsOn (WorkOrder *other) const
 Indicate workorder dependency This is a virtual function whose role in child classes is to determine if this WorkOrder depends on the WorkOrder passed in as an argument.
 
Directorydirectory () const
 return the workorder project directory Returns the Directory object of the Project this WorkOrder is attached to.
 
Projectproject () const
 Returns the Project this WorkOrder is attached to.
 
void setCreatesCleanState (bool createsCleanState)
 Declare that this work order is saving the project.
 
void setModifiesDiskState (bool changesProjectOnDisk)
 
void setInternalData (QStringList data)
 Sets the internal data for this WorkOrder.
 
int progressMin () const
 Gets the minimum value of the progress range of the WorkOrder.
 
int progressMax () const
 Gets the maximum value of the progress range of the WorkOrder.
 
int progressValue () const
 Gets the current progress value of the WorkOrder.
 
void setProgressRange (int, int)
 Sets the progress range of the WorkOrder.
 
void setProgressValue (int)
 Sets the current progress value for the WorkOrder.
 
QStringList internalData () const
 Gets the internal data for this WorkOrder.
 
virtual void postExecution ()
 Perform any necessary actions after execution of a workorder.
 
virtual void undoExecution ()
 Execute the steps necessary to undo this workorder.
 
virtual void postUndoExecution ()
 Perform any steps necessary after an undo of a workorder.
 

Protected Attributes

bool m_isUndoable
 Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to be redone.
 
bool m_isSynchronous
 This is defaulted to true.
 
bool m_isSavedToHistory
 Set the work order to be shown in the HistoryTreeWidget.
 
WorkOrderStatus m_status
 

Detailed Description

Provide Undo/redo abilities, serialization, and history for an operation.

This class should be used for operations that affect a Project and need to provide history and/or undo/redo capabilities, and the ability for the project to guarantee a good state on disk. It follows the Command Pattern using Qt's QUndoCommand framework. Not all actions require WorkOrders - many of the actions performed in the various widgets may not use WorkOrders.

The order of execution for work orders is: setupExecution() - GUI thread, can ask user for input execute() - run on either the GUI thread or a non-GUI thread as specified by the m_isSynchronous flag postExecution() - perform any cleanup after execute.

undoExecution() - run on either the GUI thread or a non-GUI thread as specified by the m_isSynchronous flag postUndoExecution() - perform any cleanup after undoExecution()

** Adding a new Workorder **

The WorkOrder will need to be determined to be either synchronous/asynchronous and whether it is undoable. These are decisions determined by the use case. Asynchronous WorkOrders will not block the GUI thread while running and are typically used for long-running operations. Note that WorkOrders are not reentrant - a new one is created for each action.

The constructor for the WorkOrder must set m_isUndoable and m_isSynchronous to the appropriate values. The constructor must call the base WorkOrder constructor. The default is synchronous and undoable. If an import WorkOrder is being implemented the import must be some type of object and implement certain slots.

All information required to execute the WorkOrder should be saved in the WorkOrder in the setupExecution() method. Since WorkOrders may be serialized and may run on non-GUI threads there are restrictions on how the WorkOrder may save state. To allow serialization the WorkOrders must save state to the base WorkOrder class using WorkOrder::setInternalData() in the following calls: setupExecution(), postExecution(), postUndoExecution(). Workorders may use member variables to pass data between the execute() and postExecution() methods and also between the undoExecution() and undoPostExecution() methods since serialization can not happen between these calls. For asynchronous WorkOrders the execute()/postExecution() and undoExecution()/undoPostExecution() methods are on different threads so any allocated memory moved between the non-GUI and GUI threads between methods.

Serialization is handled by the base WorkOrder class. Since all state is saved into the base class using setInternalData() the derived WorkOrders do not contain any data that needs to be serialized. The times when WorkOrders are allowed to use member variables are periods when the WorkOrder can not be serialized.

There are 5 key methods in the flow of the WorkOrder as shown in the WorkOrder Flow diagram below.

setupExecution The setupExecution() method gathers all required information to run the WorkOrder but does not execute it. The gathered information is stored in the WorkOrder. SetupExecution() is optional but typically required. It can bring up GUI elements to prompt the user for any necessary information. SetupExecution() is not called when a WorkOrder is redone.

execute execute() needs to be implemented perform the WorkOrder. All information neccessary to run the WorkOrder should already be stored in the WorkOrder. The data necessary for the WorkOrder can be retrieved via internalData() Execute() can not use any GUI elements. Each time a WorkOrder is redone execute() is called to redo the WorkOrder.

For synchronous WorkOrders the execute() method runs on the GUI thread and there are no special requirements on object ownership.

For asynchronous WorkOrders any memory allocations that aren't deallocated within execute() will need to be moved to the GUI thread.

See also
ImportImagesWorkOrder::execute for an example of an asynchronous WorkOrder that allocates memory. setProgressValue() can be used to update the progress bar in the GUI. Any member variables being accessed by an asynchronous workorder will need to have a QMutex locker so they can be thread safe

postExecution postExecution() runs on the GUI thread so it should not perform any long running operations. It is intended for any cleanup or GUI updates after execute(). Typically it would only be needed for asynchronous WorkOrders where they need to update the GUI and do cleanup. It is not required to implement this method.

undoExecution undoExecution() is only required for undoable WorkOrders. undoExecution() should undo the effects of the execute() only using state stored in the WorkOrder. It will run on the GUI thread if synchronous or a non-GUI thread if asynchronous. The same restrictions as execute() apply to this method.

postUndoExecution() This is not required. If needed, it should perform any cleanup after undoExecution(). postUndoExecution() has the same restrictions as postExecution().

Other methods the WorkOrder may need to implement are:

isExecutable(<various type>) IsExecutable() determines if the WorkOrder should show up in the context menus (this has no bearing on how the main menu is populated). Note that isExecutable will need to be implemented for each type of parameter this WorkOrder should show in the context menu.

dependsOn This is currently not implemented properly for most WorkOrders. In theory this should determine if the workOrder parameter passed in must be completed prior to this workOrder completing. Most current WorkOrders just check if the WorkOrder parameter is the same type.

setCreatesCleanState This is used to indicate the WorkOrder has set the state back to an unchanged state from which the project was originally opened. This is used by open, save, and close project WorkOrders. Unlikely to be needed by other WorkOrders. This can needs to be set to false to be able to have an undoable workorder

setModifiesDiskState WorkOrders should call this to indicate they modify the disk state, this should be set to true to be able to have an undoable workorder. The WorkOrder should implement the undoExecution method if this is set to true.

WorkOrder Diagrams

Author
2012-??-?? Steven Lambright and Stuart Sides

Member Enumeration Documentation

◆ Context

This enumeration is for recording the context of the current Workorder (whether it is part of a project or not).

Enumerator
NoContext 
ProjectContext 

◆ WorkOrderStatus

This enumeration is used by other functions to set and retrieve the current state of the WorkOrder.

Enumerator
WorkOrderUnknownStatus 
WorkOrderNotStarted 
WorkOrderRedoing 
WorkOrderRedone 
WorkOrderUndoing 
WorkOrderUndone 
WorkOrderFinished 

This is used for work orders that will not undo or redo (See createsCleanState())

WorkOrderLastStatus 

Constructor & Destructor Documentation

◆ WorkOrder() [1/2]

Isis::WorkOrder::WorkOrder ( Project * project)

Create a work order that will work with the given project.

Parameters
projectThe Project that this work order should be interacting with
parentThe Qt-relationship parent
Exceptions
IException::ProgrammerThis exception is thrown if the WorkOrder is not attached to a Project.

References _FILEINFO_, addCloneToProject(), finished(), m_isSavedToHistory, m_isSynchronous, m_isUndoable, m_status, NoContext, Isis::IException::Programmer, project(), and WorkOrderNotStarted.

◆ ~WorkOrder()

Isis::WorkOrder::~WorkOrder ( )
virtual

The Destructor.

◆ WorkOrder() [2/2]

Isis::WorkOrder::WorkOrder ( const WorkOrder & other)
protected

Copy the work order 'other' into this (new) instance.

Parameters
otherThe work order being copied.
Exceptions
IException::UnknownThis Excecption is thrown if the WorkOrder being copies is currently running.

References _FILEINFO_, addCloneToProject(), finished(), m_isSavedToHistory, m_isSynchronous, m_isUndoable, m_status, and Isis::IException::Unknown.

Member Function Documentation

◆ addCloneToProject

void Isis::WorkOrder::addCloneToProject ( )
protectedslot

Runs a copy of the current WorkOrder and stores it in the project.

References Isis::Project::addToProject(), clone(), and project().

Referenced by WorkOrder(), and WorkOrder().

◆ bestText()

QString Isis::WorkOrder::bestText ( ) const

Generate unique action names We don't use action text anymore because Directory likes to rename our actions.

It converts a set of actions that have the same text, like Zoom Fit, to be in a menu named Zoom Fit with items that name their widgets. Widget names are unhelpful as a description of the action.

See also
Directory::restructureActions
Returns
QString A textual description of the action.

Referenced by save().

◆ clone()

◆ controlList()

◆ correlationMatrix()

CorrelationMatrix Isis::WorkOrder::correlationMatrix ( )
protected

Returns the CorrleationMatrix for this WorkOrder.

Returns
A CorrelationMatrix.

References project().

Referenced by Isis::MatrixViewWorkOrder::execute(), setData(), and Isis::MatrixViewWorkOrder::setupExecution().

◆ createsCleanState()

bool Isis::WorkOrder::createsCleanState ( ) const

Returns the CleanState status (whether the Project has been saved to disk or not).

If this is set to true the work order will avoid being put on the undo stack, meaning it will not be undoable. It will also set the undo stack to a clean state, by doing this it makes all previous workorders done before the save to be no longer undoable.

Returns
Returns True if the Project has been saved to disk. False if it has not.

References project().

Referenced by setCreatesCleanState(), and setupExecution().

◆ creatingProgress

void Isis::WorkOrder::creatingProgress ( WorkOrder * )
signal

◆ deletingProgress

void Isis::WorkOrder::deletingProgress ( WorkOrder * )
signal

◆ dependsOn()

bool Isis::WorkOrder::dependsOn ( WorkOrder * other) const
protectedvirtual

Indicate workorder dependency This is a virtual function whose role in child classes is to determine if this WorkOrder depends on the WorkOrder passed in as an argument.

Parameters
WorkOrder* The WorkOrder we are checking for dependency with this one.
Returns
bool Returns True if there is a dependency, and False if there is no dependency.

Reimplemented in Isis::CnetEditorViewWorkOrder, Isis::CubeDnViewWorkOrder, Isis::JigsawWorkOrder, Isis::MatrixViewWorkOrder, Isis::RenameProjectWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::TemplateEditViewWorkOrder, and Isis::ViewControlNet3DWorkOrder.

Referenced by redo().

◆ directory()

Directory * Isis::WorkOrder::directory ( ) const
protected

◆ disableWorkOrder

void Isis::WorkOrder::disableWorkOrder ( )
slot

Disables the work order.

Disables the work order so it cannot be triggered (grayed-out).

See also
Directory::initializeActions()

◆ enableWorkOrder

void Isis::WorkOrder::enableWorkOrder ( )
slot

Enables the work order.

Enables the work order so that it can be triggered (clicked).

See also
Directory::initializeActions()

◆ execute

void Isis::WorkOrder::execute ( )
virtualslot

Execute the workorder.

Execute() does the actual work in the work order. All necessary data for the execution (and undo) of the workorder should have been saved in the workorder prior to execute(). Execute() is also called to redo a workorder for redoable workorders. If the workorder is a synchrounous workorder the workorder will be run on the GUI thread, otherwise it will be queued and run on a separate thread.

For Synchronous workorders: State should only be read from the parent WorkOrder class in this method. You can set state to postExecution() safely. This method is always executed in the GUI thread.

For asynchronous workorders: State can be read from the parent WorkOrder class while in this method. You can set state to be used in postExecution() safely. Please be wary of creating QObjects inside of this method because they will associated with the pooled thread and must be moved back to the GUI thread with QObject::moveToThread(). You can update progress by calling setProgressRange() and setProgressValue(). Do not manipulate any GUI objects here.

Reimplemented in Isis::BundleObservationViewWorkOrder, Isis::CloseProjectWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::ControlHealthMonitorWorkOrder, Isis::CubeDnViewWorkOrder, Isis::ExportControlNetWorkOrder, Isis::ExportImagesWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::ImportControlNetWorkOrder, Isis::ImportImagesWorkOrder, Isis::ImportMapTemplateWorkOrder, Isis::ImportRegistrationTemplateWorkOrder, Isis::ImportShapesWorkOrder, Isis::JigsawWorkOrder, Isis::MatrixViewWorkOrder, Isis::OpenProjectWorkOrder, Isis::RemoveImagesWorkOrder, Isis::RenameProjectWorkOrder, Isis::SaveProjectAsWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::SetActiveControlWorkOrder, Isis::SetActiveImageListWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::TemplateEditViewWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::ImageListActionWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Referenced by redo().

◆ executionTime()

QDateTime Isis::WorkOrder::executionTime ( ) const

Gets the execution time of this WorkOrder.

Returns
QDateTime The execution time.

References project().

◆ fileItem()

FileItemQsp Isis::WorkOrder::fileItem ( )
protected

◆ finished

void Isis::WorkOrder::finished ( WorkOrder * )
signal

Referenced by redo(), undo(), WorkOrder(), and WorkOrder().

◆ fromStatusString()

WorkOrder::WorkOrderStatus Isis::WorkOrder::fromStatusString ( QString statusString)
static

Attempts to query the current status of the WorkOrder.

Parameters
statusStringThe status we want information about.
Returns
WorkOrderStatus Returns WorkOrderUnknownStatus if the statusString does not match the current status. If there is a result, then it returns the status which matches the statusString.

References toString(), WorkOrderLastStatus, and WorkOrderUnknownStatus.

◆ getTemplate()

Template * Isis::WorkOrder::getTemplate ( )
protected

◆ guiCamera()

GuiCameraQsp Isis::WorkOrder::guiCamera ( )
protected

◆ imageList() [1/2]

◆ imageList() [2/2]

const ImageList * Isis::WorkOrder::imageList ( ) const
protected

A thread-safe method for retrieving a pointer to the imageList.

Returns
(ImageList *) A pointer to the image list for this WorkOrder.

References imageList().

◆ internalData()

QStringList Isis::WorkOrder::internalData ( ) const
protected

Gets the internal data for this WorkOrder.

Returns
QStringList Returns the internal data object.

References project().

Referenced by Isis::CubeDnViewWorkOrder::execute(), Isis::ExportControlNetWorkOrder::execute(), Isis::ExportImagesWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::ImportControlNetWorkOrder::execute(), Isis::ImportImagesWorkOrder::execute(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::ImportShapesWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), Isis::ImageListActionWorkOrder::execute(), Isis::ImageListActionWorkOrder::ImageListActionWorkOrder(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::MosaicSceneWorkOrder::restoreZPositions(), Isis::MosaicSceneWorkOrder::scene(), Isis::ImageListActionWorkOrder::setData(), Isis::CubeDnViewWorkOrder::setupExecution(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ExportImagesWorkOrder::setupExecution(), Isis::Footprint2DViewWorkOrder::setupExecution(), Isis::ImageFileListViewWorkOrder::setupExecution(), Isis::ImportControlNetWorkOrder::setupExecution(), Isis::MatrixViewWorkOrder::setupExecution(), Isis::RenameProjectWorkOrder::setupExecution(), Isis::SensorGetInfoWorkOrder::setupExecution(), Isis::TargetGetInfoWorkOrder::setupExecution(), Isis::TemplateEditViewWorkOrder::setupExecution(), Isis::ImageListActionWorkOrder::setupExecution(), Isis::MosaicSceneWorkOrder::storeZPositions(), Isis::MatrixViewWorkOrder::undoExecution(), Isis::RenameProjectWorkOrder::undoExecution(), and Isis::ImageListActionWorkOrder::undoExecution().

◆ isExecutable() [1/10]

bool Isis::WorkOrder::isExecutable ( Context context)
virtual

Re-implement this method if your work order utilizes controls for data in order to operate.

For example, "CnetEditorViewWorkOrder" works sometimes on controls

  • the logic in side of CnetEditorViewWorkOrder::isExecutable() determines whethere or not a user is prompted with this work order as a possibility.
    Parameters
    contextThis is an enum variable with two values: NoContext,ProjectContext.
    Returns
    bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::RenameProjectWorkOrder.

Referenced by isExecutable().

◆ isExecutable() [2/10]

bool Isis::WorkOrder::isExecutable ( ControlList * controls)
virtual

Re-implement this method if your work order utilizes a control for data in order to operate.

Parameters
controlA control networks.
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Re-implement this method if your work order utilizes a control list (a list of control networks) for data in order to operate.

Parameters
controlsA list of control networks.
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::CnetEditorViewWorkOrder, Isis::ControlHealthMonitorWorkOrder, Isis::ExportControlNetWorkOrder, Isis::SetActiveControlWorkOrder, and Isis::ViewControlNet3DWorkOrder.

◆ isExecutable() [3/10]

bool Isis::WorkOrder::isExecutable ( CorrelationMatrix correlationMatrix)
virtual

Reimplemented in Isis::MatrixViewWorkOrder.

◆ isExecutable() [4/10]

bool Isis::WorkOrder::isExecutable ( FileItemQsp fileItem)
virtual

Re-implement this method if your WorkOrder utilizes FileItemQsp (a QSharedPointer to a FileItem object) for data in order to operate.

Parameters
FileItemQsp
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::BundleObservationViewWorkOrder.

◆ isExecutable() [5/10]

bool Isis::WorkOrder::isExecutable ( GuiCameraQsp guiCamera)
virtual

Re-implement this method if your WorkOrder utilizes GuiCameraQsp (a QSharedPointer to a GuiCamera object) for data in order to operate.

Parameters
GuiCameraQsp
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::SensorGetInfoWorkOrder.

◆ isExecutable() [6/10]

bool Isis::WorkOrder::isExecutable ( ImageList * images)
virtual

Re-implement this method if your work order utilizes images for data in order to operate.

For example, "Footprint2DViewWorkOrder" works sometimes on images - the logic in side of Footprint2DViewWorkOrder::isExecutable(ImageList) determines whethere or not a user is prompted with this work order as a possibility.

Parameters
imagesAn image list that this work order should execute on
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::SetActiveImageListWorkOrder, Isis::CubeDnViewWorkOrder, Isis::ExportImagesWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::RemoveImagesWorkOrder, and Isis::ImageListActionWorkOrder.

◆ isExecutable() [7/10]

◆ isExecutable() [8/10]

bool Isis::WorkOrder::isExecutable ( ShapeList * shapes)
virtual

Re-implement this method if your work order utilizes shapes for data in order to operate.

For example, "ImportShapeWorkOrder" works on shapes - the logic in side of ImportShapeWorkOrder::isExecutable(ShapeList) determines whethere or not a user is prompted with this work order as a possibility.

Parameters
shapesA shape list that this work order should execute on
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::CubeDnViewWorkOrder, and Isis::Footprint2DViewWorkOrder.

◆ isExecutable() [9/10]

bool Isis::WorkOrder::isExecutable ( TargetBodyQsp targetBody)
virtual

Re-implement this method if your work order utilizes a control list (a list of control networks) for data in order to operate.

Parameters
controlsA list of control networks.
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

Reimplemented in Isis::TargetGetInfoWorkOrder.

◆ isExecutable() [10/10]

bool Isis::WorkOrder::isExecutable ( Template * currentTemplate)
virtual

Re-implement this method if your work order utilizes a control list (a list of control networks) for data in order to operate.

Parameters
controlsA list of control networks.
Returns
bool Upon re-implementation, returns True if the WorkOrder is executable, and False if it is not.

◆ isFinished()

bool Isis::WorkOrder::isFinished ( ) const

Returns the finished state of this WorkOrder.

Returns
bool Returns True if the WorkOrder is finished, False otherwise.

References m_status, and WorkOrderFinished.

◆ isRedoing()

bool Isis::WorkOrder::isRedoing ( ) const

Returns the redoing status of this WorkOrder.

Returns
bool Returns True if the WorkOrder is executing a redo. Returns False if it is not.

References m_status, project(), and WorkOrderRedoing.

Referenced by redo(), and undo().

◆ isRedone()

bool Isis::WorkOrder::isRedone ( ) const

Returns the WorkOrder redone status.

Returns
bool Returns True if the WorkOrder has completed a Redo. False if it has not.

References m_status, project(), and WorkOrderRedone.

Referenced by redo().

◆ isSavedToHistory()

bool Isis::WorkOrder::isSavedToHistory ( ) const

Returns true if this work order is to be shown in History, otherwise false.

Returns
(bool) Returns True if this work order is to be shown in History

References m_isSavedToHistory, and project().

◆ isSynchronous()

bool Isis::WorkOrder::isSynchronous ( ) const

Returns true if this work order is run synchronously, otherwise false.

Returns
(bool) Returns True if this work order is run synchronously

References m_isSynchronous, and project().

Referenced by redo(), and undo().

◆ isUndoable()

bool Isis::WorkOrder::isUndoable ( ) const

Returns true if this work order is undoable, otherwise false.

This needs to be set to true and createsCleanState needs to be set to false in order for a WorkOrder to appear on the undoStack. This should be done by setting the member variable and should not be overloading this function.

Returns
(bool) Returns True if this work order is undoable, false if it is not.

References m_isUndoable, and project().

Referenced by setupExecution().

◆ isUndoing()

bool Isis::WorkOrder::isUndoing ( ) const

Returns the WorkOrderUndoing state.

Returns
bool Returns True if the current status is WorkOrderUndoing, False otherwise.

References m_status, project(), and WorkOrderUndoing.

Referenced by redo(), and undo().

◆ isUndone()

bool Isis::WorkOrder::isUndone ( ) const

Returns the WorkOrder undo status.

Returns
bool Returns True if the WorkOrder has been undone. False if it has not.

References m_status, project(), and WorkOrderUndone.

Referenced by undo().

◆ modifiesDiskState()

bool Isis::WorkOrder::modifiesDiskState ( ) const

Returns the modified disk state.

Returns
Returns True if the WorkOrder has modified the Project on disk to perform it's actions. Returns False if it has not.

References project().

◆ next()

WorkOrder * Isis::WorkOrder::next ( ) const

Gets the next WorkOrder.

Returns
QPointer pointing to the next WorkOrder.

References project().

◆ postExecution()

void Isis::WorkOrder::postExecution ( )
protectedvirtual

Perform any necessary actions after execution of a workorder.

State can be read from the parent WorkOrder class and from state set in either synchronous() or asyncRedo() while in this method. You can not set state to be used in any of the undo code safely. This method is always executed in the GUI thread and has no progress.

Reimplemented in Isis::ExportControlNetWorkOrder, Isis::ExportImagesWorkOrder, Isis::ImportControlNetWorkOrder, Isis::ImportImagesWorkOrder, and Isis::ImportShapesWorkOrder.

◆ postUndoExecution()

void Isis::WorkOrder::postUndoExecution ( )
protectedvirtual

Perform any steps necessary after an undo of a workorder.

State can be read from the parent WorkOrder class and from state set undoExecution() while in this method. You can not set state to be used in any of the redo code safely. This method is always executed in the GUI thread and has no progress.

Reimplemented in Isis::ImportImagesWorkOrder, and Isis::ImportShapesWorkOrder.

◆ previous()

WorkOrder * Isis::WorkOrder::previous ( ) const

Gets the previous WorkOrder.

Returns
QPointer pointing to the previous WorkOrder.

References project().

Referenced by Isis::Project::lastNotUndoneWorkOrder(), Isis::Project::lastNotUndoneWorkOrder(), and redo().

◆ progressBar()

ProgressBar * Isis::WorkOrder::progressBar ( )

Returns the ProgressBar.

Returns
A QPointer to the ProgessBar.

References project().

Referenced by Isis::OpenProjectWorkOrder::setupExecution().

◆ progressMax()

int Isis::WorkOrder::progressMax ( ) const
protected

Gets the maximum value of the progress range of the WorkOrder.

Returns
int The maximum value.

References project().

◆ progressMin()

int Isis::WorkOrder::progressMin ( ) const
protected

Gets the minimum value of the progress range of the WorkOrder.

Returns
int The minimum value.

References project().

◆ progressValue()

int Isis::WorkOrder::progressValue ( ) const
protected

Gets the current progress value of the WorkOrder.

Returns
int Returns the current progress value.

References project().

◆ project()

Project * Isis::WorkOrder::project ( ) const
protected

Returns the Project this WorkOrder is attached to.

Returns
(Project *) A pointer to the Project.
Exceptions
IException::Programmer"This work order no longer has a project."

References _FILEINFO_, and Isis::IException::Programmer.

Referenced by addCloneToProject(), controlList(), correlationMatrix(), createsCleanState(), directory(), Isis::BundleObservationViewWorkOrder::execute(), Isis::CloseProjectWorkOrder::execute(), Isis::CnetEditorViewWorkOrder::execute(), Isis::ControlHealthMonitorWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::ExportControlNetWorkOrder::execute(), Isis::ExportImagesWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::ImportControlNetWorkOrder::execute(), Isis::ImportImagesWorkOrder::execute(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::ImportShapesWorkOrder::execute(), Isis::JigsawWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::OpenProjectWorkOrder::execute(), Isis::RemoveImagesWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), Isis::SensorGetInfoWorkOrder::execute(), Isis::SetActiveControlWorkOrder::execute(), Isis::SetActiveImageListWorkOrder::execute(), Isis::TargetGetInfoWorkOrder::execute(), Isis::TemplateEditViewWorkOrder::execute(), executionTime(), fileItem(), getTemplate(), guiCamera(), imageList(), internalData(), Isis::JigsawWorkOrder::isExecutable(), Isis::SetActiveControlWorkOrder::isExecutable(), Isis::SensorGetInfoWorkOrder::isExecutable(), Isis::SetActiveImageListWorkOrder::isExecutable(), Isis::TemplateEditViewWorkOrder::isExecutable(), Isis::TargetGetInfoWorkOrder::isExecutable(), isRedoing(), isRedone(), isSavedToHistory(), isSynchronous(), isUndoable(), isUndoing(), isUndone(), modifiesDiskState(), next(), Isis::ExportControlNetWorkOrder::postExecution(), Isis::ExportImagesWorkOrder::postExecution(), Isis::ImportControlNetWorkOrder::postExecution(), Isis::ImportImagesWorkOrder::postExecution(), Isis::ImportShapesWorkOrder::postExecution(), Isis::ImportImagesWorkOrder::postUndoExecution(), Isis::ImportShapesWorkOrder::postUndoExecution(), previous(), progressBar(), progressMax(), progressMin(), progressValue(), redo(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::CloseProjectWorkOrder::setupExecution(), Isis::CubeDnViewWorkOrder::setupExecution(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ExportImagesWorkOrder::setupExecution(), Isis::Footprint2DViewWorkOrder::setupExecution(), Isis::ImageFileListViewWorkOrder::setupExecution(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::MatrixViewWorkOrder::setupExecution(), Isis::OpenProjectWorkOrder::setupExecution(), Isis::RemoveImagesWorkOrder::setupExecution(), Isis::RenameProjectWorkOrder::setupExecution(), Isis::SaveProjectWorkOrder::setupExecution(), Isis::SetActiveControlWorkOrder::setupExecution(), shapeList(), statusText(), targetBody(), Isis::CnetEditorViewWorkOrder::undoExecution(), Isis::ImportImagesWorkOrder::undoExecution(), Isis::ImportMapTemplateWorkOrder::undoExecution(), Isis::ImportRegistrationTemplateWorkOrder::undoExecution(), Isis::ImportShapesWorkOrder::undoExecution(), Isis::MatrixViewWorkOrder::undoExecution(), Isis::RenameProjectWorkOrder::undoExecution(), and WorkOrder().

◆ read()

void Isis::WorkOrder::read ( XmlStackedHandlerReader * xmlReader)

Read this work order's data from disk.

◆ redo

void Isis::WorkOrder::redo ( )
virtualslot

Starts (or enqueues) a redo.

This should not be re-implemented by children.

References dependsOn(), execute(), finished(), imageList(), isRedoing(), isRedone(), isSynchronous(), isUndoing(), m_status, previous(), project(), shapeList(), statusChanged(), and WorkOrderRedoing.

◆ save()

void Isis::WorkOrder::save ( QXmlStreamWriter & stream) const

: Saves a WorkOrder to a data stream.

The XML output format looks like this:

  <workOrder actionText="..." undoText="..." type="..." status="...">
    <images>
      <image id="..." >
    </images>

    <internalDataValues>
      <dataValue value="..." >
    </internalDataValues>
  </workOrder>
Parameters

b QXmlStreamWriter stream The data stream we are saving the WorkOrder to.

Exceptions
IException::UnknownThis exception is thrown if save is called while the WorkOrder is currently running.

References _FILEINFO_, bestText(), m_status, NoContext, Isis::IException::Programmer, and toString().

Referenced by Isis::CloseProjectWorkOrder::setupExecution(), and Isis::OpenProjectWorkOrder::setupExecution().

◆ setCreatesCleanState()

void Isis::WorkOrder::setCreatesCleanState ( bool createsCleanState)
protected

Declare that this work order is saving the project.

This makes the work order not appear in the undo stack (cannot undo/redo), and instead it is marked as a 'clean' state of the project. The QUndoCommand undo/redo will never be called. The default for createsCleanState is false. If this is set to true all wrokorders before this call will be locked.

Parameters
createsCleanStateTrue if this work order is going to save the project to disk, False otherwise.

References createsCleanState().

Referenced by Isis::CloseProjectWorkOrder::CloseProjectWorkOrder(), Isis::OpenProjectWorkOrder::OpenProjectWorkOrder(), Isis::SaveProjectAsWorkOrder::SaveProjectAsWorkOrder(), and Isis::SaveProjectWorkOrder::SaveProjectWorkOrder().

◆ setData() [1/11]

void Isis::WorkOrder::setData ( Context context)
virtual

Sets the context data for this WorkOrder.

Parameters
contextThis is an enum variable with two values: NoContext,ProjectContext.

Referenced by Isis::ImageListActionWorkOrder::setData(), setData(), Isis::ExportControlNetWorkOrder::setupExecution(), and Isis::Directory::supportedActions().

◆ setData() [2/11]

void Isis::WorkOrder::setData ( ControlList * controls)
virtual

Sets the Control data for this WorkOrder.

Parameters
controls.A pointer to the Control

Sets the ControlList data for this WorkOrder.

Parameters
controls.A pointer to the ControlList (which is a list of control networks).

◆ setData() [3/11]

void Isis::WorkOrder::setData ( CorrelationMatrix correlationMatrix)
virtual

Sets the CorrelationMatrix data for this WorkOrder.

Parameters
correlationMatrixThe matrix data.

References correlationMatrix().

◆ setData() [4/11]

void Isis::WorkOrder::setData ( FileItemQsp fileItem)
virtual

Sets the FileItem data for this WorkOrder.

Parameters
FileItemA QSharedPointer to the FileItem.

References fileItem().

◆ setData() [5/11]

void Isis::WorkOrder::setData ( GuiCameraQsp guiCamera)
virtual

Sets the GuiCamera data for this WorkOrder.

Parameters
guiCameraA QSharedPointer to the GuiCamera.

References guiCamera().

◆ setData() [6/11]

void Isis::WorkOrder::setData ( ImageList * images)
virtual

Sets the ImageList data for this WorkOrder.

Parameters
imagesA pointer to the updated ImageList.

Reimplemented in Isis::ImageListActionWorkOrder.

◆ setData() [7/11]

◆ setData() [8/11]

void Isis::WorkOrder::setData ( QString data)
virtual

◆ setData() [9/11]

void Isis::WorkOrder::setData ( ShapeList * shapes)
virtual

Sets the ShapeList data for this WorkOrder.

Parameters
imagesA pointer to the updated ShapeList.

◆ setData() [10/11]

void Isis::WorkOrder::setData ( TargetBodyQsp targetBody)
virtual

Sets the TargetBody data for this WorkOrder.

Parameters
targetBodyA QSharedPointer to the TargetBody.

References targetBody().

◆ setData() [11/11]

void Isis::WorkOrder::setData ( Template * currentTemplate)
virtual

Sets the TargetBody data for this WorkOrder.

Parameters
targetBodyA QSharedPointer to the TargetBody.

◆ setInternalData()

void Isis::WorkOrder::setInternalData ( QStringList data)
protected

Sets the internal data for this WorkOrder.

WorkOrders may not use member variables to store data. Any data needed for the workorder should be saved in to the base WorkOrder using setInternalData.

Parameters
dataThe data to set the internal data to.

Referenced by Isis::ImageListActionWorkOrder::execute(), Isis::ImageListActionWorkOrder::ImageListActionWorkOrder(), Isis::ImportMapTemplateWorkOrder::isExecutable(), Isis::ImportRegistrationTemplateWorkOrder::isExecutable(), Isis::MosaicSceneWorkOrder::MosaicSceneWorkOrder(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::CubeDnViewWorkOrder::setupExecution(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ExportImagesWorkOrder::setupExecution(), Isis::Footprint2DViewWorkOrder::setupExecution(), Isis::ImageFileListViewWorkOrder::setupExecution(), Isis::ImportControlNetWorkOrder::setupExecution(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportMapTemplateWorkOrder::setupExecution(), Isis::ImportRegistrationTemplateWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), Isis::MatrixViewWorkOrder::setupExecution(), Isis::RenameProjectWorkOrder::setupExecution(), Isis::SaveProjectAsWorkOrder::setupExecution(), Isis::SensorGetInfoWorkOrder::setupExecution(), Isis::TargetGetInfoWorkOrder::setupExecution(), Isis::TemplateEditViewWorkOrder::setupExecution(), Isis::ImageListActionWorkOrder::setupExecution(), Isis::MosaicSceneWorkOrder::storeZPositions(), and Isis::ImageListActionWorkOrder::undoExecution().

◆ setModifiesDiskState()

void Isis::WorkOrder::setModifiesDiskState ( bool changesProjectOnDisk)
protected

◆ setNext()

void Isis::WorkOrder::setNext ( WorkOrder * nextWorkOrder)

Sets the next WorkOrder in the sequence.

Parameters
nextWorkOrderThe next WorkOrder.

◆ setPrevious()

void Isis::WorkOrder::setPrevious ( WorkOrder * previousWorkOrder)

Sets the previous WorkOrder in the sequence.

Parameters
previousWorkOrderThe previous WorkOrder.

◆ setProgressRange()

void Isis::WorkOrder::setProgressRange ( int minValue,
int maxValue )
protected

Sets the progress range of the WorkOrder.

Parameters
minValueThe progress range minimum value.
maxValueThe progress range maximum value.

Referenced by Isis::ExportImagesWorkOrder::execute(), and Isis::ImportControlNetWorkOrder::execute().

◆ setProgressValue()

void Isis::WorkOrder::setProgressValue ( int value)
protected

Sets the current progress value for the WorkOrder.

Parameters
intvalue The value to set the current progress to.

Referenced by Isis::ExportImagesWorkOrder::execute(), and Isis::ImportControlNetWorkOrder::execute().

◆ setupExecution

bool Isis::WorkOrder::setupExecution ( )
virtualslot

This sets up the state for the work order.

Child should implement this to get user input.

This method is designed to be implemented by children work orders, but they need to call the base class setupExecution (at the beginning).

State should only be set in the WorkOrder class in this method. You can set arbitrary state using setInternalData(). Call setData(ImageList), setInternalData(QStringList), etc... with all of the data/state necessary to perform the work order. This could be a list of file names, an ImageList of images you're viewing, or really anything else. This method is always executed in the GUI thread and is the only place to ask the user questions.

The actual work is done in execute(), using only state (data) stored in the WorkOrder class. You do not have to call execute() - this is done for you by WorkOrder::redo(). WorkOrder::redo() is called from Project::addToProject() when the workOrder is pushed onto the undo stack.

If this method returns false the workorder will be cancelled and will not be executed.

Returns
bool Returns True upon successful preparation of the WorkOrder, False if this operation should be cancelled (the user clicked cancel, the operation turns out to be impossible, etc). This prevents the work order from executing and it will not be entered into the history.

Reimplemented in Isis::BundleObservationViewWorkOrder, Isis::CloseProjectWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::ControlHealthMonitorWorkOrder, Isis::CubeDnViewWorkOrder, Isis::ExportControlNetWorkOrder, Isis::ExportImagesWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::ImportControlNetWorkOrder, Isis::ImportImagesWorkOrder, Isis::ImportMapTemplateWorkOrder, Isis::ImportRegistrationTemplateWorkOrder, Isis::ImportShapesWorkOrder, Isis::MatrixViewWorkOrder, Isis::OpenProjectWorkOrder, Isis::RemoveImagesWorkOrder, Isis::RenameProjectWorkOrder, Isis::SaveProjectAsWorkOrder, Isis::SaveProjectWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::SetActiveControlWorkOrder, Isis::SetActiveImageListWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::TemplateEditViewWorkOrder, Isis::ViewControlNet3DWorkOrder, and Isis::ImageListActionWorkOrder.

References createsCleanState(), isUndoable(), m_status, statusChanged(), and WorkOrderFinished.

Referenced by Isis::BundleObservationViewWorkOrder::setupExecution(), Isis::CloseProjectWorkOrder::setupExecution(), Isis::CnetEditorViewWorkOrder::setupExecution(), Isis::ControlHealthMonitorWorkOrder::setupExecution(), Isis::CubeDnViewWorkOrder::setupExecution(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ExportImagesWorkOrder::setupExecution(), Isis::Footprint2DViewWorkOrder::setupExecution(), Isis::ImageFileListViewWorkOrder::setupExecution(), Isis::ImportControlNetWorkOrder::setupExecution(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportMapTemplateWorkOrder::setupExecution(), Isis::ImportRegistrationTemplateWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), Isis::MatrixViewWorkOrder::setupExecution(), Isis::OpenProjectWorkOrder::setupExecution(), Isis::RemoveImagesWorkOrder::setupExecution(), Isis::RenameProjectWorkOrder::setupExecution(), Isis::SaveProjectAsWorkOrder::setupExecution(), Isis::SaveProjectWorkOrder::setupExecution(), Isis::SensorGetInfoWorkOrder::setupExecution(), Isis::SetActiveControlWorkOrder::setupExecution(), Isis::SetActiveImageListWorkOrder::setupExecution(), Isis::TargetGetInfoWorkOrder::setupExecution(), Isis::TemplateEditViewWorkOrder::setupExecution(), Isis::ViewControlNet3DWorkOrder::setupExecution(), and Isis::ImageListActionWorkOrder::setupExecution().

◆ shapeList() [1/2]

ShapeList * Isis::WorkOrder::shapeList ( )
protected

@briefReturns a pointer to the ShapeList for this WorkOrder.

Returns
(ShapeList*) A pointer to the ShapeList.

References project(), and Isis::Project::shape().

Referenced by isExecutable(), redo(), setData(), and shapeList().

◆ shapeList() [2/2]

const ShapeList * Isis::WorkOrder::shapeList ( ) const
protected

A thread-safe method for retrieving a pointer to the shapeList.

Returns
(ShapeList *) A pointer to the shape list for this WorkOrder.

References shapeList().

◆ statusChanged

void Isis::WorkOrder::statusChanged ( WorkOrder * )
signal

Referenced by redo(), setupExecution(), and undo().

◆ statusText()

QString Isis::WorkOrder::statusText ( ) const

WorkOrder::statusText.

Returns
QString A string representation of the current WorkOrder status.

References m_status, project(), and toString().

◆ targetBody()

◆ toString()

QString Isis::WorkOrder::toString ( WorkOrderStatus status)
static

Gets the current status of the WorkOrder.

Parameters
statusAn enumeration of all possible WorkOrder states.
Returns
QString Returns a string representation of the current status of the WorkOrder.

References WorkOrderFinished, WorkOrderNotStarted, WorkOrderRedoing, WorkOrderRedone, WorkOrderUndoing, WorkOrderUndone, and WorkOrderUnknownStatus.

Referenced by fromStatusString(), save(), and statusText().

◆ undo

void Isis::WorkOrder::undo ( )
virtualslot

Starts (or enqueues) an undo.

This should not be re-implemented by children.

References finished(), isRedoing(), isSynchronous(), isUndoing(), isUndone(), m_status, statusChanged(), undoExecution(), WorkOrderNotStarted, and WorkOrderUndoing.

◆ undoExecution()

void Isis::WorkOrder::undoExecution ( )
protectedvirtual

Execute the steps necessary to undo this workorder.

The workorder should have all state necessary to undo itself stored in the workorder.

For synchronous workorders: State should only be read from the parent WorkOrder class in this method. You can set state to be used in postUndoExecution() safely. This method is always executed in the GUI thread and has no progress.

For Asynchronous workorders: State can be read from the parent WorkOrder class while in this method. You can set state to be used in postSyncUndo() safely. Please be wary of deleting QObjects inside of this method because they will cause unpredictable crashes. This method is never executed in the GUI thread. You can update progress by calling setProgressRange() and setProgressValue(). Do not manipulate any GUI objects here.

Reimplemented in Isis::CnetEditorViewWorkOrder, Isis::ImportImagesWorkOrder, Isis::ImportMapTemplateWorkOrder, Isis::ImportRegistrationTemplateWorkOrder, Isis::ImportShapesWorkOrder, Isis::MatrixViewWorkOrder, Isis::RenameProjectWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::ImageListActionWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Referenced by undo().

Member Data Documentation

◆ m_isSavedToHistory

◆ m_isSynchronous

bool Isis::WorkOrder::m_isSynchronous
protected

This is defaulted to true.

If true, the work order will be executed on the GUI thread synchronously. If false, then the work order will be queued for execution on a non-GUI thread and will not block the GUI.

Referenced by Isis::ExportControlNetWorkOrder::ExportControlNetWorkOrder(), Isis::ExportImagesWorkOrder::ExportImagesWorkOrder(), Isis::ImportControlNetWorkOrder::ImportControlNetWorkOrder(), Isis::ImportImagesWorkOrder::ImportImagesWorkOrder(), Isis::ImportShapesWorkOrder::ImportShapesWorkOrder(), isSynchronous(), WorkOrder(), and WorkOrder().

◆ m_isUndoable

bool Isis::WorkOrder::m_isUndoable
protected

Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to be redone.

Note the workorder undoExecution() method must be implemented. This will result on the workorder being placed on the QUndoStack and being displayed in the history as being undoable. If set to false, the work order will not be put on the QUndoStack and the workorder will not be able to be undone.

Referenced by Isis::BundleObservationViewWorkOrder::BundleObservationViewWorkOrder(), Isis::BundleObservationViewWorkOrder::BundleObservationViewWorkOrder(), Isis::CloseProjectWorkOrder::CloseProjectWorkOrder(), Isis::CnetEditorViewWorkOrder::CnetEditorViewWorkOrder(), Isis::ControlHealthMonitorWorkOrder::ControlHealthMonitorWorkOrder(), Isis::CubeDnViewWorkOrder::CubeDnViewWorkOrder(), Isis::ExportControlNetWorkOrder::ExportControlNetWorkOrder(), Isis::ExportImagesWorkOrder::ExportImagesWorkOrder(), Isis::Footprint2DViewWorkOrder::Footprint2DViewWorkOrder(), Isis::Footprint2DViewWorkOrder::Footprint2DViewWorkOrder(), Isis::ImageFileListViewWorkOrder::ImageFileListViewWorkOrder(), Isis::ImportControlNetWorkOrder::ImportControlNetWorkOrder(), Isis::ImportMapTemplateWorkOrder::ImportMapTemplateWorkOrder(), Isis::ImportRegistrationTemplateWorkOrder::ImportRegistrationTemplateWorkOrder(), Isis::ImportShapesWorkOrder::ImportShapesWorkOrder(), isUndoable(), Isis::JigsawWorkOrder::JigsawWorkOrder(), Isis::OpenProjectWorkOrder::OpenProjectWorkOrder(), Isis::RemoveImagesWorkOrder::RemoveImagesWorkOrder(), Isis::RemoveImagesWorkOrder::RemoveImagesWorkOrder(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::RenameProjectWorkOrder::RenameProjectWorkOrder(), Isis::SaveProjectAsWorkOrder::SaveProjectAsWorkOrder(), Isis::SensorGetInfoWorkOrder::SensorGetInfoWorkOrder(), Isis::SetActiveControlWorkOrder::SetActiveControlWorkOrder(), Isis::SetActiveImageListWorkOrder::SetActiveImageListWorkOrder(), Isis::TargetGetInfoWorkOrder::TargetGetInfoWorkOrder(), Isis::TemplateEditViewWorkOrder::TemplateEditViewWorkOrder(), WorkOrder(), and WorkOrder().

◆ m_status


The documentation for this class was generated from the following files: