Isis 3.0 Programmer Reference
Back | Home
Isis::WorkOrder Class Referenceabstract

Parent class for anything that performs an action in Project. More...

#include <WorkOrder.h>

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

Classes

class  XmlHandler
 This class is used for processing an XML file containing information about a WorkOrder. More...
 

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

virtual bool execute ()
 The (child) implementation of this method should prompt the user/gather state by any means necessary. More...
 
virtual void redo ()
 Starts (or enqueues) a redo. More...
 
virtual void undo ()
 Starts (or enqueues) an undo. More...
 

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. More...
 
virtual ~WorkOrder ()
 The Destructor. More...
 
virtual WorkOrderclone () const =0
 
virtual bool isExecutable (Context)
 Re-implement this method if your work order utilizes controls for data in order to operate. More...
 
virtual bool isExecutable (ImageList *images)
 Re-implement this method if your work order utilizes images for data in order to operate. More...
 
virtual bool isExecutable (ShapeList *shapes)
 Re-implement this method if your work order utilizes shapes for data in order to operate. More...
 
virtual bool isExecutable (ControlList *controls)
 Re-implement this method if your work order utilizes a control for data in order to operate. More...
 
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. More...
 
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. More...
 
virtual bool isExecutable (ProjectItem *item)
 Determines if the WorkOrder is execuatable on the data stored in a ProjectItem. More...
 
void read (XmlStackedHandlerReader *xmlReader)
 Read this work order's data from disk. More...
 
void save (QXmlStreamWriter &stream) const
 : Saves a WorkOrder to a data stream. More...
 
virtual void setData (Context)
 Sets the context data for this WorkOrder. More...
 
virtual void setData (ImageList *images)
 Sets the ImageList data for this WorkOrder. More...
 
virtual void setData (ShapeList *shapes)
 Sets the ShapeList data for this WorkOrder. More...
 
virtual void setData (ControlList *controls)
 Sets the Control data for this WorkOrder. More...
 
virtual void setData (CorrelationMatrix)
 Sets the CorrelationMatrix data for this WorkOrder. More...
 
virtual void setData (TargetBodyQsp targetBody)
 Sets the TargetBody data for this WorkOrder. More...
 
virtual void setData (GuiCameraQsp guiCamera)
 Sets the GuiCamera data for this WorkOrder. More...
 
virtual void setData (ProjectItem *item)
 Sets the internal data to the data stored in a ProjectItem. More...
 
void setNext (WorkOrder *nextWorkOrder)
 Sets the next WorkOrder in the sequence. More...
 
void setPrevious (WorkOrder *previousWorkOrder)
 Sets the previous WorkOrder in the sequence. More...
 
QString bestText () const
 We don't use action text anymore because Directory likes to rename our actions. More...
 
bool createsCleanState () const
 Returns the CleanState status (whether the Project has been saved to disk or not). More...
 
QDateTime executionTime () const
 Gets the execution time of this WorkOrder. More...
 
bool isFinished () const
 Returns the finished state of this WorkOrder. More...
 
bool isRedoing () const
 Returns the redoing status of this WorkOrder. More...
 
bool isRedone () const
 Returns the WorkOrder redone status. More...
 
bool isUndoing () const
 Returns the WorkOrderUndoing state. More...
 
bool isUndone () const
 Returns the WorkOrder undo status. More...
 
bool modifiesDiskState () const
 Returns the modified disk state. More...
 
WorkOrdernext () const
 Gets the next WorkOrder. More...
 
WorkOrderprevious () const
 Gets the previous WorkOrder. More...
 
QString statusText () const
 WorkOrder::statusText. More...
 
ProgressBarprogressBar ()
 Returns the ProgressBar. More...
 

Static Public Member Functions

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

Protected Slots

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

Protected Member Functions

 WorkOrder (const WorkOrder &other)
 Copy the work order 'other' into this (new) instance. More...
 
ImageListimageList ()
 a pointer to the ImageList for this WorkOrder. More...
 
const ImageListimageList () const
 A thread-safe method for retrieving a pointer to the imageList. More...
 
ShapeListshapeList ()
 a pointer to the ShapeList for this WorkOrder. More...
 
const ShapeListshapeList () const
 A thread-safe method for retrieving a pointer to the shapeList. More...
 
CorrelationMatrix correlationMatrix ()
 Returns the CorrleationMatrix for this WorkOrder. More...
 
QPointer< ControlListcontrolList ()
 Returns the Control List for this WorkOrder (a list of control networks). More...
 
TargetBodyQsp targetBody ()
 WorkOrder::targetBody. More...
 
GuiCameraQsp guiCamera ()
 WorkOrder::guiCamera. More...
 
virtual bool dependsOn (WorkOrder *other) const
 This is a virtual function whose role in child classes is to determine if this WorkOrder deppends on the WorkOrder passed in as an argument. More...
 
Directorydirectory () const
 Returns the Directory object of the Project this WorkOrder is attached to. More...
 
Projectproject () const
 Returns the Project this WorkOrder is attached to. More...
 
void setCreatesCleanState (bool createsCleanState)
 Declare that this work order is saving the project. More...
 
void setModifiesDiskState (bool changesProjectOnDisk)
 . More...
 
void setInternalData (QStringList data)
 Sets the internal data for this WorkOrder. More...
 
int progressMin () const
 Gets the minimum value of the progress range of the WorkOrder. More...
 
int progressMax () const
 Gets the maximum value of the progress range of the WorkOrder. More...
 
int progressValue () const
 Gets the current progress value of the WorkOrder. More...
 
void setProgressRange (int, int)
 Sets the progress range of the WorkOrder. More...
 
void setProgressValue (int)
 Sets the current progress value for the WorkOrder. More...
 
QStringList internalData () const
 Gets the internal data for this WorkOrder. More...
 
virtual void syncRedo ()
 This method is designed to be implemented by children work orders. More...
 
virtual void asyncRedo ()
 This method is designed to be implemented by children work orders. More...
 
virtual void postSyncRedo ()
 This method is designed to be implemented by children work orders. More...
 
virtual void syncUndo ()
 This method is designed to be implemented by children work orders. More...
 
virtual void asyncUndo ()
 This method is designed to be implemented by children work orders. More...
 
virtual void postSyncUndo ()
 This method is designed to be implemented by children work orders. More...
 

Private Types

enum  QueuedWorkOrderAction { NoQueuedAction, RedoQueuedAction, UndoQueuedAction }
 This enum describes the current state of a Queued WorkOrder. More...
 

Private Slots

void attemptQueuedAction ()
 Attempts to execute an action on the action action queue. More...
 
void asyncFinished ()
 Signals the Project that the WorkOrder is finished, deletes the update time for the Progress bar, and sets the finished status. More...
 
void clearImageList ()
 Clears the list of images. More...
 
void clearShapeList ()
 Clears the list of shapes. More...
 
void deleteProgress ()
 Deletes the progress bar. More...
 
void updateProgress ()
 Updates the progress bar. More...
 
void startRedo ()
 WorkOrder::startRedo This function is currently empty. More...
 

Private Member Functions

bool isInStableState () const
 Determines if the WorkOrder is in a stable state, or if it's busy doing something. More...
 
void listenForImageDestruction ()
 Checks to see if we have lost any images in the ImageList. More...
 
void listenForShapeDestruction ()
 Checks to see if we have lost any shapes in the ShapeList. More...
 
void resetProgressBar ()
 Resets the ProgressBar. More...
 
void setProgressToFinalText ()
 Sets the ProgressBar to display the final status of the operation. More...
 
WorkOrderoperator= (const WorkOrder &rhs)
 

Private Attributes

bool m_createsCleanState
 This is defaulted to false. More...
 
bool m_modifiesDiskState
 This is defaulted to false. More...
 
WorkOrderStatus m_status
 
QueuedWorkOrderAction m_queuedAction
 
int m_progressRangeMinValue
 The miniumum value of the Progess Bar. More...
 
int m_progressRangeMaxValue
 The maximum value of the Progess Bar. More...
 
int m_progressValue
 The current value of the Progress Bar. More...
 
Context m_context
 
QPointer< ImageListm_imageList
 
QPointer< ShapeListm_shapeList
 
QPointer< ControlListm_controlList
 
CorrelationMatrix m_correlationMatrix
 
GuiCameraQsp m_guiCamera
 A QSharedPointer to the GuiCamera (the Camera object but encapsulated within a Gui framework. More...
 
TargetBodyQsp m_targetBody
 A QSharedPointer to the TargetBody (A Target object but encapsulated within a Gui framework. More...
 
QStringList m_imageIds
 A QStringList of unique image identifiers for all of the images this WorkOrder is dealing with. More...
 
QStringList m_shapeIds
 A QStringList of unique shape identifiers for all of the shapes this WorkOrder is dealing with. More...
 
QStringList m_internalData
 A QStringList of internal properties for this WorkOrder. More...
 
QPointer< WorkOrderm_nextWorkOrder
 A pointer to the next WorkOrder in the queue. More...
 
QPointer< WorkOrderm_previousWorkOrder
 A pointer to the previous WorkOrder in the queue. More...
 
QPointer< Projectm_project
 A pointer to the Project this WorkOrder is attached to. More...
 
QMutex * m_transparentConstMutex
 This is used to protect the integrity of data the WorkOrder is working on so that only one thread at a time cann access it. More...
 
QDateTime m_executionTime
 This is the date/time that execute() was called. More...
 
QPointer< QFutureWatcher< void > > m_futureWatcher
 A pointer to a QFutureWatcher object which monitors a QFuture object using signals and slots. More...
 
QPointer< ProgressBarm_progressBar
 A pointer to the ProgressBar. More...
 
QPointer< QTimer > m_progressBarUpdateTimer
 A pointer to the QTimer which updates the ProgressBar. More...
 
QPointer< QTimer > m_progressBarDeletionTimer
 A pointer to the ProgressBar deletion timer. More...
 
QTime * m_elapsedTimer
 A QTime object holding the excecution time of the WorkOrder. More...
 
double m_secondsElapsed
 The seconds that have elapsed since the WorkOrder started executing. More...
 

Detailed Description

Parent class for anything that performs an action in Project.

This class should be used for any operation that affects a Project. This provides history, undo/redo capabilities (which need to be implemented correctly), and the ability for the project to guarantee a good state on disk.

State between the end of execute() and the beginning of the redo methods must be saved via the parent (WorkOrder) class. This is to ensure serializability. State between the redo methods and undo methods should work the same way. Child implementations may only save state (have member variables) that store state between syncRedo(), asyncRedo() and postSyncRedo() OR between syncUndo(), asyncUndo() and postSyncUndo(). Other forms of state will cause the work order to not function properly when saved/restored from disk.

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

2012-08-23 Steven Lambright and Stuart Sides - Updated the class to be much more flushed out. We now have WorkOrderStatus, syncRedo(), asyncRedo(), postSyndRedo() (also undo versions), dependsOn(), full dependency analysis, full progress/status strings, no more race conditions in undo/redo, the work order list is now doubly-linked, and added the statusChanged() signal. redo() and undo() should no longer cause any bad or undesired behavior.

2012-09-19 Steven Lambright - Added QList<Control *> data support for in-memory controls. I did not yet do the serialization because we're working on a "ControlList" class that may encapsulate some of the implementation (maybe, we'll see).

2012-10-19 Steven Lambright - Removed parent argument from constructor - deleting work orders when the creator goes away doesn't make sense. Also work orders will work correctly when the associated images are freed from memory and later re-allocated (the import of the images was undone, for example). Added elapsed time value to the status text and fixed warning for work orders without undo text. Added listenForImageDestruction() and clearImageList().

2013-04-25 Jeannie Backer - Modified call to qWarning() to prevent compile warnings on MAC OS 10.8.2

2014-07-14 Kimberly Oyama - Added support for correlation matrix.

2015-06-12 Ken Edmundson - Added support for target body.

2015-10-05 Jeffrey Covington - Added support for ProjectItem. Added new methods to support the types used by ProjectItem. Marked old methods as deprecated.

2016-01-04 Jeffrey Covington - Improved support for ProjectItem.

2016-06-13 Tyler Wilson - Added documentation to many of the member functions in this class. Fixes #3956.

2016-06-22 Tyler Wilson - Removed all references to deprecated functions/member variables. Fixes #4052.

2016-07-26 Tracie Sucharski - Added functionality for ShapeList.

Definition at line 104 of file WorkOrder.h.

Member Enumeration Documentation

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

Definition at line 132 of file WorkOrder.h.

This enum describes the current state of a Queued WorkOrder.

Definition at line 285 of file WorkOrder.h.

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

Enumerator
WorkOrderFinished 

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

Definition at line 114 of file WorkOrder.h.

Constructor & Destructor Documentation

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.

Definition at line 55 of file WorkOrder.cpp.

References _FILEINFO_, addCloneToProject(), asyncFinished(), m_createsCleanState, m_elapsedTimer, m_futureWatcher, m_guiCamera, m_modifiesDiskState, m_progressRangeMaxValue, m_progressRangeMinValue, m_progressValue, m_project, m_secondsElapsed, m_targetBody, m_transparentConstMutex, Isis::IException::Programmer, and project().

Isis::WorkOrder::~WorkOrder ( )
virtual
Isis::WorkOrder::WorkOrder ( const WorkOrder other)
protected

Member Function Documentation

void Isis::WorkOrder::addCloneToProject ( )
protectedslot

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

Definition at line 1294 of file WorkOrder.cpp.

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

Referenced by WorkOrder().

void Isis::WorkOrder::asyncFinished ( )
privateslot

Signals the Project that the WorkOrder is finished, deletes the update time for the Progress bar, and sets the finished status.

Definition at line 1436 of file WorkOrder.cpp.

References attemptQueuedAction(), isUndoing(), m_elapsedTimer, m_progressBarUpdateTimer, m_secondsElapsed, postSyncRedo(), postSyncUndo(), and setProgressToFinalText().

Referenced by WorkOrder().

void Isis::WorkOrder::asyncRedo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for redo is: syncRedo() - GUI thread asyncRedo() - Pooled thread* postSyncRedo() - GUI thread

State can be read from the parent WorkOrder class and from state set in syncRedo() while in this method. You can set state to be used in postSyncRedo() 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(). This method is never executed in the GUI thread. You can update progress by calling setProgressRange() and setProgressValue(). Please do not manipulate any GUI objects here.

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

Definition at line 1222 of file WorkOrder.cpp.

Referenced by redo().

void Isis::WorkOrder::asyncUndo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for undo is: syncUndo() - GUI thread asyncUndo() - Pooled thread* postSyncUndo() - GUI thread

State can be read from the parent WorkOrder class and from state set in syncUndo() 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(). Please do not manipulate any GUI objects here.

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

Definition at line 1271 of file WorkOrder.cpp.

Referenced by undo().

void Isis::WorkOrder::attemptQueuedAction ( )
privateslot

Attempts to execute an action on the action action queue.

Definition at line 1419 of file WorkOrder.cpp.

References redo(), and undo().

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

QString Isis::WorkOrder::bestText ( ) const

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.

Definition at line 701 of file WorkOrder.cpp.

Referenced by Isis::HistoryTreeWidget::addToHistory(), redo(), save(), and undo().

void Isis::WorkOrder::clearImageList ( )
privateslot

Clears the list of images.

Definition at line 1467 of file WorkOrder.cpp.

Referenced by listenForImageDestruction().

void Isis::WorkOrder::clearShapeList ( )
privateslot

Clears the list of shapes.

Definition at line 1475 of file WorkOrder.cpp.

Referenced by listenForShapeDestruction().

QPointer< ControlList > Isis::WorkOrder::controlList ( )
protected
CorrelationMatrix Isis::WorkOrder::correlationMatrix ( )
protected

Returns the CorrleationMatrix for this WorkOrder.

Returns
A CorrelationMatrix.

Definition at line 628 of file WorkOrder.cpp.

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

bool Isis::WorkOrder::createsCleanState ( ) const

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

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

Definition at line 721 of file WorkOrder.cpp.

References m_createsCleanState.

Referenced by Isis::HistoryTreeWidget::addToHistory(), Isis::Project::addToProject(), execute(), and setCreatesCleanState().

void Isis::WorkOrder::deleteProgress ( )
privateslot

Deletes the progress bar.

Definition at line 1483 of file WorkOrder.cpp.

References m_progressBar.

Referenced by setProgressToFinalText().

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

This is a virtual function whose role in child classes is to determine if this WorkOrder deppends 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::Footprint2DViewWorkOrder, Isis::CubeDnViewWorkOrder, Isis::RenameProjectWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::MatrixViewWorkOrder, Isis::JigsawWorkOrder, and Isis::CnetEditorViewWorkOrder.

Definition at line 688 of file WorkOrder.cpp.

Referenced by redo().

Directory * Isis::WorkOrder::directory ( ) const
protected
bool Isis::WorkOrder::execute ( )
virtualslot

The (child) implementation of this method should prompt the user/gather state by any means necessary.

This method is designed to be implemented by children work orders, but they need to call this version inside of their execute (at the beginning).

Prompts for file names, questions, warnings, etc.. should be done here.

Once the work order has enough data to execute, this method needs to set the state in the parent (this) WorkOrder class. 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.

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

We do it this way to ensure saving/restoring from history can be done automatically/simply and implemented only once per data type. This also gives us full undo/redo functionality.

Returns
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 making it into the history and redo will never be called.

The order of execution for work orders is: execute() - GUI thread, can ask user for input* syncRedo() - GUI thread, should not prompt the user for input asyncRedo() - Pooled thread postSyncRedo() - GUI thread

syncUndo() - GUI thread, always called after redo finishes asyncUndo() - Pooled thread postSyncUndo() - GUI thread

syncRedo() - GUI thread asyncRedo() - Pooled thread postSyncRedo() - GUI thread

and so on...

State should only be set in the parent WorkOrder class in this method. You can set arbitrary state using setInternalData(). This method is always executed in the GUI thread and is the only place to ask the user questions.

Returns
bool Returns True upon successful execution of the WorkOrder, False otherwise.

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

Definition at line 1078 of file WorkOrder.cpp.

References createsCleanState(), m_executionTime, m_progressBar, resetProgressBar(), setProgressToFinalText(), and WorkOrderFinished.

Referenced by Isis::Project::addToProject(), Isis::ExportControlNetWorkOrder::execute(), Isis::ExportImagesWorkOrder::execute(), Isis::CnetEditorViewWorkOrder::execute(), Isis::CloseProjectWorkOrder::execute(), Isis::JigsawWorkOrder::execute(), Isis::RemoveImagesWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::SetActiveImageListWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::SetActiveControlWorkOrder::execute(), Isis::ViewControlNet3DWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::OpenProjectWorkOrder::execute(), Isis::SensorGetInfoWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), Isis::SaveProjectWorkOrder::execute(), Isis::TargetGetInfoWorkOrder::execute(), Isis::ImportControlNetWorkOrder::execute(), Isis::OpenRecentProjectWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::ImportShapesWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImportImagesWorkOrder::execute(), and Isis::ImageListActionWorkOrder::execute().

QDateTime Isis::WorkOrder::executionTime ( ) const

Gets the execution time of this WorkOrder.

Returns
QDateTime The execution time.

Definition at line 730 of file WorkOrder.cpp.

References m_executionTime.

Referenced by Isis::HistoryTreeWidget::addToHistory(), and Isis::WorkOrder::XmlHandler::startElement().

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.

Definition at line 844 of file WorkOrder.cpp.

References toString().

Referenced by Isis::WorkOrder::XmlHandler::startElement().

GuiCameraQsp Isis::WorkOrder::guiCamera ( )
protected

WorkOrder::guiCamera.

Returns
QSharedPointer Returns a shared pointer to the guiCamera.

Definition at line 675 of file WorkOrder.cpp.

References m_guiCamera.

Referenced by Isis::SensorGetInfoWorkOrder::execute(), setData(), and Isis::SensorGetInfoWorkOrder::syncRedo().

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.

Definition at line 646 of file WorkOrder.cpp.

References imageList(), and m_transparentConstMutex.

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

Gets the internal data for this WorkOrder.

Returns
QStringList Returns the internal data object.

Definition at line 1186 of file WorkOrder.cpp.

References m_internalData.

Referenced by Isis::ExportControlNetWorkOrder::asyncRedo(), Isis::ExportImagesWorkOrder::asyncRedo(), Isis::ImportShapesWorkOrder::asyncRedo(), Isis::ImportImagesWorkOrder::asyncRedo(), Isis::ExportControlNetWorkOrder::execute(), Isis::ExportImagesWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::SensorGetInfoWorkOrder::execute(), Isis::TargetGetInfoWorkOrder::execute(), Isis::ImportControlNetWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImageListActionWorkOrder::execute(), Isis::ImageListActionWorkOrder::ImageListActionWorkOrder(), Isis::ImportImagesWorkOrder::importConfirmedImages(), Isis::ImportShapesWorkOrder::importConfirmedShapes(), Isis::MosaicSceneWorkOrder::restoreZPositions(), Isis::MosaicSceneWorkOrder::scene(), Isis::ImageListActionWorkOrder::setData(), Isis::ImageFileListViewWorkOrder::syncRedo(), Isis::RenameProjectWorkOrder::syncRedo(), Isis::ImportControlNetWorkOrder::syncRedo(), Isis::CubeDnViewWorkOrder::syncRedo(), Isis::Footprint2DViewWorkOrder::syncRedo(), Isis::ImageListActionWorkOrder::syncRedo(), Isis::MatrixViewWorkOrder::syncUndo(), Isis::ImageFileListViewWorkOrder::syncUndo(), Isis::RenameProjectWorkOrder::syncUndo(), and Isis::ImageListActionWorkOrder::syncUndo().

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.

Definition at line 179 of file WorkOrder.cpp.

Referenced by isExecutable(), and Isis::Directory::supportedActions().

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::ImageListActionWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::CubeDnViewWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::SetActiveImageListWorkOrder, Isis::RemoveImagesWorkOrder, and Isis::ExportImagesWorkOrder.

Definition at line 193 of file WorkOrder.cpp.

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::Footprint2DViewWorkOrder, and Isis::CubeDnViewWorkOrder.

Definition at line 207 of file WorkOrder.cpp.

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::SetActiveControlWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::CnetEditorViewWorkOrder, and Isis::ExportControlNetWorkOrder.

Definition at line 231 of file WorkOrder.cpp.

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.

Definition at line 374 of file WorkOrder.cpp.

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.

Definition at line 386 of file WorkOrder.cpp.

bool Isis::WorkOrder::isFinished ( ) const

Returns the finished state of this WorkOrder.

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

Definition at line 739 of file WorkOrder.cpp.

References WorkOrderFinished.

Referenced by redo(), and undo().

bool Isis::WorkOrder::isInStableState ( ) const
private

Determines if the WorkOrder is in a stable state, or if it's busy doing something.

Returns
bool Returns True if the WorkOrder is in a stable state, and False if it is not.

Definition at line 1305 of file WorkOrder.cpp.

References isRedoing(), and isUndoing().

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

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.

Definition at line 748 of file WorkOrder.cpp.

Referenced by isInStableState(), redo(), undo(), and updateProgress().

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.

Definition at line 757 of file WorkOrder.cpp.

Referenced by redo(), and setProgressToFinalText().

bool Isis::WorkOrder::isUndoing ( ) const

Returns the WorkOrderUndoing state.

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

Definition at line 766 of file WorkOrder.cpp.

Referenced by asyncFinished(), isInStableState(), redo(), undo(), and updateProgress().

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.

Definition at line 775 of file WorkOrder.cpp.

Referenced by setProgressToFinalText(), and undo().

void Isis::WorkOrder::listenForImageDestruction ( )
private

Checks to see if we have lost any images in the ImageList.

If we have, then destroy the entire list. This will send a signal that the list needs to be rebuilt if requested.

Definition at line 1321 of file WorkOrder.cpp.

References clearImageList(), Isis::Image::id(), and m_imageIds.

Referenced by imageList(), setData(), and WorkOrder().

void Isis::WorkOrder::listenForShapeDestruction ( )
private

Checks to see if we have lost any shapes in the ShapeList.

If we have, then destroy the entire list. This will send a signal that the list needs to be rebuilt if requested.

TODO 2016-07-26 TLS Combine this with listenForImageDestruction() - Basically duplicate code.

Definition at line 1344 of file WorkOrder.cpp.

References clearShapeList(), Isis::Shape::id(), and m_shapeIds.

Referenced by setData(), shapeList(), and WorkOrder().

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.

Definition at line 785 of file WorkOrder.cpp.

References m_modifiesDiskState.

Referenced by Isis::Project::~Project().

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

Gets the next WorkOrder.

Returns
QPointer pointing to the next WorkOrder.

Definition at line 794 of file WorkOrder.cpp.

References m_nextWorkOrder.

Referenced by undo().

void Isis::WorkOrder::postSyncRedo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for redo is: syncRedo() - GUI thread asyncRedo() - Pooled thread postSyncRedo() - GUI thread*

State can be read from the parent WorkOrder class and from state set in either syncRedo() 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::ImportImagesWorkOrder, Isis::ImportShapesWorkOrder, Isis::ImportControlNetWorkOrder, Isis::ExportImagesWorkOrder, and Isis::ExportControlNetWorkOrder.

Definition at line 1238 of file WorkOrder.cpp.

Referenced by asyncFinished().

void Isis::WorkOrder::postSyncUndo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for undo is: syncUndo() - GUI thread asyncUndo() - Pooled thread postSyncUndo() - GUI thread*

State can be read from the parent WorkOrder class and from state set in either syncUndo() or asyncUndo() 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.

Definition at line 1287 of file WorkOrder.cpp.

Referenced by asyncFinished().

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

Gets the previous WorkOrder.

Returns
QPointer pointing to the previous WorkOrder.

Definition at line 803 of file WorkOrder.cpp.

References m_previousWorkOrder.

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

ProgressBar * Isis::WorkOrder::progressBar ( )

Returns the ProgressBar.

Returns
A QPointer to the ProgessBar.

Definition at line 832 of file WorkOrder.cpp.

References m_progressBar.

Referenced by Isis::HistoryTreeWidget::addToHistory(), Isis::OpenProjectWorkOrder::execute(), and Isis::HistoryTreeWidget::updateProgressWidgets().

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

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

Returns
int The maximum value.

Definition at line 1148 of file WorkOrder.cpp.

References m_progressRangeMaxValue.

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

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

Returns
int The minimum value.

Definition at line 1139 of file WorkOrder.cpp.

References m_progressRangeMinValue.

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

Gets the current progress value of the WorkOrder.

Returns
int Returns the current progress value.

Definition at line 1157 of file WorkOrder.cpp.

References m_progressValue.

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."

Definition at line 1116 of file WorkOrder.cpp.

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

Referenced by addCloneToProject(), Isis::ExportControlNetWorkOrder::asyncRedo(), Isis::ExportImagesWorkOrder::asyncRedo(), Isis::ImportShapesWorkOrder::asyncUndo(), Isis::ImportImagesWorkOrder::asyncUndo(), directory(), Isis::ExportControlNetWorkOrder::execute(), Isis::ExportImagesWorkOrder::execute(), Isis::JigsawWorkOrder::execute(), Isis::MatrixViewWorkOrder::execute(), Isis::SetActiveImageListWorkOrder::execute(), Isis::OpenProjectWorkOrder::execute(), Isis::RenameProjectWorkOrder::execute(), Isis::SetActiveControlWorkOrder::execute(), Isis::ImageFileListViewWorkOrder::execute(), Isis::SaveProjectAsWorkOrder::execute(), Isis::SaveProjectWorkOrder::execute(), Isis::OpenRecentProjectWorkOrder::execute(), Isis::CubeDnViewWorkOrder::execute(), Isis::Footprint2DViewWorkOrder::execute(), Isis::ImportImagesWorkOrder::execute(), imageList(), Isis::ImportImagesWorkOrder::importConfirmedImages(), Isis::ImportShapesWorkOrder::importConfirmedShapes(), Isis::JigsawWorkOrder::isExecutable(), Isis::SetActiveImageListWorkOrder::isExecutable(), Isis::SetActiveControlWorkOrder::isExecutable(), Isis::SensorGetInfoWorkOrder::isExecutable(), Isis::TargetGetInfoWorkOrder::isExecutable(), Isis::ExportControlNetWorkOrder::postSyncRedo(), Isis::ExportImagesWorkOrder::postSyncRedo(), Isis::ImportShapesWorkOrder::postSyncRedo(), Isis::ImportImagesWorkOrder::postSyncRedo(), Isis::ImportShapesWorkOrder::postSyncUndo(), Isis::ImportImagesWorkOrder::postSyncUndo(), redo(), shapeList(), Isis::CnetEditorViewWorkOrder::syncRedo(), Isis::RemoveImagesWorkOrder::syncRedo(), Isis::MatrixViewWorkOrder::syncRedo(), Isis::ImageFileListViewWorkOrder::syncRedo(), Isis::SensorGetInfoWorkOrder::syncRedo(), Isis::TargetGetInfoWorkOrder::syncRedo(), Isis::RenameProjectWorkOrder::syncRedo(), Isis::ImportControlNetWorkOrder::syncRedo(), Isis::CubeDnViewWorkOrder::syncRedo(), Isis::Footprint2DViewWorkOrder::syncRedo(), Isis::CnetEditorViewWorkOrder::syncUndo(), Isis::MatrixViewWorkOrder::syncUndo(), Isis::ImageFileListViewWorkOrder::syncUndo(), Isis::RenameProjectWorkOrder::syncUndo(), Isis::ImportControlNetWorkOrder::syncUndo(), Isis::Footprint2DViewWorkOrder::syncUndo(), and WorkOrder().

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

Read this work order's data from disk.

Definition at line 454 of file WorkOrder.cpp.

void Isis::WorkOrder::redo ( )
virtualslot

Starts (or enqueues) a redo.

This should not be re-implemented by children. TODO: (Then why is it declared virtual?)

Definition at line 900 of file WorkOrder.cpp.

References asyncRedo(), attemptQueuedAction(), bestText(), dependsOn(), imageList(), isFinished(), isInStableState(), isRedoing(), isRedone(), isUndoing(), m_elapsedTimer, m_futureWatcher, m_progressBar, previous(), project(), resetProgressBar(), setProgressToFinalText(), shapeList(), and syncRedo().

Referenced by attemptQueuedAction().

void Isis::WorkOrder::resetProgressBar ( )
private
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
@bQXmlStreamWriter 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.

Definition at line 478 of file WorkOrder.cpp.

References _FILEINFO_, bestText(), isInStableState(), m_executionTime, m_imageIds, m_internalData, m_shapeIds, Isis::IException::Programmer, and toString().

Referenced by Isis::Project::saveHistory().

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.

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

Definition at line 1520 of file WorkOrder.cpp.

References createsCleanState(), and m_createsCleanState.

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

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.

Definition at line 245 of file WorkOrder.cpp.

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

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.

Definition at line 254 of file WorkOrder.cpp.

References listenForImageDestruction(), and m_imageIds.

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

Sets the ShapeList data for this WorkOrder.

Parameters
imagesA pointer to the updated ShapeList.

Definition at line 267 of file WorkOrder.cpp.

References listenForShapeDestruction(), and m_shapeIds.

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.
controls.A pointer to the ControlList (which is a list of control networks).

Definition at line 290 of file WorkOrder.cpp.

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

Sets the CorrelationMatrix data for this WorkOrder.

Parameters
correlationMatrixThe matrix data.

Definition at line 299 of file WorkOrder.cpp.

References correlationMatrix().

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

Sets the TargetBody data for this WorkOrder.

Parameters
targetBodyA QSharedPointer to the TargetBody.

Definition at line 308 of file WorkOrder.cpp.

References m_targetBody, and targetBody().

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

Sets the GuiCamera data for this WorkOrder.

Parameters
guiCameraA QSharedPointer to the GuiCamera.

Definition at line 317 of file WorkOrder.cpp.

References guiCamera(), and m_guiCamera.

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

.

By default, m_modifiesDiskState is False. If a WorkOrder modifies the Project on disk as a result of it's action, this should be set to true.

Parameters
changesProjectOnDiskTrue if this WorkOrder modifies the Project on disk. False if it does not.

Definition at line 1531 of file WorkOrder.cpp.

References m_modifiesDiskState.

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

Sets the next WorkOrder in the sequence.

Parameters
nextWorkOrderThe next WorkOrder.

Definition at line 547 of file WorkOrder.cpp.

References m_nextWorkOrder.

Referenced by Isis::Project::addToProject().

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

Sets the previous WorkOrder in the sequence.

Parameters
previousWorkOrderThe previous WorkOrder.

Definition at line 556 of file WorkOrder.cpp.

References m_previousWorkOrder.

Referenced by Isis::Project::addToProject().

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.

Definition at line 1167 of file WorkOrder.cpp.

References m_progressRangeMaxValue, and m_progressRangeMinValue.

Referenced by Isis::ExportImagesWorkOrder::asyncRedo(), Isis::ImportControlNetWorkOrder::asyncRedo(), Isis::ImportImagesWorkOrder::importConfirmedImages(), and Isis::ImportShapesWorkOrder::importConfirmedShapes().

void Isis::WorkOrder::setProgressToFinalText ( )
private

Sets the ProgressBar to display the final status of the operation.

Definition at line 1386 of file WorkOrder.cpp.

References deleteProgress(), isRedone(), isUndone(), m_progressBar, and m_progressBarDeletionTimer.

Referenced by asyncFinished(), execute(), redo(), and undo().

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.

Definition at line 1177 of file WorkOrder.cpp.

References m_progressValue.

Referenced by Isis::ExportImagesWorkOrder::asyncRedo(), Isis::ImportControlNetWorkOrder::asyncRedo(), Isis::ImportImagesWorkOrder::importConfirmedImages(), and Isis::ImportShapesWorkOrder::importConfirmedShapes().

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

a pointer to the ShapeList for this WorkOrder.

Returns
(ShapeList*) A pointer to the ShapeList.

Definition at line 596 of file WorkOrder.cpp.

References listenForShapeDestruction(), m_shapeIds, and project().

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

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.

Definition at line 656 of file WorkOrder.cpp.

References m_transparentConstMutex, and shapeList().

void Isis::WorkOrder::startRedo ( )
privateslot

WorkOrder::startRedo This function is currently empty.

Definition at line 1508 of file WorkOrder.cpp.

QString Isis::WorkOrder::statusText ( ) const

WorkOrder::statusText.

Returns
QString A string representation of the current WorkOrder status.

Definition at line 812 of file WorkOrder.cpp.

References m_secondsElapsed, and toString().

void Isis::WorkOrder::syncRedo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for redo is: syncRedo() - GUI thread* asyncRedo() - Pooled thread postSyncRedo() - GUI thread

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

Reimplemented in Isis::ImageListActionWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::CubeDnViewWorkOrder, Isis::ImportControlNetWorkOrder, Isis::RenameProjectWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::MatrixViewWorkOrder, Isis::JigsawWorkOrder, Isis::RemoveImagesWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Definition at line 1203 of file WorkOrder.cpp.

Referenced by redo().

void Isis::WorkOrder::syncUndo ( )
protectedvirtual

This method is designed to be implemented by children work orders.

The order of execution for undo is: syncUndo() - GUI thread* asyncUndo() - Pooled thread postSyncUndo() - GUI thread

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

Reimplemented in Isis::ImageListActionWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::ImportControlNetWorkOrder, Isis::RenameProjectWorkOrder, Isis::TargetGetInfoWorkOrder, Isis::SensorGetInfoWorkOrder, Isis::ViewControlNet3DWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::MatrixViewWorkOrder, Isis::JigsawWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Definition at line 1254 of file WorkOrder.cpp.

Referenced by undo().

TargetBodyQsp Isis::WorkOrder::targetBody ( )
protected

WorkOrder::targetBody.

Returns
QSharedPointer Returns a shared pointer to the TargetBody.

Definition at line 666 of file WorkOrder.cpp.

References m_targetBody.

Referenced by Isis::TargetGetInfoWorkOrder::execute(), setData(), and Isis::TargetGetInfoWorkOrder::syncRedo().

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.

Definition at line 865 of file WorkOrder.cpp.

References WorkOrderFinished.

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

void Isis::WorkOrder::undo ( )
virtualslot

Starts (or enqueues) an undo.

This should not be re-implemented by children. (Why virtual then?)

Definition at line 994 of file WorkOrder.cpp.

References asyncUndo(), attemptQueuedAction(), bestText(), isFinished(), isInStableState(), isRedoing(), isUndoing(), isUndone(), m_elapsedTimer, m_futureWatcher, m_progressBar, next(), resetProgressBar(), setProgressToFinalText(), and syncUndo().

Referenced by attemptQueuedAction().

void Isis::WorkOrder::updateProgress ( )
privateslot

Updates the progress bar.

Definition at line 1497 of file WorkOrder.cpp.

References isRedoing(), isUndoing(), m_progressBar, m_progressRangeMaxValue, m_progressRangeMinValue, and m_progressValue.

Referenced by resetProgressBar().

Member Data Documentation

bool Isis::WorkOrder::m_createsCleanState
private

This is defaulted to false.

If a work order saves the project to disk, this causes a 'clean' (non-dirty) state. These work orders should call setCreatesCleanState(true) in their constructor.

Definition at line 325 of file WorkOrder.h.

Referenced by createsCleanState(), setCreatesCleanState(), and WorkOrder().

QTime* Isis::WorkOrder::m_elapsedTimer
private

A QTime object holding the excecution time of the WorkOrder.

Definition at line 440 of file WorkOrder.h.

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

QDateTime Isis::WorkOrder::m_executionTime
private

This is the date/time that execute() was called.

Definition at line 410 of file WorkOrder.h.

Referenced by execute(), executionTime(), save(), and WorkOrder().

QPointer< QFutureWatcher<void> > Isis::WorkOrder::m_futureWatcher
private

A pointer to a QFutureWatcher object which monitors a QFuture object using signals and slots.

A QFuture object represents the results of an asynchrounous operation.

Definition at line 417 of file WorkOrder.h.

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

GuiCameraQsp Isis::WorkOrder::m_guiCamera
private

A QSharedPointer to the GuiCamera (the Camera object but encapsulated within a Gui framework.

Definition at line 359 of file WorkOrder.h.

Referenced by guiCamera(), setData(), and WorkOrder().

QStringList Isis::WorkOrder::m_imageIds
private

A QStringList of unique image identifiers for all of the images this WorkOrder is dealing with.

Definition at line 373 of file WorkOrder.h.

Referenced by imageList(), listenForImageDestruction(), save(), setData(), and WorkOrder().

QStringList Isis::WorkOrder::m_internalData
private

A QStringList of internal properties for this WorkOrder.

Definition at line 384 of file WorkOrder.h.

Referenced by internalData(), save(), setInternalData(), and WorkOrder().

bool Isis::WorkOrder::m_modifiesDiskState
private

This is defaulted to false.

If a WorkOrder modifies the project on disk to perform its actions (for example, an import WorkOrder), the WorkOrder should call setModifiesDiskState(true) in its constructor.

Definition at line 332 of file WorkOrder.h.

Referenced by modifiesDiskState(), setModifiesDiskState(), and WorkOrder().

QPointer<WorkOrder> Isis::WorkOrder::m_nextWorkOrder
private

A pointer to the next WorkOrder in the queue.

Definition at line 389 of file WorkOrder.h.

Referenced by next(), setNext(), and ~WorkOrder().

QPointer<WorkOrder> Isis::WorkOrder::m_previousWorkOrder
private

A pointer to the previous WorkOrder in the queue.

Definition at line 394 of file WorkOrder.h.

Referenced by previous(), setPrevious(), and ~WorkOrder().

QPointer<ProgressBar> Isis::WorkOrder::m_progressBar
private
QPointer<QTimer> Isis::WorkOrder::m_progressBarDeletionTimer
private

A pointer to the ProgressBar deletion timer.

Definition at line 434 of file WorkOrder.h.

Referenced by resetProgressBar(), setProgressToFinalText(), and ~WorkOrder().

QPointer<QTimer> Isis::WorkOrder::m_progressBarUpdateTimer
private

A pointer to the QTimer which updates the ProgressBar.

Definition at line 429 of file WorkOrder.h.

Referenced by asyncFinished(), resetProgressBar(), and ~WorkOrder().

int Isis::WorkOrder::m_progressRangeMaxValue
private

The maximum value of the Progess Bar.

Definition at line 344 of file WorkOrder.h.

Referenced by progressMax(), resetProgressBar(), setProgressRange(), updateProgress(), and WorkOrder().

int Isis::WorkOrder::m_progressRangeMinValue
private

The miniumum value of the Progess Bar.

Definition at line 340 of file WorkOrder.h.

Referenced by progressMin(), resetProgressBar(), setProgressRange(), updateProgress(), and WorkOrder().

int Isis::WorkOrder::m_progressValue
private

The current value of the Progress Bar.

Definition at line 348 of file WorkOrder.h.

Referenced by progressValue(), resetProgressBar(), setProgressValue(), updateProgress(), and WorkOrder().

QPointer<Project> Isis::WorkOrder::m_project
private

A pointer to the Project this WorkOrder is attached to.

Definition at line 399 of file WorkOrder.h.

Referenced by project(), WorkOrder(), and ~WorkOrder().

double Isis::WorkOrder::m_secondsElapsed
private

The seconds that have elapsed since the WorkOrder started executing.

Definition at line 445 of file WorkOrder.h.

Referenced by asyncFinished(), statusText(), and WorkOrder().

QStringList Isis::WorkOrder::m_shapeIds
private

A QStringList of unique shape identifiers for all of the shapes this WorkOrder is dealing with.

Definition at line 379 of file WorkOrder.h.

Referenced by listenForShapeDestruction(), save(), setData(), shapeList(), and WorkOrder().

TargetBodyQsp Isis::WorkOrder::m_targetBody
private

A QSharedPointer to the TargetBody (A Target object but encapsulated within a Gui framework.

Definition at line 366 of file WorkOrder.h.

Referenced by setData(), targetBody(), and WorkOrder().

QMutex* Isis::WorkOrder::m_transparentConstMutex
private

This is used to protect the integrity of data the WorkOrder is working on so that only one thread at a time cann access it.

Definition at line 405 of file WorkOrder.h.

Referenced by imageList(), shapeList(), WorkOrder(), and ~WorkOrder().


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

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 ISIS Support Center
File Modified: 07/13/2023 00:23:58