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,7 +81,7 @@ struct AlgorithmCore
81 store(model); 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 void store(const QString &model) const 87 void store(const QString &model) const
@@ -154,6 +154,7 @@ struct AlgorithmCore @@ -154,6 +154,7 @@ struct AlgorithmCore
154 154
155 // Trust me, this makes complete sense. 155 // Trust me, this makes complete sense.
156 // We're just going to make a pipe with a placeholder first transform 156 // We're just going to make a pipe with a placeholder first transform
  157 + Globals->totalSteps = data.length();
157 QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard"; 158 QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard";
158 QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL)); 159 QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL));
159 160
openbr/gui/progress.cpp
1 #include <openbr/openbr.h> 1 #include <openbr/openbr.h>
  2 +#include <QDebug>
2 3
3 #include "progress.h" 4 #include "progress.h"
4 5
@@ -19,7 +20,7 @@ br::Progress::Progress(QWidget *parent) @@ -19,7 +20,7 @@ br::Progress::Progress(QWidget *parent)
19 addPermanentWidget(&pbProgress); 20 addPermanentWidget(&pbProgress);
20 addPermanentWidget(&lTimeRemaining); 21 addPermanentWidget(&lTimeRemaining);
21 connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress())); 22 connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress()));
22 - timer.start(1000); 23 + timer.start(5000);
23 } 24 }
24 25
25 /*** PRIVATE SLOTS ***/ 26 /*** PRIVATE SLOTS ***/
@@ -33,19 +34,8 @@ void br::Progress::checkProgress() @@ -33,19 +34,8 @@ void br::Progress::checkProgress()
33 pbProgress.setValue(progress); 34 pbProgress.setValue(progress);
34 if (progress > 100) pbProgress.setMaximum(0); 35 if (progress > 100) pbProgress.setMaximum(0);
35 else pbProgress.setMaximum(100); 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 } else { 37 } else {
47 clearMessage(); 38 clearMessage();
48 - lTimeRemaining.clear();  
49 } 39 }
50 40
51 pbProgress.setVisible(visible); 41 pbProgress.setVisible(visible);
openbr/openbr_plugin.h
@@ -688,12 +688,6 @@ public: @@ -688,12 +688,6 @@ public:
688 BR_PROPERTY(Filters, filters, Filters()) 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 * \brief File output is redirected here if the file's basename is 'buffer', clearing previous contents. 691 * \brief File output is redirected here if the file's basename is 'buffer', clearing previous contents.
698 */ 692 */
699 Q_PROPERTY(QByteArray buffer READ get_buffer WRITE set_buffer RESET reset_buffer) 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,7 +565,8 @@ class ProgressCounterTransform : public TimeVaryingTransform
565 qint64 elapsed = timer.elapsed(); 565 qint64 elapsed = timer.elapsed();
566 calls++; 566 calls++;
567 set_calls++; 567 set_calls++;
568 - // updated every 10 seconds 568 +
  569 + // Updated every 5 seconds
569 if (elapsed > 5 * 1000) { 570 if (elapsed > 5 * 1000) {
570 float f_elapsed = elapsed / 1000.0f; 571 float f_elapsed = elapsed / 1000.0f;
571 // remaining calls (according to our input variable) 572 // remaining calls (according to our input variable)
@@ -578,7 +579,11 @@ class ProgressCounterTransform : public TimeVaryingTransform @@ -578,7 +579,11 @@ class ProgressCounterTransform : public TimeVaryingTransform
578 // seconds remaining 579 // seconds remaining
579 int s = float(remaining) / speed; 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 timer.start(); 588 timer.start();
584 set_calls = 0; 589 set_calls = 0;