28 mUseDefaultMessages(true)
30 mTimer =
new QTimer(
this);
31 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
32 mTimer->setInterval(secondsBetweenAnnounce*1000);
40 mStartTime = QDateTime::currentDateTime();
42 report(QString(
"Algorithm %1 started.").arg(mProduct));
54 QTime TimedBaseAlgorithm::getTimePassed()
56 QTime retval = QTime(0, 0);
57 retval = retval.addMSecs(mStartTime.time().msecsTo(QDateTime::currentDateTime().time()));
63 double secs = double(mStartTime.msecsTo(QDateTime::currentDateTime()))/1000;
64 return QString(
"%1").arg(secs, 0,
'f', 2);
67 void TimedBaseAlgorithm::timeoutSlot()
69 report(QString(
"Still executing %1, [%2] ...").arg(mProduct).arg(this->getTimePassed().
toString(
"m:ss")));
std::string toString(T const &value)
converts any type to a string
virtual ~TimedBaseAlgorithm()
void reportSuccess(QString msg)
TimedBaseAlgorithm(QString product, int secondsBetweenAnnounce)
QString getSecondsPassedAsString() const
Namespace for all CustusX production code.