USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Progress Class Reference
[Application Interface]

Program progress reporter. More...

#include <Progress.h>

Collaboration diagram for Isis::Progress:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Progress ()
 Constructs a Progress object.
 ~Progress ()
 Destroys the Progress object.
void SetText (const QString &text)
 Changes the value of the text string reported just before 0% processed.
QString Text () const
 Returns the text to output.
void SetMaximumSteps (const int steps)
 This sets the maximum number of steps in the process.
void AddSteps (const int steps)
 If the initial step size was a guess, it can be modified using this method.
void CheckStatus ()
 Checks and updates the status.

Private Attributes

QString p_text
 Text string to output at the initial call to CheckStatus (0% processed).
int p_maximumSteps
 Number of steps in your processing sequence.
int p_currentStep
 The current step in the processing sequence.
int p_currentPercent
 The current percent we are checking against.
int p_percentIncrement
 How much to increment the currentPercent by.
bool p_printPercent

Detailed Description

Program progress reporter.

This class is used to output the percent completion for programs in either the command line mode or the graphical user interface. Generally, this object is created within a Process derived class. Therefore you should only use this object if you are developing such a class.

Author:
2002-05-22 Jeff Anderson

For internal use only.

History:
2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
History:
2004-02-29 Jeff Anderson - Added ability to send progress status to the parent process
History:
2005-02-11 Elizabeth Ribelin - Modified file to support Doxygen documentation
History:
2005-10-03 Elizabeth Miller - Changed
History:
2012-10-04 Jeannie Backer - Removed documentation reference to the now non-existant CubeInfo class. No mantis ticket related to this change.
Todo:
2005-02-11 Jeff Anderson - add coded and implementation example to class documentation

Definition at line 56 of file Progress.h.


Constructor & Destructor Documentation

Isis::Progress::Progress (  ) 

Constructs a Progress object.

Exceptions:
Isis::iException::User 

Definition at line 38 of file Progress.cpp.

References _FILEINFO_, Isis::PvlObject::FindGroup(), p_currentPercent, p_currentStep, p_maximumSteps, p_percentIncrement, p_text, and Isis::IException::User.

Isis::Progress::~Progress (  ) 

Destroys the Progress object.

Definition at line 65 of file Progress.cpp.


Member Function Documentation

void Isis::Progress::AddSteps ( const int  steps  ) 

If the initial step size was a guess, it can be modified using this method.

For example, if you SetMaximumSteps(11) then call AddSteps(1) then the new MaximumSteps is 12. The progress bar will not go backwards (it will not drop from 10% to 5%). "steps" can be negative to remove steps.

Parameters:
steps Amount to adjust the MaximumSteps by

Definition at line 176 of file Progress.cpp.

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

Referenced by Isis::ImageOverlapSet::FindAllOverlaps(), and Isis::OverlapStatistics::OverlapStatistics().

void Isis::Progress::CheckStatus (  ) 

Checks and updates the status.

The first time this is invoked, it outputs the text from SetText and 0% processed. It should then be invoked for each step, for example, a step could be considered processing a line for NL lines in the image. If you do not call this enough times you will not reached 100% processed.

Exceptions:
IException::Programmer Step exceeds maximumSteps

Definition at line 120 of file Progress.cpp.

References _FILEINFO_, p_currentPercent, p_currentStep, p_maximumSteps, p_percentIncrement, p_text, Isis::Application::ProcessGuiEvents(), Isis::IException::Programmer, and Isis::Application::UpdateProgress().

Referenced by Isis::ProcessByBrick::BlockingReportProgress(), Isis::Process::CalculateStatistics(), Isis::GroundGrid::CreateGrid(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::InterestOperator::FindCnetRef(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::ControlNetStatistics::GeneratePointStats(), Isis::Histogram::Histogram(), Isis::Cube::histogram(), Isis::CameraStatistics::init(), Isis::ProcessExport::InitProcess(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), Isis::ProcessImport::ProcessJp2(), Isis::ProcessRubberSheet::processPatchTransform(), Isis::ControlNet::ReadControl(), Isis::Pipeline::Run(), Isis::ProcessByBrick::RunProcess(), Isis::SerialNumberList::SerialNumberList(), Isis::ControlNet::SetImages(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessExport::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), and Isis::Cube::statistics().

void Isis::Progress::SetMaximumSteps ( const int  steps  ) 
void Isis::Progress::SetText ( const QString &  text  ) 
QString Isis::Progress::Text (  )  const

Returns the text to output.

Generally, this in not needed except rare circumstances where an application has multiple steps and the text string needs to be saved and restored.

Returns:
string

Definition at line 87 of file Progress.cpp.

References p_text.


Member Data Documentation

The current percent we are checking against.

Once this percentage is exceeded we report that percentage is completed and increase this value by the increment.

Definition at line 66 of file Progress.h.

Referenced by CheckStatus(), Progress(), and SetMaximumSteps().

The current step in the processing sequence.

This is incremented by one everytime CheckStatus is called.

Definition at line 63 of file Progress.h.

Referenced by AddSteps(), CheckStatus(), Progress(), and SetMaximumSteps().

Number of steps in your processing sequence.

For example, if there are 20 lines in an cube. This will be 20.

Definition at line 60 of file Progress.h.

Referenced by AddSteps(), CheckStatus(), Progress(), and SetMaximumSteps().

How much to increment the currentPercent by.

It should only be 1,2, 5, or 10.

Definition at line 70 of file Progress.h.

Referenced by CheckStatus(), and Progress().

QString Isis::Progress::p_text [private]

Text string to output at the initial call to CheckStatus (0% processed).

Definition at line 58 of file Progress.h.

Referenced by CheckStatus(), Progress(), SetText(), and Text().


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