RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
LoggerListData.h
Go to the documentation of this file.
1#pragma once
2#include <wx/dataview.h>
3#include "LoggerLineData.h"
4
12{
17};
18
26class LoggerListData : public wxDataViewVirtualListModel
27{
28protected:
29 std::vector<LoggerLineData> myLoggerLineDatas;
31
32public:
44
56 virtual ~LoggerListData() = default;
57
70 virtual void AddToList(const LoggerLineData& dataToAdd);
71
72 //Implementation of base class virtuals to define model
88 virtual void GetValueByRow(wxVariant& variant, unsigned int row, unsigned int col) const override;
89
107 virtual bool GetAttrByRow(unsigned int row, unsigned int col, wxDataViewItemAttr& attr) const override;
108
125 virtual bool SetValueByRow(const wxVariant& variant, unsigned int row, unsigned int col) override;
126};
LoggerColumnID
Column indices for the logger data-view control.
Definition: LoggerListData.h:12
@ E_COL_ALERTLEVEL
The alert-level text column.
Definition: LoggerListData.h:15
@ E_COL_LOGTIME
The timestamp column.
Definition: LoggerListData.h:14
@ E_COL_EVENTDESCRIPTION
The event-description column.
Definition: LoggerListData.h:16
@ E_COL_ALERTICON
The alert-level icon column.
Definition: LoggerListData.h:13
One line of the on-screen log: a timestamp, an alert level, and an event description.
Definition: LoggerLineData.h:14
A virtual list model backing the on-screen log's data-view control, holding the log lines and colouri...
Definition: LoggerListData.h:27
std::vector< LoggerLineData > myLoggerLineDatas
The log lines backing the view, one per row.
Definition: LoggerListData.h:29
virtual bool SetValueByRow(const wxVariant &variant, unsigned int row, unsigned int col) override
Rejects edits from the UI: the log is read-only from the view's perspective.
Definition: LoggerListData.cpp:155
virtual void AddToList(const LoggerLineData &dataToAdd)
Appends a log line to the model and notifies the view that a row was added.
Definition: LoggerListData.cpp:32
LoggerListData()
Builds an empty logger list model.
Definition: LoggerListData.cpp:15
virtual void GetValueByRow(wxVariant &variant, unsigned int row, unsigned int col) const override
Supplies the value for a given row and column to the data-view control (icon, timestamp,...
Definition: LoggerListData.cpp:80
bool myHasWarnedAtCapacity
Latches the one-time "log is now rolling off" warning (see AddToList).
Definition: LoggerListData.h:30
virtual ~LoggerListData()=default
Defaulted destructor.
virtual bool GetAttrByRow(unsigned int row, unsigned int col, wxDataViewItemAttr &attr) const override
Supplies a per-row display attribute, colouring alert rows red/bold and warning rows amber so the log...
Definition: LoggerListData.cpp:119