API Documentation
Loading...
Searching...
No Matches
LogView.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: LogView
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/LogStream.h>
35#include <QWidget>
36#include <QPointer>
37class QPushButton;
38class QComboBox;
39class QLabel;
40class QProgressBar;
41class QTableView;
42namespace NDEVR
43{
44 class FileChooserDialog;
45 class AsciiFileOutputStream;
46 class LogViewTable;
47 class SortedLogViewTable;
48 class Button;
49 class Toggle;
50 class QCustomLineEdit;
51 class QCustomComboBox;
52 /**--------------------------------------------------------------------------------------------------
53 \brief A table showing a specific log that allows the user to scroll around to view various log entries.
54 **/
55 class NDEVR_WIDGETS_API LogView : public QWidget, public LogStream
56 {
57 Q_OBJECT
58 public:
59 LogView(QWidget *parent = nullptr);
61 void showTimes(bool show_times);
62 void showLogConsole(bool show_log_console);
63 QSize sizeHint() const override;
64 QPointer<QProgressBar> createProgressBar(bool auto_hide = true);
65 void attachProgressBar(QPointer<QProgressBar> bar, bool auto_hide = true);
66 void clearLog();
68 void addWidgetToTop(QWidget* widget);
69 bool isAtBottom() const;
70 void changeEvent(QEvent* e) override;
71 void setProgressFormat(const String& format);
72 void resizeEvent(QResizeEvent* size) override;
73 void setDetectNewLines(bool detect);
74 void setProgress(fltp04 progress) final override;
75 void addMessage(const LogMessage& message) final override;
76 void addMessages(const Buffer<LogMessage>& messages) final override;
77 void attach(ProgressInfo* stream) final override;
78 void setMinimumLogLevel(uint01 log_level);
79 signals:
81 private slots:
82 void contextMenu(const QPoint &pos);
83 void updateLog();
84 void setLogFile();
85 void moveSliderToBottom(int, int);
86 void selected();
87 void updateSearch();
88 private:
89 void createMessageTable();
90 void allowCancel(bool) final override {}
91 private:
92 Button* m_save_button;
93 QCustomLineEdit* m_search_show_span;
94 QCustomComboBox* m_log_level;
95 QCustomLineEdit* m_search_edit;
96 QTableView* m_message_view;
97 LogViewTable* m_message_table;
98 SortedLogViewTable* m_sorted_table;
99 Buffer<QPointer<QProgressBar>> m_progress_bars;
100 Buffer<bool> m_progress_auto_hide;
101 Buffer<LogMessage> m_pending_messages;
102 FileChooserDialog* m_file_chooser;
103 AsciiFileOutputStream* m_ascii_stream;
104 Time m_last_scroll_time;
105 Toggle* m_show_micro_seconds;
106 fltp04 m_progress;
107 bool m_update_messages;
108 bool m_show_times;
109 bool m_show_log_console;
110 bool m_auto_scroll_to_bottom;
111 };
112}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
A LogStream that attached to a log, writes messages directly to a specified ascii file.
Definition AsciiFileOutputStream.h:45
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Definition FileChooserDialog.h:79
A class that allows for specific log information to be conveyed to a ProgressInfo object including in...
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
A table showing a specific log that allows the user to scroll around to view various log entries.
Definition LogView.h:56
void setProgress(fltp04 progress) final override
void setProgressFormat(const String &format)
QSize sizeHint() const override
void requestUpdateLogSignal()
QPointer< QProgressBar > createProgressBar(bool auto_hide=true)
bool isAtBottom() const
void attachProgressBar(QPointer< QProgressBar > bar, bool auto_hide=true)
void addWidgetToTop(QWidget *widget)
void setDetectNewLines(bool detect)
void showTimes(bool show_times)
LogView(QWidget *parent=nullptr)
void showLogConsole(bool show_log_console)
void jumpToBottom()
void setMinimumLogLevel(uint01 log_level)
void addMessage(const LogMessage &message) final override
void addMessages(const Buffer< LogMessage > &messages) final override
void resizeEvent(QResizeEvent *size) override
void attach(ProgressInfo *stream) final override
void changeEvent(QEvent *e) override
A model for creating a table that displays logged records.
Definition LogTable.h:44
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
A compact way to present a list of options to the user.
Definition QCustomCombobox.h:53
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition QCustomLineEdit.h:56
Sorts the logged entries in time-order.
Definition LogTable.h:77
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A Button that toggles between on and off. In desktop mode this looks like a checkbox and in touch mod...
Definition Toggle.h:49
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80