logic: random fixes and improvements

* added new logos to setup ui
* changed wording in status messages and bundle nodes
* removed ununsed Vector.h
* save NameHierarchy to SearchMatch
* fixed NameHierarchyElement retrieval for name elements without parent
* fixed match weight to score last letters higher
This commit is contained in:
Eberhard Graether
2015-10-06 16:21:03 +02:00
parent 8d3112d5a9
commit 0fba3f5cf9
32 changed files with 107 additions and 98 deletions
-16
View File
@@ -1,16 +0,0 @@
#ifndef VECTOR_H
#define VECTOR_H
struct Vec4i
{
Vec4i(int x, int y, int z, int w)
: x(x)
, y(y)
, z(z)
, w(w)
{}
int x, y, z, w;
};
#endif // VECTOR_H
@@ -7,7 +7,8 @@
#include "utility/messaging/Message.h"
#include "utility/messaging/type/MessageStatus.h"
class MessageFinishedParsing: public Message<MessageFinishedParsing>
class MessageFinishedParsing
: public Message<MessageFinishedParsing>
{
public:
MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime, size_t errorCount)
@@ -33,7 +34,7 @@ public:
std::string getStatusStr() const
{
std::stringstream ss;
ss << "Parsing Finished: ";
ss << "Finished analysis: ";
ss << fileCount << "/" << totalFileCount << " files, ";
ss << std::setprecision(2) << std::fixed << parseTime << " seconds, ";
ss << errorCount << " error(s)";
+1 -1
View File
@@ -166,6 +166,6 @@ void TaskScheduler::handleMessage(MessageInterruptTasks* message)
std::lock_guard<std::mutex> lock(m_tasksMutex);
if (m_tasks.size())
{
MessageStatus("Stop running tasks...").dispatch();
MessageStatus("Stop running tasks...", false, true).dispatch();
}
}
+13
View File
@@ -1,5 +1,6 @@
#include "utility/text/Dictionary.h"
#include "data/name/NameHierarchy.h"
#include "utility/utilityString.h"
Dictionary::Dictionary()
@@ -84,6 +85,18 @@ std::deque<Id> Dictionary::getWordIdsConst(const std::string& wordList, const st
return ids;
}
std::deque<Id> Dictionary::getWordIdsConst(const NameHierarchy& nameHierarchy) const
{
std::deque<Id> ids;
for (size_t i = 0; i < nameHierarchy.size(); i++)
{
ids.push_back(getWordIdConst(nameHierarchy[i]->getFullName()));
}
return ids;
}
const std::string& Dictionary::getWord(Id id) const
{
std::unordered_map<Id, std::string>::const_iterator it = m_words.find(id);
+3
View File
@@ -9,6 +9,8 @@
#include "utility/types.h"
class NameHierarchy;
class Dictionary
{
public:
@@ -25,6 +27,7 @@ public:
std::deque<Id> getWordIds(const std::string& wordList, const std::string& delimiter);
std::deque<Id> getWordIdsConst(const std::string& wordList, const std::string& delimiter) const;
std::deque<Id> getWordIdsConst(const NameHierarchy& nameHierarchy) const;
// Note: References to values in an unordered_map don't change on rehashing so they can be saved and used elsewhere.
const std::string& getWord(Id id) const;