NDEVR
API Documentation
TemperatureWidget.h
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/Button.h>
35#include <NDEVR/Dictionary.h>
36#include <NDEVR/UUID.h>
37class QLabel;
38class QGridLayout;
39namespace NDEVR
40{
41 class ProgressWidget;
43 class QCustomLabel;
48 class HARDWARE_WIDGETS_API TemperatureWidget : public Button
49 {
50 Q_OBJECT
51 public:
56 explicit TemperatureWidget(QWidget* parent = nullptr);
72 void addSensor(TemperatureSensor* sensor, bool update = true);
78 void removeSensor(TemperatureSensor* sensor, bool update = true);
83 void clearSensors(bool update = true);
88 void setColumnCount(uint04 column_count);
94 protected slots:
95 void updatedSlot();
96 protected:
107 protected:
110 QWidget* m_widget;
111 QGridLayout* m_layout;
113
114 };
115}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Button(QWidget *parent=nullptr)
Constructs a Button with an optional parent widget.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
Displays the progress, either horizontally as a bar or as a round spin dial.
Displays translated text.
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
A Device responsible for determining the temperature of either the environment or a specific componen...
void setColumnCount(uint04 column_count)
Sets the number of columns used to lay out temperature displays.
void clearSensors(bool update=true)
Removes all temperature sensors from the widget.
RGBColor getColor(uint04 state)
Returns the display color corresponding to a temperature state.
void setSensors(Buffer< TemperatureSensor * > sensors)
Sets multiple temperature sensors, replacing any existing sensors.
Dictionary< UUID, TemperatureSensor * > m_sensors
Map of sensor UUIDs to TemperatureSensor pointers.
Dictionary< UUID, ProgressWidget * > m_values
Map of sensor UUIDs to their ProgressWidget displays.
TemperatureWidget(QWidget *parent=nullptr)
Constructs a TemperatureWidget.
void setSensor(TemperatureSensor *sensor)
Sets a single temperature sensor, replacing any existing sensors.
void removeSensor(TemperatureSensor *sensor, bool update=true)
Removes a temperature sensor from the widget.
QGridLayout * m_layout
Grid layout arranging temperature sensor displays.
void updatedSlot()
Slot called when a temperature sensor value is updated.
void updateLayout()
Rebuilds the grid layout to reflect the current set of sensors.
void addSensor(TemperatureSensor *sensor, bool update=true)
Adds a temperature sensor to the widget.
const Dictionary< UUID, TemperatureSensor * > & sensors() const
Returns the dictionary of registered temperature sensors.
QWidget * m_widget
Container widget for the temperature display layout.
uint04 m_column_count
Number of columns in the temperature display grid.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...