27 #include "../../core/translator/Translator.h" 35 : m_totalSteps(0), m_currentStep(0), m_propStep(0)
43 m_tasks.insert(std::map<int, TaskProgress*>::value_type(
id, t));
52 std::map<int, TaskProgress*>::iterator it =
m_tasks.find(taskId);
70 std::map<int, TaskProgress*>::iterator it =
m_tasks.find(taskId);
98 double currentStep = 0;
100 std::map<int, te::common::TaskProgress*>::iterator it;
103 currentStep += it->second->getCurrentStep();
105 double aux =
static_cast<double>(currentStep) / static_cast<double>(
m_totalSteps);
107 int val =
static_cast<int>(100.0 * aux);
This class can be used to inform the progress of a task.
A progress viewer implementation for the console.
This class can be used to inform the progress of a task.
int m_currentStep
Attribute used to define the current steps of all task.
#define TE_TR(message)
It marks a string in order to get translated.
void updateMessage(int taskId)
Update the progress message.
ConsoleProgressViewer()
Default constructor.
std::string m_message
Attribute used to define the progress message.
void addTask(TaskProgress *t, int id)
Insert a new task in the progress viewer.
void removeTask(int taskId)
Removes a task from progress viewer container.
void cancelTask(int taskId)
Cancel a task.
void setTotalValues(int taskId)
Set task total steps.
std::map< int, TaskProgress * > m_tasks
Task container.
int m_propStep
Attribute used to define the proportional step (0-100).
void updateValue(int taskId)
Update the progress evaluation.
int m_totalSteps
Attribute used to define the total steps of all tasks.
~ConsoleProgressViewer()
Virtual destructor.