Reinserts original comments
This commit is contained in:
112 files changed
+7113
-5131
No files matched your search
@@ -1,15 +1,15 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// **************************************************************************
|
||||
//
|
||||
// (C) Copyright 2009 Swiss SIMTEC AG
|
||||
//
|
||||
// **************************************************************************
|
||||
//
|
||||
// $HeadURL$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $LastChangedRevision$
|
||||
//
|
||||
// **************************************************************************
|
||||
|
||||
#include "LogViewField.hpp"
|
||||
#include <utility>
|
||||
@@ -20,7 +20,7 @@
|
||||
namespace N_LogView
|
||||
{
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
LogViewField::LogViewField(const QString& a_name, const E_FieldKind a_kind, const LogViewXdrElement* a_xdrElement)
|
||||
: m_logger(getLogger("LogViewField")),
|
||||
m_Name(a_name),
|
||||
@@ -36,7 +36,7 @@ LogViewField::LogViewField(const QString& a_name, const E_FieldKind a_kind, cons
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
LogViewField::~LogViewField()
|
||||
{
|
||||
for (LogViewField *f : std::as_const(m_Child))
|
||||
@@ -70,14 +70,14 @@ LogViewField *LogViewField::clone(int arrayIdx) const
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::addChild(LogViewField* a_child)
|
||||
{
|
||||
if (a_child)
|
||||
m_Child.push_back(a_child);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::removeLastChild()
|
||||
{
|
||||
if (m_Child.empty())
|
||||
@@ -86,7 +86,7 @@ void LogViewField::removeLastChild()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
LogViewField* LogViewField::child(int arrayIdx)
|
||||
{
|
||||
if (m_Child.size() > arrayIdx)
|
||||
@@ -94,13 +94,13 @@ LogViewField* LogViewField::child(int arrayIdx)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::addValue(const QString &value)
|
||||
{
|
||||
m_ValueList.append(value);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::addValueBinaryHex(const QString &value)
|
||||
{
|
||||
const QByteArray ba = QByteArray::fromHex(value.toLatin1());
|
||||
@@ -109,13 +109,13 @@ void LogViewField::addValueBinaryHex(const QString &value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Returns the value at position a_index converted to a string.
|
||||
// If the field is a date-time-field, the returned value is
|
||||
// converted to a string containing date and time, execpt when
|
||||
// a_doNotMakeSpecialConversions is set to true, the unix-time
|
||||
// will be returned as value.
|
||||
// ---------------------------------------------------------------
|
||||
QString LogViewField::value(int arrayIdx, const bool a_doNotMakeSpecialConversions) const
|
||||
{
|
||||
if (m_ValueList.size() > arrayIdx)
|
||||
@@ -133,7 +133,7 @@ QString LogViewField::value(int arrayIdx, const bool a_doNotMakeSpecialConversio
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
int64_t LogViewField::getHighestValue() const
|
||||
{
|
||||
switch (m_XdrElement->getKind())
|
||||
@@ -141,9 +141,9 @@ int64_t LogViewField::getHighestValue() const
|
||||
case LogViewXdrElement::e_KindStandardType:
|
||||
{
|
||||
int64_t highest = 1;
|
||||
|
||||
//const LogViewXdrStandardType* xdrStandardType = static_cast<const LogViewXdrStandardType*>(m_XdrElement);
|
||||
uint16_t bitSize = 8*static_cast<const LogViewXdrStandardType*>(m_XdrElement)->getEditSize();
|
||||
|
||||
// fixme: mache configurierbar
|
||||
if ((0 == m_Name.compare(QLatin1String("utm nordwert"), Qt::CaseInsensitive)) ||
|
||||
(0 == m_Name.compare(QLatin1String("utm ostwert"), Qt::CaseInsensitive)))
|
||||
bitSize -= 8;
|
||||
@@ -172,7 +172,7 @@ int64_t LogViewField::getHighestValue() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
int64_t LogViewField::getLowestValue() const
|
||||
{
|
||||
switch (m_XdrElement->getKind())
|
||||
@@ -180,7 +180,7 @@ int64_t LogViewField::getLowestValue() const
|
||||
case LogViewXdrElement::e_KindStandardType:
|
||||
{
|
||||
int64_t lowest = 0;
|
||||
|
||||
//const LogViewXdrStandardType* xdrStandardType = static_cast<const LogViewXdrStandardType*>(a_field->getXdrElement());
|
||||
switch (static_cast<const LogViewXdrStandardType*>(m_XdrElement)->getValueKind()) {
|
||||
case LogViewXdrStandardType::e_Boolean:
|
||||
return 0;
|
||||
@@ -201,12 +201,12 @@ int64_t LogViewField::getLowestValue() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::dump(const QString &a_indent) const
|
||||
{
|
||||
INFO_LOG(m_logger) << a_indent << "[";
|
||||
INFO_LOG(m_logger) << a_indent << "Field[" << m_Name << "]: m_Kind=" << m_Kind << " m_Offset=" << m_Offset << " m_Size=" << m_Size << " m_MaxArraySize=" << m_MaxArraySize << " m_IsRightAligned=" << m_IsRightAligned << " m_IsDynamicArray=" << m_IsDynamicArray << " m_ToolTipText=" << m_ToolTipText;
|
||||
|
||||
// m_XdrElement->dump();
|
||||
for (int i=0; i<m_ValueList.size(); i++)
|
||||
INFO_LOG(m_logger) << a_indent << "m_Value[" << i << "]=" << m_ValueList[i];
|
||||
|
||||
@@ -217,25 +217,25 @@ void LogViewField::dump(const QString &a_indent) const
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Makes the text <a_uncleanText> pretty for human readable.
|
||||
// It does following:
|
||||
// - generates umlaute (ä, ö, ü)
|
||||
// - removes _rt at end
|
||||
// - replaces _ with space
|
||||
// - uppercase of every word
|
||||
// ---------------------------------------------------------------
|
||||
QString LogViewField::makeClean(const QString &text)
|
||||
{
|
||||
QString a_uncleanText = text;
|
||||
|
||||
// remove _rt at end
|
||||
if (a_uncleanText.endsWith(QLatin1String("_rt")))
|
||||
a_uncleanText = a_uncleanText.left(a_uncleanText.length() - 3);
|
||||
|
||||
|
||||
// replace _ with space
|
||||
a_uncleanText = a_uncleanText.replace(QLatin1Char('_'), QLatin1Char(' '));
|
||||
|
||||
|
||||
// first character of every word must be uppercase
|
||||
int pos = 0;
|
||||
while (a_uncleanText.length() > pos)
|
||||
{
|
||||
@@ -250,9 +250,9 @@ QString LogViewField::makeClean(const QString &text)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// returns true if the field is a date-time
|
||||
// ---------------------------------------------------------------
|
||||
bool LogViewField::isDateTimeField() const
|
||||
{
|
||||
QString name = m_Name.toLower();
|
||||
@@ -266,11 +266,11 @@ bool LogViewField::isMSecsField() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void LogViewField::setMaxArraySize(uint16_t newVal, const bool a_isDynamic)
|
||||
{
|
||||
m_MaxArraySize = newVal;
|
||||
m_IsDynamicArray = a_isDynamic;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace N_LogView
|
||||
Reference in new issue
Block a user