From cdf47978514a0f12b199cf5aa8b07c2a7f44311e Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Mon, 18 Aug 2014 13:54:49 -0400 Subject: [PATCH] Reverted to the old progress display --- openbr/gui/progress.cpp | 2 +- openbr/openbr_plugin.cpp | 2 +- openbr/openbr_plugin.h | 3 +++ openbr/plugins/misc.cpp | 9 +++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/openbr/gui/progress.cpp b/openbr/gui/progress.cpp index 482367b..7cf276d 100644 --- a/openbr/gui/progress.cpp +++ b/openbr/gui/progress.cpp @@ -27,7 +27,7 @@ br::Progress::Progress(QWidget *parent) void br::Progress::checkProgress() { const int progress = 100 * br_progress(); - const bool visible = progress >= 0 && progress < 100; + const bool visible = progress > 0 && progress < 100; if (visible) { showMessage(Globals->mostRecentMessage); diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 67a89fb..223cc47 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -937,7 +937,7 @@ void br::Context::printStatus() const float p = progress(); if (p < 1) { int s = timeRemaining(); - fprintf(stderr,"\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g/%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentProgress, Globals->totalSteps); + fprintf(stderr,"\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentStep); fflush(stderr); } } diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 4413f66..e5e09c2 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -696,6 +696,9 @@ public: * \brief Used internally to compute progress() and timeRemaining(). */ + Q_PROPERTY(double currentStep READ get_currentStep WRITE set_currentStep RESET reset_currentStep) + BR_PROPERTY(double, currentStep, 0) + Q_PROPERTY(double currentProgress READ get_currentProgress WRITE set_currentProgress RESET reset_currentProgress) BR_PROPERTY(double, currentProgress, 0) diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 5d0af07..1ecfc34 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -663,6 +663,8 @@ class ProgressCounterTransform : public TimeVaryingTransform Globals->currentProgress = dst[i].file.get("progress",0)+1; dst[i].file.remove("progress"); last_frame = frame; + + Globals->currentStep++; } } @@ -684,10 +686,12 @@ class ProgressCounterTransform : public TimeVaryingTransform { (void) data; float p = br_progress(); - Globals->currentProgress = totalProgress; - qDebug("\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g/%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(0).toStdString().c_str(), Globals->currentProgress, Globals->totalSteps); + qDebug("\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(0).toStdString().c_str(), Globals->currentStep); timer.start(); Globals->startTime.start(); + Globals->currentStep = 0; + Globals->currentProgress = 0; + Globals->totalSteps = totalProgress; } void init() @@ -695,6 +699,7 @@ class ProgressCounterTransform : public TimeVaryingTransform timer.start(); Globals->startTime.start(); Globals->currentProgress = 0; + Globals->currentStep = 0; Globals->totalSteps = totalProgress; } -- libgit2 0.21.4