Reinserts original comments
This commit is contained in:
112 files changed
+7113
-5131
No files matched your search
@@ -1,5 +1,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* some models for LogViewGui
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "LogViewModels.hpp"
|
||||
|
||||
@@ -10,20 +15,20 @@
|
||||
namespace N_LogView
|
||||
{
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// ---------------------------------------------------------------
|
||||
int ParticipantModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : m_particpants.size();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
int ParticipantModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : 3;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QVariant ParticipantModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (index.isValid() && index.row() < m_particpants.size())
|
||||
@@ -58,7 +63,7 @@ QVariant ParticipantModel::data(const QModelIndex &index, int role) const
|
||||
if (role == Qt::BackgroundRole)
|
||||
{
|
||||
if (p.first == 0)
|
||||
return QVariant();
|
||||
return QVariant(); // 0 aussen vor lassen
|
||||
if (m_participantHeatmap.isEmpty())
|
||||
updateHeatMap();
|
||||
return m_participantHeatmap.value(p.first);
|
||||
@@ -67,7 +72,7 @@ QVariant ParticipantModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QVariant ParticipantModel::headerData(int section,
|
||||
Qt::Orientation orientation,
|
||||
int role) const
|
||||
@@ -89,7 +94,7 @@ QVariant ParticipantModel::headerData(int section,
|
||||
return QAbstractTableModel::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void ParticipantModel::clearParticipants()
|
||||
{
|
||||
beginResetModel();
|
||||
@@ -99,7 +104,7 @@ void ParticipantModel::clearParticipants()
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
bool ParticipantModel::addUpdateParticipants(const QVector<int> &eqIds,
|
||||
const QVector<int> &issis,
|
||||
const QVector<int> &numberOfTelegrams)
|
||||
@@ -130,13 +135,13 @@ bool ParticipantModel::addUpdateParticipants(const QVector<int> &eqIds,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void ParticipantModel::updateHeatMap() const
|
||||
{
|
||||
int maxNumberOfTelegrams = 0;
|
||||
for (auto it = m_particpantMap.begin(); it != m_particpantMap.end(); ++it)
|
||||
{
|
||||
if (it.key() == 0)
|
||||
if (it.key() == 0) // EqId 0 aussen vor lassen
|
||||
continue;
|
||||
maxNumberOfTelegrams = std::max(it.value(), maxNumberOfTelegrams);
|
||||
}
|
||||
@@ -146,7 +151,7 @@ void ParticipantModel::updateHeatMap() const
|
||||
for (auto it = m_particpantMap.begin(); it != m_particpantMap.end(); ++it)
|
||||
{
|
||||
const int eqId = it.key();
|
||||
if (eqId == 0)
|
||||
if (eqId == 0) // EqId 0 aussen vor lassen
|
||||
continue;
|
||||
|
||||
const int nbrTelegrams = it.value();
|
||||
@@ -159,20 +164,20 @@ void ParticipantModel::updateHeatMap() const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// ---------------------------------------------------------------
|
||||
int TelegramModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : m_telegrams.size();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
int TelegramModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : 6;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QVariant TelegramModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (index.isValid() && index.row() < m_telegrams.size())
|
||||
@@ -226,7 +231,7 @@ QVariant TelegramModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QVariant TelegramModel::headerData(int section,
|
||||
Qt::Orientation orientation,
|
||||
int role) const
|
||||
@@ -257,7 +262,7 @@ QVariant TelegramModel::headerData(int section,
|
||||
return QAbstractTableModel::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramModel::clearTelegrams()
|
||||
{
|
||||
beginResetModel();
|
||||
@@ -265,7 +270,7 @@ void TelegramModel::clearTelegrams()
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramModel::appendTelegrams(const QVector<QSharedPointer<LogViewTelegram> > &telegrams)
|
||||
{
|
||||
if (telegrams.isEmpty())
|
||||
@@ -275,7 +280,7 @@ void TelegramModel::appendTelegrams(const QVector<QSharedPointer<LogViewTelegram
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramModel::appendTelegram(const QSharedPointer<LogViewTelegram> &telegram)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), m_telegrams.size(), m_telegrams.size());
|
||||
@@ -283,7 +288,7 @@ void TelegramModel::appendTelegram(const QSharedPointer<LogViewTelegram> &telegr
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QSharedPointer<LogViewTelegram> TelegramModel::telegram(int row) const
|
||||
{
|
||||
if (row >= 0 && row < m_telegrams.size())
|
||||
@@ -291,8 +296,8 @@ QSharedPointer<LogViewTelegram> TelegramModel::telegram(int row) const
|
||||
return QSharedPointer<LogViewTelegram>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterByEquipmentIds(bool bFilterByEquipmentIds)
|
||||
{
|
||||
if (m_bFilterByEquipmentIds == bFilterByEquipmentIds)
|
||||
@@ -304,7 +309,7 @@ void TelegramProxyModel::setFilterByEquipmentIds(bool bFilterByEquipmentIds)
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setAllowedEquipmentIds(const std::set<int> &allowedEquipmentIds)
|
||||
{
|
||||
if (m_allowedEquipmentIds == allowedEquipmentIds)
|
||||
@@ -316,7 +321,7 @@ void TelegramProxyModel::setAllowedEquipmentIds(const std::set<int> &allowedEqui
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilteredCentralTelegramIds(const std::set<int> &filteredCentralTelegramIds)
|
||||
{
|
||||
if (m_filteredCentralTelegramIds == filteredCentralTelegramIds)
|
||||
@@ -328,7 +333,7 @@ void TelegramProxyModel::setFilteredCentralTelegramIds(const std::set<int> &filt
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilteredTetraTelegramIds(const std::set<int> &filteredTetraTelegramIds)
|
||||
{
|
||||
if (m_filteredTetraTelegramIds == filteredTetraTelegramIds)
|
||||
@@ -340,7 +345,7 @@ void TelegramProxyModel::setFilteredTetraTelegramIds(const std::set<int> &filter
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilteredWlsTelegramIds(const std::set<int> &filteredWlsTelegramIds)
|
||||
{
|
||||
if (m_filteredWlsTelegramIds == filteredWlsTelegramIds)
|
||||
@@ -353,7 +358,7 @@ void TelegramProxyModel::setFilteredWlsTelegramIds(const std::set<int> &filtered
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterCentralTelegrams(N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnvProtocol direction,
|
||||
bool bFilter)
|
||||
{
|
||||
@@ -371,7 +376,7 @@ void TelegramProxyModel::setFilterCentralTelegrams(N_CoPrtCnv::CoPrtCnvLogHeader
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterTetraTelegrams(N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnvProtocol direction,
|
||||
bool bFilter)
|
||||
{
|
||||
@@ -389,7 +394,7 @@ void TelegramProxyModel::setFilterTetraTelegrams(N_CoPrtCnv::CoPrtCnvLogHeader::
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterTetraPDU(N_CoPrtCnv::CoPrtCnvRadioTelegram::E_PDU_Type pduType,
|
||||
bool bFilter)
|
||||
{
|
||||
@@ -424,7 +429,7 @@ void TelegramProxyModel::setFilterWlsTelegrams(N_CoPrtCnv::CoPrtCnvLogHeader::E_
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterTetraLogin(bool bFilter)
|
||||
{
|
||||
if (m_bFilterLoginTelegrams == bFilter)
|
||||
@@ -436,7 +441,7 @@ void TelegramProxyModel::setFilterTetraLogin(bool bFilter)
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
void TelegramProxyModel::setFilterTetraFragmented(bool bFilter)
|
||||
{
|
||||
if (m_bFilterFragmentedTelegrams == bFilter)
|
||||
@@ -448,7 +453,7 @@ void TelegramProxyModel::setFilterTetraFragmented(bool bFilter)
|
||||
endFilterChange();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
QSharedPointer<LogViewTelegram> TelegramProxyModel::telegram(int row) const
|
||||
{
|
||||
const TelegramModel *tm = qobject_cast<TelegramModel *>(sourceModel());
|
||||
@@ -458,7 +463,7 @@ QSharedPointer<LogViewTelegram> TelegramProxyModel::telegram(int row) const
|
||||
return tm->telegram(srcRow);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
bool TelegramProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
if (left.column() != right.column())
|
||||
@@ -489,10 +494,10 @@ bool TelegramProxyModel::lessThan(const QModelIndex &left, const QModelIndex &ri
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
bool TelegramProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||
{
|
||||
|
||||
// TODO: optimize
|
||||
const TelegramModel *tm = qobject_cast<TelegramModel *>(sourceModel());
|
||||
if (!tm)
|
||||
return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
@@ -578,4 +583,4 @@ bool TelegramProxyModel::filterAcceptsRow(int source_row, const QModelIndex &sou
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // namespace N_LogView;
|
||||
Reference in new issue
Block a user