diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index b7c66ce..948aec1 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -81,7 +81,7 @@ struct AlgorithmCore store(model); } - qDebug("Training Time (sec): %d", Globals->startTime.elapsed()/1000); + qDebug("Training Time: %s", qPrintable(QtUtils::toTime(Globals->startTime.elapsed()))); } void store(const QString &model) const @@ -154,6 +154,7 @@ struct AlgorithmCore // Trust me, this makes complete sense. // We're just going to make a pipe with a placeholder first transform + Globals->totalSteps = data.length(); QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard"; QScopedPointer basePipe(Transform::make(pipeDesc,NULL)); diff --git a/openbr/gui/progress.cpp b/openbr/gui/progress.cpp index fbe2bf6..8aa30f5 100644 --- a/openbr/gui/progress.cpp +++ b/openbr/gui/progress.cpp @@ -1,4 +1,5 @@ #include +#include #include "progress.h" @@ -19,7 +20,7 @@ br::Progress::Progress(QWidget *parent) addPermanentWidget(&pbProgress); addPermanentWidget(&lTimeRemaining); connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress())); - timer.start(1000); + timer.start(5000); } /*** PRIVATE SLOTS ***/ @@ -33,19 +34,8 @@ void br::Progress::checkProgress() pbProgress.setValue(progress); if (progress > 100) pbProgress.setMaximum(0); else pbProgress.setMaximum(100); - - int s = br_time_remaining(); - if (s >= 0) { - int h = s / (60*60); - int m = (s - h*60*60) / 60; - s = (s - h*60*60 - m*60); - lTimeRemaining.setText(QString("%1:%2:%3").arg(h, 2, 10, QLatin1Char('0')).arg(m, 2, 10, QLatin1Char('0')).arg(s, 2, 10, QLatin1Char('0'))); - } else { - lTimeRemaining.clear(); - } } else { clearMessage(); - lTimeRemaining.clear(); } pbProgress.setVisible(visible); diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index d96c71e..7c5bbe3 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -688,12 +688,6 @@ public: BR_PROPERTY(Filters, filters, Filters()) /*! - * \brief If \c true a template will be skipped over if its file name already exists in the gallery. - */ - Q_PROPERTY(bool noDuplicates READ get_noDuplicates WRITE set_noDuplicates RESET reset_noDuplicates) - BR_PROPERTY(bool, noDuplicates, false) - - /*! * \brief File output is redirected here if the file's basename is 'buffer', clearing previous contents. */ Q_PROPERTY(QByteArray buffer READ get_buffer WRITE set_buffer RESET reset_buffer) diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 9c25c63..fec8319 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -565,7 +565,8 @@ class ProgressCounterTransform : public TimeVaryingTransform qint64 elapsed = timer.elapsed(); calls++; set_calls++; - // updated every 10 seconds + + // Updated every 5 seconds if (elapsed > 5 * 1000) { float f_elapsed = elapsed / 1000.0f; // remaining calls (according to our input variable) @@ -578,7 +579,11 @@ class ProgressCounterTransform : public TimeVaryingTransform // seconds remaining int s = float(remaining) / speed; - fprintf(stderr, "%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g \r", p, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), float(calls)); + // Output some timing information + qDebug("%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g \r", p, qPrintable(QtUtils::toTime(Globals->startTime.elapsed()/1000.0f)), qPrintable(QtUtils::toTime(s)), float(calls)); + + // Set globals + Globals->currentStep = calls; timer.start(); set_calls = 0;