49 mUseDefaultMessages(true)
51 mTimer =
new QTimer(
this);
52 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
53 mTimer->setInterval(secondsBetweenAnnounce*1000);
61 mStartTime = QDateTime::currentDateTime();
63 report(QString(
"Algorithm %1 started.").arg(mProduct));
75 QTime TimedBaseAlgorithm::getTimePassed()
77 QTime retval = QTime(0, 0);
78 retval = retval.addMSecs(mStartTime.time().msecsTo(QDateTime::currentDateTime().time()));
84 double secs = double(mStartTime.msecsTo(QDateTime::currentDateTime()))/1000;
85 return QString(
"%1").arg(secs, 0,
'f', 2);
88 void TimedBaseAlgorithm::timeoutSlot()
90 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.