API Documentation
Loading...
Searching...
No Matches
BatteryWidget.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/Battery.h>
35#include <NDEVR/Button.h>
36#include <NDEVR/Dictionary.h>
37#include <NDEVR/UUID.h>
38#include <QPointer>
39class QLabel;
40class QGridLayout;
41namespace NDEVR
42{
43 class ProgressWidget;
44 class Battery;
45 class QCustomLabel;
47 {
48 Q_OBJECT
49 public:
50 void addSensors(const Buffer<Battery*>& sensors);
51 void removeSensors(const Buffer<Battery*>& sensors);
52 static BatteryAlertWatcher& Default();
53 void addLocalBatteries();
54 protected slots:
55 void stateChangeSlot(bool originator);
56 protected:
58 };
60 {
61 Q_OBJECT
62 public:
63 explicit BatteryWidget(QWidget* parent = nullptr);
64 void setSensors(const Buffer<Battery*>& sensors);
65 void setSensor(Battery* sensor);
66 void addSensor(Battery* sensor, bool update = true);
67 void removeSensor(Battery* sensor, bool update = true);
68 void clearSensors(bool update = true);
69 void setColumnCount(uint04 column_count);
70 void addLocalBatteries();
71 protected slots:
72 void updatedSlot();
73 protected:
74 void updateLayout();
75 [[nodiscard]] RGBColor getColor(uint04 state) const;
76 protected:
80 QGridLayout* m_layout;
81 uint04 m_column_count = 2;
82 };
83}
#define HARDWARE_WIDGETS_API
Definition DLLInfo.h:74
Definition BatteryWidget.h:47
Dictionary< UUID, QPointer< Battery > > m_sensors
Definition BatteryWidget.h:57
Definition Battery.h:70
Definition BatteryWidget.h:60
Dictionary< UUID, ProgressWidget * > m_values
Definition BatteryWidget.h:78
QWidget * m_battery_widget
Definition BatteryWidget.h:79
QGridLayout * m_layout
Definition BatteryWidget.h:80
Dictionary< UUID, Battery * > m_sensors
Definition BatteryWidget.h:77
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Button.h:60
Definition Dictionary.h:48
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120