-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1624 from uklotzde/lp1737537_analysis_revamp
Analysis Revamp
- Loading branch information
Showing
43 changed files
with
1,869 additions
and
894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "util/math.h" | ||
|
||
|
||
typedef double AnalyzerProgress; | ||
|
||
constexpr AnalyzerProgress kAnalyzerProgressUnknown = -1.0; | ||
constexpr AnalyzerProgress kAnalyzerProgressNone = 0.0; // 0.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressHalf = 0.5; // 50.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressFinalizing = 0.95; // 95.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressDone = 1.0; // 100.0% | ||
|
||
Q_DECLARE_METATYPE(AnalyzerProgress); | ||
|
||
// Integer [0, 100] | ||
inline | ||
int analyzerProgressPercent(AnalyzerProgress analyzerProgress) { | ||
DEBUG_ASSERT(analyzerProgress >= kAnalyzerProgressNone); | ||
const auto analyzerProgressClamped = | ||
math_min(analyzerProgress, kAnalyzerProgressDone); | ||
return static_cast<int>(std::round( | ||
100 * (analyzerProgressClamped - kAnalyzerProgressNone) / | ||
(kAnalyzerProgressDone - kAnalyzerProgressNone))); | ||
} |
Oops, something went wrong.