Commit cdf47978514a0f12b199cf5aa8b07c2a7f44311e
1 parent
5e7ee449
Reverted to the old progress display
Showing
4 changed files
with
12 additions
and
4 deletions
openbr/gui/progress.cpp
| @@ -27,7 +27,7 @@ br::Progress::Progress(QWidget *parent) | @@ -27,7 +27,7 @@ br::Progress::Progress(QWidget *parent) | ||
| 27 | void br::Progress::checkProgress() | 27 | void br::Progress::checkProgress() |
| 28 | { | 28 | { |
| 29 | const int progress = 100 * br_progress(); | 29 | const int progress = 100 * br_progress(); |
| 30 | - const bool visible = progress >= 0 && progress < 100; | 30 | + const bool visible = progress > 0 && progress < 100; |
| 31 | 31 | ||
| 32 | if (visible) { | 32 | if (visible) { |
| 33 | showMessage(Globals->mostRecentMessage); | 33 | showMessage(Globals->mostRecentMessage); |
openbr/openbr_plugin.cpp
| @@ -937,7 +937,7 @@ void br::Context::printStatus() | @@ -937,7 +937,7 @@ void br::Context::printStatus() | ||
| 937 | const float p = progress(); | 937 | const float p = progress(); |
| 938 | if (p < 1) { | 938 | if (p < 1) { |
| 939 | int s = timeRemaining(); | 939 | int s = timeRemaining(); |
| 940 | - 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); | 940 | + 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); |
| 941 | fflush(stderr); | 941 | fflush(stderr); |
| 942 | } | 942 | } |
| 943 | } | 943 | } |
openbr/openbr_plugin.h
| @@ -696,6 +696,9 @@ public: | @@ -696,6 +696,9 @@ public: | ||
| 696 | * \brief Used internally to compute progress() and timeRemaining(). | 696 | * \brief Used internally to compute progress() and timeRemaining(). |
| 697 | */ | 697 | */ |
| 698 | 698 | ||
| 699 | + Q_PROPERTY(double currentStep READ get_currentStep WRITE set_currentStep RESET reset_currentStep) | ||
| 700 | + BR_PROPERTY(double, currentStep, 0) | ||
| 701 | + | ||
| 699 | Q_PROPERTY(double currentProgress READ get_currentProgress WRITE set_currentProgress RESET reset_currentProgress) | 702 | Q_PROPERTY(double currentProgress READ get_currentProgress WRITE set_currentProgress RESET reset_currentProgress) |
| 700 | BR_PROPERTY(double, currentProgress, 0) | 703 | BR_PROPERTY(double, currentProgress, 0) |
| 701 | 704 |
openbr/plugins/misc.cpp
| @@ -663,6 +663,8 @@ class ProgressCounterTransform : public TimeVaryingTransform | @@ -663,6 +663,8 @@ class ProgressCounterTransform : public TimeVaryingTransform | ||
| 663 | Globals->currentProgress = dst[i].file.get<qint64>("progress",0)+1; | 663 | Globals->currentProgress = dst[i].file.get<qint64>("progress",0)+1; |
| 664 | dst[i].file.remove("progress"); | 664 | dst[i].file.remove("progress"); |
| 665 | last_frame = frame; | 665 | last_frame = frame; |
| 666 | + | ||
| 667 | + Globals->currentStep++; | ||
| 666 | } | 668 | } |
| 667 | } | 669 | } |
| 668 | 670 | ||
| @@ -684,10 +686,12 @@ class ProgressCounterTransform : public TimeVaryingTransform | @@ -684,10 +686,12 @@ class ProgressCounterTransform : public TimeVaryingTransform | ||
| 684 | { | 686 | { |
| 685 | (void) data; | 687 | (void) data; |
| 686 | float p = br_progress(); | 688 | float p = br_progress(); |
| 687 | - Globals->currentProgress = totalProgress; | ||
| 688 | - 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); | 689 | + 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); |
| 689 | timer.start(); | 690 | timer.start(); |
| 690 | Globals->startTime.start(); | 691 | Globals->startTime.start(); |
| 692 | + Globals->currentStep = 0; | ||
| 693 | + Globals->currentProgress = 0; | ||
| 694 | + Globals->totalSteps = totalProgress; | ||
| 691 | } | 695 | } |
| 692 | 696 | ||
| 693 | void init() | 697 | void init() |
| @@ -695,6 +699,7 @@ class ProgressCounterTransform : public TimeVaryingTransform | @@ -695,6 +699,7 @@ class ProgressCounterTransform : public TimeVaryingTransform | ||
| 695 | timer.start(); | 699 | timer.start(); |
| 696 | Globals->startTime.start(); | 700 | Globals->startTime.start(); |
| 697 | Globals->currentProgress = 0; | 701 | Globals->currentProgress = 0; |
| 702 | + Globals->currentStep = 0; | ||
| 698 | Globals->totalSteps = totalProgress; | 703 | Globals->totalSteps = totalProgress; |
| 699 | } | 704 | } |
| 700 | 705 |