Isis 3.0 Developer's Reference (API) |
Home |
Program progress reporter. More...
#include <Progress.h>
Public Member Functions | |
Progress () | |
Constructs a Progress object. | |
~Progress () | |
Destroys the Progress object. | |
void | SetText (const std::string &text) |
Changes the value of the text string reported just before 0% processed. | |
std::string | 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. |
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.
Isis::Progress::Progress | ( | ) |
Constructs a Progress object.
Isis::iException::User |
References _FILEINFO_, Isis::PvlObject::FindGroup(), Isis::iException::Message(), Isis::Preference::Preferences(), Isis::iString::UpCase(), and Isis::iException::User.
Isis::Progress::~Progress | ( | ) |
Destroys the Progress object.
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.
steps | Amount to adjust the MaximumSteps by |
References _FILEINFO_, Isis::iException::Message(), 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.
Isis::iException::Programmer | Step exceeds maximumSteps |
References _FILEINFO_, Isis::iApp, Isis::iException::Message(), and Isis::iException::Programmer.
Referenced by Isis::Process::CalculateStatistics(), Isis::GroundGrid::CreateGrid(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::ControlNetStatistics::GeneratePointStats(), Isis::Cube::getHistogram(), Isis::Cube::getStatistics(), Isis::Histogram::Histogram(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ControlNet::ReadControl(), Isis::SerialNumberList::SerialNumberList(), Isis::ControlNet::SetImages(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessExport::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), Isis::ProcessExport::StartProcessBIL(), Isis::ProcessExport::StartProcessBIP(), Isis::ProcessExport::StartProcessBSQ(), Isis::ProcessByBrick::StartProcessInPlace(), Isis::ProcessByBrick::StartProcessIO(), and Isis::ProcessByBrick::StartProcessIOList().
void Isis::Progress::SetMaximumSteps | ( | const int | steps | ) |
This sets the maximum number of steps in the process.
Whenever this is invoked it also resets the counters to their initial states. This allows for programs which have multiple steps.
steps | Maximum number of steps |
Isis::iException::Programmer | Invalid value for step (must be >0) |
References _FILEINFO_, Isis::iException::Message(), and Isis::iException::Programmer.
Referenced by Isis::Process::CalculateStatistics(), Isis::GroundGrid::CreateGrid(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::ControlNetStatistics::GeneratePointStats(), Isis::Cube::getHistogram(), Isis::Cube::getStatistics(), Isis::Histogram::Histogram(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ControlNet::ReadControl(), Isis::SerialNumberList::SerialNumberList(), Isis::ControlNet::SetImages(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), Isis::ProcessByBrick::StartProcessInPlace(), Isis::ProcessByBrick::StartProcessIO(), and Isis::ProcessByBrick::StartProcessIOList().
void Isis::Progress::SetText | ( | const std::string & | text | ) |
Changes the value of the text string reported just before 0% processed.
This text is only output under the following condition. After SetMaximumSteps is called, the first call to CheckStatus will immediately output the text. By default this is set to "Working".
text | Text to output. |
Referenced by Isis::HiEqualization::calculateStatistics(), Isis::Process::CalculateStatistics(), Isis::Equalization::calculateStatistics(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::ControlNetStatistics::GeneratePointStats(), Isis::Cube::getHistogram(), Isis::Cube::getStatistics(), Isis::Histogram::Histogram(), Isis::OverlapStatistics::OverlapStatistics(), Isis::Process::Process(), Isis::ProcessExport::ProcessExport(), Isis::ProcessImport::ProcessImport(), Isis::ControlNet::ReadControl(), Isis::SerialNumberList::SerialNumberList(), Isis::ControlNet::SetImages(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::BundleAdjust::Solve(), and Isis::ProcessMapMosaic::StartProcess().
string 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. For an example, see the Histogram method in the CubeInfo class.