25#include <QAbstractTableModel>
32#include <ArmarXCore/interface/core/Log.h>
103 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
104 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
105 QVariant
data(
const QModelIndex&
index,
int role)
const override;
106 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
107 bool setData(
const QModelIndex&
index,
const QVariant& value,
int role)
override;
108 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
113 void addFilter(
const std::string& columnName,
114 const std::string& filter,
121 void search(
const QString& searchStr);
126 return activeSearchStr;
132 return maxNewLogLevelType;
135 int getColumn(
const std::string& columnName)
const;
143 const std::vector<LogFilter>&
146 return activeFilters;
154 int addEntries(
const std::vector<LogSeq>& seqs, MessageType* batchMaxLevelOut =
nullptr);
203 bool matchesSearch =
false;
204 bool injected =
false;
210 void rebuildRowsFromStore();
214 void applyMarkersLocked();
217 const StoredLogEntry* entryAt(
int row)
const;
219 QString activeSearchStr;
220 MessageType maxNewLogLevelType;
221 std::vector<LogFilter> activeFilters;
224 std::size_t maxEntries = 10000;
226 const LogStore* store =
nullptr;
231 bool materialised =
false;
235 LogSeq clearedBeforeSeq = 0;
237 std::vector<Row> rows;
238 mutable std::mutex rowsMutex;
241 LogMarkerRegistry* markerRegistry =
nullptr;
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Shared, session-only store of pinned ("labeled") log lines.
The single bounded buffer holding every log line the viewer retains.
void setMaterialised(bool materialised)
Build rows (materialised) or drop them and only keep counting (not).
MessageType getMaxNewLogLevelType()
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
void setMarkerRegistry(LogMarkerRegistry *registry)
Attach the shared pin registry.
bool isMaterialised() const
void dropRowsBefore(LogSeq firstSeq)
Discard rows whose store entry has been dropped. Called after the store trims.
void addFilter(const std::string &columnName, const std::string &filter, MatchMode mode=MatchMode::Contains)
bool applyFilters(const LogMessage &logMsg)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
LogTableModel(QObject *parent=0)
bool isRowMarked(int row) const
Whether the given display row is currently pinned (has a label color).
bool setData(const QModelIndex &index, const QVariant &value, int role) override
bool applyFilter(const LogFilter &filter, const LogMessage &logMsg)
int lineCountAt(int row) const
Number of display lines of the message column for the given row.
void setMaxEntries(std::size_t maxEntries)
Upper bound on displayed rows.
int rowForSeq(LogSeq seq) const
Display row showing seq, or -1 if it is not shown.
int addEntries(const std::vector< LogSeq > &seqs, MessageType *batchMaxLevelOut=nullptr)
Append those of seqs that pass this model's filters, in one insertion.
QString getCurrentSearchStr()
const LogMessage & getLogEntry(size_t row) const
The message shown in the given row. Only valid while the row exists.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
LogSeq seqAt(int row) const
Store sequence number of the given display row, or 0 if the row is invalid.
void enforceMaxEntries()
Trim the oldest rows once the display window is exceeded.
int getColumn(const std::string &columnName) const
bool msgContainsString(const LogMessage &logMsg, QString searchStr) const
const std::vector< LogFilter > & getFilters() const
bool rowContainsString(int row, const QString &searchStr) const
void refreshMarkers()
Rebuild the set of injected pin rows and re-color rows (full reset).
void setStore(const LogStore *store)
Attach the shared backing store. Must be called before any ingestion.
void search(const QString &searchStr)
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
This file offers overloads of toIce() and fromIce() functions for STL container types.
quint64 LogSeq
Identifies a stored log entry for as long as it is retained.
bool Contains(const ContainerType &container, const ElementType &searchElement)
int intValue
value as int, for the verbosity / file-line comparisons
QString qValue
value as QString, for substring (Contains) matching