27 #include "../StringUtils.h"
28 #include "../Translator.h"
32 : m_totalSteps(totalSteps),
63 double diffInSec = difftime(curtime, m_startTime);
65 m_speedTime = (
static_cast<double>(m_count) / diffInSec);
67 int remainingSteps = m_totalSteps - m_count;
69 double remainingTimeInSec = (
static_cast<double>(remainingSteps) / m_speedTime);
71 m_remainingTime = remainingTimeInSec / 60.0;
76 m_totalSteps = totalSteps;
86 return m_remainingTime;
96 std::string strTime = m_message +
"\n";
98 if(m_remainingTime < 1.0)
100 strTime +=
TE_TR(
"Remaining Time: Less than one minute");
106 strTime +=
TE_TR(
" Steps/Second");
void setMessage(std::string message)
Set the message used by task progress.
void tick()
Define a new step process evolution.
#define TE_TR(message)
It marks a string in order to get translated.
double getRemainingTimeInMin() const
Function used to get the remaining time to end the process.
double getSpeedTimeInSec() const
Function used to get the speed time.
void start()
Start the internal timer.
ProgressTimer(int totalSteps, std::string message)
It initializes a ProgressTimer.
std::string getMessage()
Get the information about the evolution of the process.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
~ProgressTimer()
Destructor.
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...