API Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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;
44 /**--------------------------------------------------------------------------------------------------
45 \brief A dial and information text that shows the current status of a connection. Typically shown
46 when a connection is being attempted to keep the user informed on the status of the connection
47 attempt.
48 **/
50 {
51 Q_OBJECT
52 public:
53 explicit ConnectionStatusWidget(QWidget* parent = nullptr);
54 void setSensor(Connection* sensor);
59 void setCustomTitle(const TranslatedString& custom_title);
60 void setHorizontal(bool horizontal);
61 void setActAsLog(bool act_like_log);
62 void setColor(RGBColor color);
63 virtual void setProgress(fltp04 progress) override;
64 protected:
66 void init();
67 virtual void addMessage(const LogMessage& message) override;
68 protected slots:
71 protected:
72 QPointer<Connection> m_sensor;
78 ConnectionState m_connection_state = ConnectionState::e_no_connection;
79 fltp04 m_pending_progress = Constant<fltp04>::Invalid;
81 bool m_owns_log = false;
82 bool m_has_connection_object = false;
83 bool m_act_like_log = false;
84
85 };
86}
#define HARDWARE_WIDGETS_API
Definition DLLInfo.h:56
A standard interface for all types of connections that allow transmitting and recieving of data betwe...
Definition Connection.h:198
A dial and information text that shows the current status of a connection. Typically shown when a con...
Definition ConnectionStatusWidget.h:50
void connectionStateUpdatedSlot(ConnectionState state)
bool m_is_horizontal
Definition ConnectionStatusWidget.h:80
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:75
TranslatedString m_custom_title
Definition ConnectionStatusWidget.h:77
void setCustomTitle(const TranslatedString &custom_title)
Log * m_log
Definition ConnectionStatusWidget.h:76
void setHorizontal(bool horizontal)
virtual void setProgress(fltp04 progress) override
QPointer< Connection > m_sensor
Definition ConnectionStatusWidget.h:72
QCustomLabel * m_status_label
Definition ConnectionStatusWidget.h:74
QCustomLabel * m_title_label
Definition ConnectionStatusWidget.h:73
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Definition Log.h:48
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
Displays the progress, either horizontally as a bar or as a roand spin dial. Contains various options...
Definition ProgressWidget.h:47
Displays translated text. No user interaction functionality is provided. The visual appearance of the...
Definition QCustomLabel.h:46
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
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
ConnectionState
Describes the state of the connection.
Definition Connection.h:57
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233