12#include "Application.h"
13#include "Preference.h"
26 Isis::PvlGroup &group = Isis::Preference::Preferences().findGroup(
"UserInterface");
27 percent = group[
"ProgressBarPercent"];
28 QString temp = (QString) group[
"ProgressBar"];
29 printPercent = temp.toUpper() ==
"ON";
32 if((percent != 1) && (percent != 2) &&
33 (percent != 5) && (percent != 10)) {
34 string m =
"Invalid preference for [ProgressBarPercent] in ";
35 m +=
"group [UserInterface] must be 1, 2, 5, or 10";
45 p_printPercent = printPercent;
87 string m =
"Value for [steps] must be greater than ";
88 m +=
"or equal to zero in [Progress::SetMaximumSteps]";
109 string m =
"Step exceeds maximumSteps in [Progress::CheckStatus]";
114 if(Isis::iApp != NULL) {
120 if(p_printPercent && p_autoDisplay) {
128 if(Isis::iApp != NULL) {
134 if(p_printPercent && p_autoDisplay) {
146 if(p_autoDisplay && Isis::iApp != NULL) {
162 p_autoDisplay =
false;
201 string m =
"Value for [steps] must not be zero in [Progress::AddSteps]";
208 string m =
"Step exceeds maximumSteps in [Progress::AddSteps]";
213 string m =
"Maximum steps must be greater than zero in [Progress::AddSteps]";
void ProcessGuiEvents()
Processes the gui events.
void UpdateProgress(const QString &text, bool print)
Updates the progress bar in the gui.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
QString p_text
Text string to output at the initial call to CheckStatus (0% processed)
void AddSteps(const int steps)
If the initial step size was a guess, it can be modified using this method.
int p_currentPercent
The current percent we are checking against.
~Progress()
Destroys the Progress object.
int MaximumSteps() const
Returns the maximum number of steps of the progress.
int p_maximumSteps
Number of steps in your processing sequence.
Progress()
Constructs a Progress object.
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
void DisableAutomaticDisplay()
Turns off updating the Isis Gui when CheckStatus() is called.
int p_currentStep
The current step in the processing sequence.
QString Text() const
Returns the text to output.
int p_percentIncrement
How much to increment the currentPercent by.
void CheckStatus()
Checks and updates the status.
int CurrentStep() const
Returns the current step of the progress.
Contains multiple PvlContainers.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.