Commit 7c7a4a3933781ee3fe747fe49613e680c394e3a1

Authored by Scott Klum
1 parent 1230b351

Fixed stream bug that caused an extra template to be returned from br::enroll

openbr/core/core.cpp
... ... @@ -81,7 +81,7 @@ struct AlgorithmCore
81 81 store(model);
82 82 }
83 83  
84   - qDebug("Training Time: %s", qPrintable(QtUtils::toTime(Globals->startTime.elapsed())));
  84 + qDebug("Training Time: %s", qPrintable(QtUtils::toTime(Globals->startTime.elapsed()/1000.0f)));
85 85 }
86 86  
87 87 void store(const QString &model) const
... ... @@ -184,6 +184,7 @@ struct AlgorithmCore
184 184 wrapper->projectUpdate(data,data);
185 185  
186 186 files.append(data.files());
  187 +
187 188 return files;
188 189 }
189 190  
... ...
openbr/gui/progress.cpp
1 1 #include <openbr/openbr.h>
2   -#include <QDebug>
3 2  
4 3 #include "progress.h"
5 4  
... ... @@ -20,7 +19,7 @@ br::Progress::Progress(QWidget *parent)
20 19 addPermanentWidget(&pbProgress);
21 20 addPermanentWidget(&lTimeRemaining);
22 21 connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress()));
23   - timer.start(5000);
  22 + timer.start(1000);
24 23 }
25 24  
26 25 /*** PRIVATE SLOTS ***/
... ... @@ -34,8 +33,19 @@ void br::Progress::checkProgress()
34 33 pbProgress.setValue(progress);
35 34 if (progress > 100) pbProgress.setMaximum(0);
36 35 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 + }
37 46 } else {
38 47 clearMessage();
  48 + lTimeRemaining.clear();
39 49 }
40 50  
41 51 pbProgress.setVisible(visible);
... ...
openbr/plugins/misc.cpp
... ... @@ -565,8 +565,7 @@ class ProgressCounterTransform : public TimeVaryingTransform
565 565 qint64 elapsed = timer.elapsed();
566 566 calls++;
567 567 set_calls++;
568   -
569   - // Updated every 5 seconds
  568 + // updated every 10 seconds
570 569 if (elapsed > 5 * 1000) {
571 570 float f_elapsed = elapsed / 1000.0f;
572 571 // remaining calls (according to our input variable)
... ... @@ -579,11 +578,7 @@ class ProgressCounterTransform : public TimeVaryingTransform
579 578 // seconds remaining
580 579 int s = float(remaining) / speed;
581 580  
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;
  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));
587 582  
588 583 timer.start();
589 584 set_calls = 0;
... ...
openbr/plugins/stream.cpp
... ... @@ -1075,9 +1075,13 @@ public:
1075 1075 final_output.append(output_set);
1076 1076 }
1077 1077  
  1078 + // Clear dst, since we set it to src so that the datasource could open it
  1079 + dst.clear();
  1080 +
1078 1081 // dst is set to all output received by the final stage, along
1079 1082 // with anything output via the calls to finalize.
1080 1083 //dst = collectionStage->getOutput();
  1084 +
1081 1085 foreach(const TemplateList & list, collector->sets) {
1082 1086 dst.append(list);
1083 1087 }
... ...