Add total number of results in manage

This commit is contained in:
Ricardo Montañana Gómez 2023-10-23 16:22:15 +02:00
parent 1f705f6018
commit 858664be2d
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE
3 changed files with 10 additions and 8 deletions

View File

@ -11,7 +11,7 @@
namespace platform { namespace platform {
ManageResults::ManageResults(int numFiles, const string& model, const string& score, bool complete, bool partial, bool compare) : ManageResults::ManageResults(int numFiles, const string& model, const string& score, bool complete, bool partial, bool compare) :
numFiles{ numFiles }, complete{ complete }, partial{ partial }, compare{ compare }, results(Results(Paths::results(), model, score, complete, partial, compare)) numFiles{ numFiles }, complete{ complete }, partial{ partial }, compare{ compare }, results(Results(Paths::results(), model, score, complete, partial))
{ {
indexList = true; indexList = true;
openExcel = false; openExcel = false;
@ -37,8 +37,11 @@ namespace platform {
exit(0); exit(0);
} }
auto temp = ConfigLocale(); auto temp = ConfigLocale();
cout << Colors::GREEN() << "Results found: " << numFiles << endl; string suffix = numFiles != results.size() ? " of " + to_string(results.size()) : "";
cout << "-------------------" << endl; stringstream oss;
oss << "Results on screen: " << numFiles << suffix;
cout << Colors::GREEN() << oss.str() << endl;
cout << string(oss.str().size(), '-') << endl;
if (complete) { if (complete) {
cout << Colors::MAGENTA() << "Only listing complete results" << endl; cout << Colors::MAGENTA() << "Only listing complete results" << endl;
} }

View File

@ -2,8 +2,8 @@
#include <algorithm> #include <algorithm>
namespace platform { namespace platform {
Results::Results(const string& path, const string& model, const string& score, bool complete, bool partial, bool compare) : Results::Results(const string& path, const string& model, const string& score, bool complete, bool partial) :
path(path), model(model), scoreName(score), complete(complete), partial(partial), compare(compare) path(path), model(model), scoreName(score), complete(complete), partial(partial)
{ {
load(); load();
maxModel = (*max_element(files.begin(), files.end(), [](const Result& a, const Result& b) { return a.getModel().size() < b.getModel().size(); })).getModel().size(); maxModel = (*max_element(files.begin(), files.end(), [](const Result& a, const Result& b) { return a.getModel().size() < b.getModel().size(); })).getModel().size();

View File

@ -11,13 +11,13 @@ namespace platform {
class Results { class Results {
public: public:
Results(const string& path, const string& model, const string& score, bool complete, bool partial, bool compare); Results(const string& path, const string& model, const string& score, bool complete, bool partial);
void sortDate(); void sortDate();
void sortScore(); void sortScore();
void sortModel(); void sortModel();
void sortDuration(); void sortDuration();
int maxModelSize() const { return maxModel; }; int maxModelSize() const { return maxModel; };
void hideResult(int index, const string& path); void hideResult(int index, const string& pathHidden);
void deleteResult(int index); void deleteResult(int index);
int size() const; int size() const;
bool empty() const; bool empty() const;
@ -30,7 +30,6 @@ namespace platform {
string scoreName; string scoreName;
bool complete; bool complete;
bool partial; bool partial;
bool compare;
int maxModel; int maxModel;
vector<Result> files; vector<Result> files;
void load(); // Loads the list of results void load(); // Loads the list of results