34 m_totalSteps(totalSteps),
40 m_isMultiThread(false),
81 m_timer->setTotalSteps(m_totalSteps);
92 return m_currentPropStep;
104 m_currentStep = value;
106 double aux =
static_cast<double>(m_currentStep) / static_cast<double>(m_totalSteps);
108 int val =
static_cast<int>(100.0 * aux);
110 if(val > m_currentPropStep)
112 m_currentPropStep = val;
113 m_hasToUpdate =
true;
117 m_hasToUpdate =
false;
124 setMessage(m_timer->getMessage());
135 int val = getCurrentStep();
137 setCurrentStep(++val);
168 m_isMultiThread = flag;
183 if(m_timer == 0 && m_useTimer)
196 return m_hasToUpdate;
bool isActive() const
Verify if the task is active.
This class can be used to inform the progress of a task.
void useMultiThread(bool flag)
Used to define if task is running in thread mode.
int getCurrentStep() const
Get the task current step.
void setTotalSteps(int value)
Set the task total stepes.
A singleton class used to manage tasks progresses and their viewers.
int getProportionalValue() const
Get the proportional value (value between 0 and 100).
int getTotalSteps() const
Get the task total stepes.
void cancel()
Cancel task, set the task active FALSE.
void setCurrentStep(int value)
Set the task current step.
The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a tas...
unsigned int getType() const
Get the task type.
int getId() const
Get the task identification.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
const std::string & getMessage() const
Get the task message.
The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a tas...
bool hasToUpdate() const
This function is used when proportional value has changed.
void useTimer(bool flag)
Used to define if task use progress timer information.
void setMessage(const std::string &message)
Set the task message.
static T & getInstance()
It returns a reference to the singleton instance.
~TaskProgress()
Destructor.
int m_id
Task identification.
TaskProgress(const std::string &message="", unsigned int type=UNDEFINED, int totalSteps=0)
Default constructor.