Commit 1230b351f9e912c011cb0fabb39682c1444e552d

Authored by Scott Klum
1 parent ff6fe66a

Changes in progress messages/gui components to reflect the updated enrolling methodology

openbr/core/core.cpp
... ... @@ -81,7 +81,7 @@ struct AlgorithmCore
81 81 store(model);
82 82 }
83 83  
84   - qDebug("Training Time (sec): %d", Globals->startTime.elapsed()/1000);
  84 + qDebug("Training Time: %s", qPrintable(QtUtils::toTime(Globals->startTime.elapsed())));
85 85 }
86 86  
87 87 void store(const QString &model) const
... ... @@ -154,6 +154,7 @@ struct AlgorithmCore
154 154  
155 155 // Trust me, this makes complete sense.
156 156 // We're just going to make a pipe with a placeholder first transform
  157 + Globals->totalSteps = data.length();
157 158 QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard";
158 159 QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL));
159 160  
... ...
openbr/gui/progress.cpp
1 1 #include <openbr/openbr.h>
  2 +#include <QDebug>
2 3  
3 4 #include "progress.h"
4 5  
... ... @@ -19,7 +20,7 @@ br::Progress::Progress(QWidget *parent)
19 20 addPermanentWidget(&pbProgress);
20 21 addPermanentWidget(&lTimeRemaining);
21 22 connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress()));
22   - timer.start(1000);
  23 + timer.start(5000);
23 24 }
24 25  
25 26 /*** PRIVATE SLOTS ***/
... ... @@ -33,19 +34,8 @@ void br::Progress::checkProgress()
33 34 pbProgress.setValue(progress);
34 35 if (progress > 100) pbProgress.setMaximum(0);
35 36 else pbProgress.setMaximum(100);
36   -
37   - int s = br_time_remaining();
38   - if (s >= 0) {
39   - int h = s / (60*60);
40   - int m = (s - h*60*60) / 60;
41   - s = (s - h*60*60 - m*60);
42   - lTimeRemaining.setText(QString("%1:%2:%3").arg(h, 2, 10, QLatin1Char('0')).arg(m, 2, 10, QLatin1Char('0')).arg(s, 2, 10, QLatin1Char('0')));
43   - } else {
44   - lTimeRemaining.clear();
45   - }
46 37 } else {
47 38 clearMessage();
48   - lTimeRemaining.clear();
49 39 }
50 40  
51 41 pbProgress.setVisible(visible);
... ...
openbr/openbr_plugin.h
... ... @@ -688,12 +688,6 @@ public:
688 688 BR_PROPERTY(Filters, filters, Filters())
689 689  
690 690 /*!
691   - * \brief If \c true a template will be skipped over if its file name already exists in the gallery.
692   - */
693   - Q_PROPERTY(bool noDuplicates READ get_noDuplicates WRITE set_noDuplicates RESET reset_noDuplicates)
694   - BR_PROPERTY(bool, noDuplicates, false)
695   -
696   - /*!
697 691 * \brief File output is redirected here if the file's basename is 'buffer', clearing previous contents.
698 692 */
699 693 Q_PROPERTY(QByteArray buffer READ get_buffer WRITE set_buffer RESET reset_buffer)
... ...
openbr/plugins/misc.cpp
... ... @@ -565,7 +565,8 @@ class ProgressCounterTransform : public TimeVaryingTransform
565 565 qint64 elapsed = timer.elapsed();
566 566 calls++;
567 567 set_calls++;
568   - // updated every 10 seconds
  568 +
  569 + // Updated every 5 seconds
569 570 if (elapsed > 5 * 1000) {
570 571 float f_elapsed = elapsed / 1000.0f;
571 572 // remaining calls (according to our input variable)
... ... @@ -578,7 +579,11 @@ class ProgressCounterTransform : public TimeVaryingTransform
578 579 // seconds remaining
579 580 int s = float(remaining) / speed;
580 581  
581   - 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));
  582 + // Output some timing information
  583 + 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));
  584 +
  585 + // Set globals
  586 + Globals->currentStep = calls;
582 587  
583 588 timer.start();
584 589 set_calls = 0;
... ...