27 #include "../StringUtils.h"
28 #include "../Translator.h"
32 : m_totalSteps(totalSteps),
62 double diffInSec = difftime(curtime, m_startTime);
64 m_speedTime = (
static_cast<double>(m_count) / diffInSec);
66 int remainingSteps = m_totalSteps - m_count;
68 double remainingTimeInSec = (
static_cast<double>(remainingSteps) / m_speedTime);
70 m_remainingTime = remainingTimeInSec / 60.0;
75 m_totalSteps = totalSteps;
80 return m_remainingTime;
90 std::string strTime =
"";
92 if(m_remainingTime < 1.0)
94 strTime =
TR_COMMON(
"Remaining Time: Less than one minute");
ProgressTimer(int totalSteps)
It initializes a ProgressTimer.
void tick()
Define a new step process evolution.
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.
#define TR_COMMON(message)
It marks a string in order to get translated. This is the mark used in the Common module of TerraLib...
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...
~ProgressTimer()
Destructor.
double getRemainingTimeInMin() const
Function used to get the remaining time to end the process.
void start()
Start the internal timer.
double getSpeedTimeInSec() const
Function used to get the speed time.