USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::ExportImagesWorkOrder Class Reference

Write project images to a user-specified location. More...

#include <ExportImagesWorkOrder.h>

Inherits Isis::WorkOrder.

Classes

class  ProjectImageExportFunctor
 This functor is meant for QtConcurrentMap.

Public Types

enum  WorkOrderStatus {
  WorkOrderUnknownStatus = 0, WorkOrderNotStarted, WorkOrderRedoing, WorkOrderRedone,
  WorkOrderUndoing, WorkOrderUndone, WorkOrderFinished, WorkOrderLastStatus = WorkOrderFinished
}
enum  Context { NoContext, ProjectContext }

Public Slots

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

 ExportImagesWorkOrder (Project *project)
 ExportImagesWorkOrder (const ExportImagesWorkOrder &other)
 ~ExportImagesWorkOrder ()
virtual ExportImagesWorkOrderclone () const
bool isExecutable (ImageList *images)
 Currently, this work order only works with either no data (file menu) or with any number of images.
bool execute ()
 Prompts the user for input.
void asyncRedo ()
 Use internalData() and write the images into the output directory.
void postSyncRedo ()
 Display any warnings that occurred during the asynchronous computations.
virtual bool isExecutable (Context)
 Re-implement this method if your work order utilizes controls for data in order to operate.
virtual bool isExecutable (QList< Control * > controls)
 Re-implement this method if your work order utilizes controls for data in order to operate.
void read (XmlStackedHandlerReader *xmlReader)
 Read this work order's data from disk.
void save (QXmlStreamWriter &stream) const
 Output XML format:
virtual void setData (Context)
virtual void setData (ImageList *images)
virtual void setData (QList< Control * > controls)
void setNext (WorkOrder *nextWorkOrder)
void setPrevious (WorkOrder *previousWorkOrder)
QString bestText () const
bool createsCleanState () const
QDateTime executionTime () const
bool isFinished () const
bool isRedoing () const
bool isRedone () const
bool isUndoing () const
bool isUndone () const
bool modifiesDiskState () const
WorkOrdernext () const
WorkOrderprevious () const
QString statusText () const
ProgressBarprogressBar ()

Static Public Member Functions

static WorkOrderStatus fromStatusString (QString)
static QString toString (WorkOrderStatus)

Protected Slots

void addCloneToProject ()

Protected Member Functions

ImageListimageList ()
const ImageListimageList () const
QList< Control * > controlList ()
virtual bool dependsOn (WorkOrder *other) const
Directorydirectory () const
Projectproject () const
void setCreatesCleanState (bool createsCleanState)
 Declare that this work order is saving the project.
void setModifiesDiskState (bool changesProjectOnDisk)
void setInternalData (QStringList data)
int progressMin () const
int progressMax () const
int progressValue () const
void setProgressRange (int, int)
void setProgressValue (int)
QStringList internalData () const
virtual void syncRedo ()
 This method is designed to be implemented by children work orders.
virtual void syncUndo ()
 This method is designed to be implemented by children work orders.
virtual void asyncUndo ()
 This method is designed to be implemented by children work orders.
virtual void postSyncUndo ()
 This method is designed to be implemented by children work orders.

Detailed Description

Write project images to a user-specified location.

Takes an imageList and writes it's images to disk at a user-specified location. This works both with and without context (context menus and file menu).

internalData() stores: ImageList name [OPTIONAL] - need context if this isn't present (see WorkOrder::imageList()) Output directory name [REQUIRED]

Author
2012-09-26 Tracie Sucharski

Member Enumeration Documentation

enum Isis::WorkOrder::Context
inherited
Enumerator:
NoContext 
ProjectContext 
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

Isis::ExportImagesWorkOrder::ExportImagesWorkOrder ( Project project)

Referenced by clone().

Isis::ExportImagesWorkOrder::ExportImagesWorkOrder ( const ExportImagesWorkOrder other)
Isis::ExportImagesWorkOrder::~ExportImagesWorkOrder ( )

Member Function Documentation

void Isis::WorkOrder::addCloneToProject ( )
protectedslotinherited
void Isis::ExportImagesWorkOrder::asyncRedo ( )
virtual

Use internalData() and write the images into the output directory.

Stores errors in m_warning which will be reported in postSyncRedo().

Reimplemented from Isis::WorkOrder.

References Isis::Project::imageList(), Isis::WorkOrder::imageList(), Isis::WorkOrder::internalData(), Isis::WorkOrder::project(), Isis::WorkOrder::setProgressRange(), and Isis::WorkOrder::setProgressValue().

void Isis::WorkOrder::asyncUndo ( )
protectedvirtualinherited

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.

Referenced by Isis::WorkOrder::undo().

QString Isis::WorkOrder::bestText ( ) const
inherited
ExportImagesWorkOrder * Isis::ExportImagesWorkOrder::clone ( ) const
virtual

Implements Isis::WorkOrder.

References ExportImagesWorkOrder().

bool Isis::WorkOrder::createsCleanState ( ) const
inherited
void Isis::WorkOrder::creatingProgress ( WorkOrder _t1)
signalinherited
void Isis::WorkOrder::deletingProgress ( WorkOrder _t1)
signalinherited
bool Isis::WorkOrder::dependsOn ( WorkOrder other) const
protectedvirtualinherited
bool Isis::ExportImagesWorkOrder::execute ( )
virtual

Prompts the user for input.

If there is no context, we ask the user to select an image list. Once we have images (via context or asking the user), we then ask for a output directory. The relevant data is stored in internalData().

Returns
bool

Reimplemented from Isis::WorkOrder.

References Isis::WorkOrder::imageList(), Isis::WorkOrder::internalData(), Isis::ImageList::name(), Isis::WorkOrder::project(), and Isis::WorkOrder::setInternalData().

QDateTime Isis::WorkOrder::executionTime ( ) const
inherited
void Isis::WorkOrder::finished ( WorkOrder _t1)
signalinherited
WorkOrder::WorkOrderStatus Isis::WorkOrder::fromStatusString ( QString  statusString)
staticinherited
const ImageList * Isis::WorkOrder::imageList ( ) const
protectedinherited
bool Isis::ExportImagesWorkOrder::isExecutable ( ImageList images)
virtual

Currently, this work order only works with either no data (file menu) or with any number of images.

Parameters
controlsThe current context we're inquiring about
Returns
bool True if this work order functions with the given image list

Reimplemented from Isis::WorkOrder.

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

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.

Reimplemented in Isis::RenameProjectWorkOrder.

Referenced by Isis::Directory::supportedActions().

bool Isis::WorkOrder::isExecutable ( QList< Control * >  controls)
virtualinherited

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.

Reimplemented in Isis::CnetEditorViewWorkOrder, and Isis::ExportControlNetWorkOrder.

bool Isis::WorkOrder::isFinished ( ) const
inherited
bool Isis::WorkOrder::isRedoing ( ) const
inherited
bool Isis::WorkOrder::isRedone ( ) const
inherited
bool Isis::WorkOrder::isUndoing ( ) const
inherited
bool Isis::WorkOrder::isUndone ( ) const
inherited
bool Isis::WorkOrder::modifiesDiskState ( ) const
inherited

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

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

Referenced by Isis::WorkOrder::undo().

void Isis::ExportImagesWorkOrder::postSyncRedo ( )
virtual

Display any warnings that occurred during the asynchronous computations.

Reimplemented from Isis::WorkOrder.

References Isis::WorkOrder::project(), and Isis::Project::warn().

void Isis::WorkOrder::postSyncUndo ( )
protectedvirtualinherited

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.

WorkOrder * Isis::WorkOrder::previous ( ) const
inherited
ProgressBar * Isis::WorkOrder::progressBar ( )
inherited
int Isis::WorkOrder::progressMax ( ) const
protectedinherited
int Isis::WorkOrder::progressMin ( ) const
protectedinherited
int Isis::WorkOrder::progressValue ( ) const
protectedinherited
void Isis::WorkOrder::read ( XmlStackedHandlerReader xmlReader)
inherited

Read this work order's data from disk.

References Isis::XmlStackedHandlerReader::pushContentHandler().

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

Output XML format:

  <workOrder actiontext="..." undotext="..." type="..." status="...">
    <images>
      <image id="...">
    </images>
    <internalDataValues>
      <dataValue value="...">
    </internalDataValues>
  </workOrder>

References _FILEINFO_, Isis::WorkOrder::bestText(), Isis::WorkOrder::NoContext, Isis::WorkOrder::toString(), and Isis::IException::Unknown.

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

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

References Isis::WorkOrder::createsCleanState().

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

void Isis::WorkOrder::setData ( Context  context)
virtualinherited
void Isis::WorkOrder::setData ( ImageList images)
virtualinherited

Reimplemented in Isis::ImageListActionWorkOrder.

void Isis::WorkOrder::setData ( QList< Control * >  controls)
virtualinherited
void Isis::WorkOrder::setModifiesDiskState ( bool  changesProjectOnDisk)
protectedinherited
void Isis::WorkOrder::setNext ( WorkOrder nextWorkOrder)
inherited
void Isis::WorkOrder::setPrevious ( WorkOrder previousWorkOrder)
inherited
void Isis::WorkOrder::setProgressRange ( int  minValue,
int  maxValue 
)
protectedinherited
void Isis::WorkOrder::setProgressValue ( int  value)
protectedinherited
void Isis::WorkOrder::statusChanged ( WorkOrder _t1)
signalinherited
QString Isis::WorkOrder::statusText ( ) const
inherited
void Isis::WorkOrder::syncRedo ( )
protectedvirtualinherited

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::ImportControlNetWorkOrder, Isis::RenameProjectWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::CubeViewportViewWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Referenced by Isis::WorkOrder::redo().

void Isis::WorkOrder::syncUndo ( )
protectedvirtualinherited

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::ImportControlNetWorkOrder, Isis::RenameProjectWorkOrder, Isis::ImageFileListViewWorkOrder, Isis::CubeViewportViewWorkOrder, Isis::Footprint2DViewWorkOrder, Isis::CnetEditorViewWorkOrder, Isis::MoveDownOneSceneWorkOrder, Isis::MoveToBottomSceneWorkOrder, Isis::MoveToTopSceneWorkOrder, and Isis::MoveUpOneSceneWorkOrder.

Referenced by Isis::WorkOrder::undo().


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