API Documentation
Loading...
Searching...
No Matches
ConnectionStatusWidget.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: NDEVR
28File: BatteryWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Connection.h>
35#include <NDEVR/LogStream.h>
36#include <QLabel>
37#include <QPointer>
38namespace NDEVR
39{
40 class ProgressWidget;
41 class QCustomLabel;
42 class StatusBar;
43 class Log;
45 {
46 Q_OBJECT
47 public:
48 explicit ConnectionStatusWidget(QWidget* parent = nullptr);
49 void setSensor(Connection* sensor);
54 void setCustomTitle(const TranslatedString& custom_title);
55 void setHorizontal(bool horizontal);
56 void setActAsLog(bool act_like_log);
57 void setColor(RGBColor color);
58 virtual void setProgress(fltp04 progress) override;
59 protected:
61 void init();
62 virtual void addMessage(const LogMessage& message) override;
63 protected slots:
66 protected:
67 QPointer<Connection> m_sensor;
73 ConnectionState m_connection_state = ConnectionState::e_no_connection;
74 fltp04 m_pending_progress = Constant<fltp04>::Invalid;
76 bool m_owns_log = false;
77 bool m_has_connection_object = false;
78 bool m_act_like_log = false;
79
80 };
81}
#define HARDWARE_WIDGETS_API
Definition DLLInfo.h:74
A standard interface for all types of connections that allow transmitting and recieving of.
Definition Connection.h:182
Definition ConnectionStatusWidget.h:45
void connectionStateUpdatedSlot(ConnectionState state)
bool m_is_horizontal
Definition ConnectionStatusWidget.h:75
ConnectionStatusWidget(QWidget *parent=nullptr)
void setColor(RGBColor color)
void setConnectionState(ConnectionState state)
void setSensor(Connection *sensor)
virtual void addMessage(const LogMessage &message) override
void setActAsLog(bool act_like_log)
ProgressWidget * m_progress_widget
Definition ConnectionStatusWidget.h:70
TranslatedString m_custom_title
Definition ConnectionStatusWidget.h:72
void setCustomTitle(const TranslatedString &custom_title)
Log * m_log
Definition ConnectionStatusWidget.h:71
void setHorizontal(bool horizontal)
virtual void setProgress(fltp04 progress) override
QPointer< Connection > m_sensor
Definition ConnectionStatusWidget.h:67
QCustomLabel * m_status_label
Definition ConnectionStatusWidget.h:69
QCustomLabel * m_title_label
Definition ConnectionStatusWidget.h:68
Serves as the primary program interface for processes to report issues and allows any number of.
Definition Log.h:48
A class that allows for specific log information to be conveyed to a ProgressInfo object.
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
Definition ProgressWidget.h:43
Displays translated text. No user interaction functionality is provided. The visual appearance.
Definition QCustomLabel.h:46
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:125
ConnectionState
Definition Connection.h:53
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230