34 m_totalSteps(totalSteps),
40 m_isMultiThread(false),
112 val =
static_cast<int>(100.0 * aux);
void useMultiThread(bool flag)
Used to define if task is running in thread mode.
int m_totalSteps
Task total steps.
void setMessage(const std::string &message)
Set the task message.
This class can be used to inform the progress of a task.
int getProportionalValue() const
Get the proportional value (value between 0 and 100).
A singleton class used to manage tasks progresses and their viewers.
void useTimer(bool flag)
Used to define if task use progress timer information.
int addTask(TaskProgress *tp)
Used in TaskProgress constructor, register this task generating a task id.
bool m_isActive
Flag used to indicate the task status.
bool m_isMultiThread
Flag used to indicate the thread mode.
void tick()
Define a new step process evolution.
void cancelTask(int taskId)
Inform all viewers that a task was canceled.
const std::string & getMessage() const
Get the task message.
~TaskProgress()
Destructor.
bool isActive() const
Verify if the task is active.
void setTotalSteps(int value)
Set the task total stepes.
int getId() const
Get the task identification.
TaskProgress(const std::string &message="", unsigned int type=UNDEFINED, int totalSteps=0)
Default constructor.
static ProgressManager & getInstance()
It returns a reference to the singleton instance.
std::string m_message
Task message.
void setTotalValues(int taskId)
Inform all viewers that a task set the total values.
bool m_hasToUpdate
Flag used to indicate the update status.
void cancel()
Cancel task, set the task active FALSE.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
int m_currentStep
Task current step.
int getCurrentStep() const
Get the task current step.
void removeTask(int taskId)
Used in TaskProgress destructor, remove task from singleton.
unsigned int m_type
Task type.
void start()
Start the internal timer.
bool hasToUpdate() const
This function is used when proportional value has changed.
The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a tas...
ProgressTimer * m_timer
Progress timer instance.
bool m_useTimer
Flag used to indicate the timer status.
unsigned int getType() const
Get the task type.
int m_currentPropStep
Current proportinal step.
void setCurrentStep(int value)
Set the task current step.
std::string getMessage()
Get the information about the evolution of the process.
void updateMessage(int taskId)
Inform all viewers that a task set the message.
int m_id
Task identification.
void setTotalSteps(int totalSteps)
Set the total steps.
The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a tas...
void updateValue(int taskId)
Inform all viewers that a task set the current step.
int getTotalSteps() const
Get the task total stepes.