API Documentation
Loading...
Searching...
No Matches
LEDLightWidget.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/RGBColor.h>
4#include <QWidget>
5namespace NDEVR
6{
7 class RGBColor;
8 /**--------------------------------------------------------------------------------------------------
9 \brief Displays a simple light widget that can be set to blink or change colors.
10 *-----------------------------------------------------------------------------------------------**/
11 class NDEVR_WIDGETS_API LEDLightWidget : public QWidget
12 {
13 Q_OBJECT
14 public:
15 explicit LEDLightWidget(QWidget* parent = 0);
16 QSize sizeHint() const;
17
18 ///
19 /// \brief SetColor - Sets the LED on and off color
20 /// \param crOn QColor On color
21 /// \param crOff QColor off color
22 ///
23 void setColor(QColor crOn, QColor crOff);
26
27 ///
28 /// \brief Ping - Use Ping to momentarily enable (turn on) the LED.
29 ///
30 /// The Ping method will turn on the led for mSec milliseconds.
31 ///
32 /// \param mSec - int - number of milliseconds to enable the LED
33 ///
34 void ping(int mSec = 1000);
35
36 ///
37 /// \brief Enable - Manually enables (turn on) the LED
38 ///
39 void enable();
40 signals:
41 bool lightToggledSignal(bool is_on);
42 public slots:
43
44 ///
45 /// \brief Disable - Manually disables (turn off) the LED
46 ///
49 protected:
50 void paintEvent(QPaintEvent*);
51 protected:
52 QTimer* m_ping_timer = nullptr;
53 QTimer* m_blink_timer = nullptr;
54 RGBColor m_on_color; ///< On color
55 RGBColor m_off_color; ///< Off color
56 bool m_is_on; ///< Led state on or off, default off
57 int m_ping_cascade_count; ///< Cascase level
58
59 };
60
61}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Displays a simple light widget that can be set to blink or change colors.
Definition LEDLightWidget.h:12
void setColor(QColor crOn, QColor crOff)
SetColor - Sets the LED on and off color.
RGBColor currentColor() const
void disableSlot()
Disable - Manually disables (turn off) the LED.
RGBColor m_on_color
On color.
Definition LEDLightWidget.h:54
RGBColor m_off_color
Off color.
Definition LEDLightWidget.h:55
void enable()
Enable - Manually enables (turn on) the LED.
LEDLightWidget(QWidget *parent=0)
void setColor(RGBColor crOn, RGBColor crOff=Constant< RGBColor >::Invalid)
bool lightToggledSignal(bool is_on)
void ping(int mSec=1000)
Ping - Use Ping to momentarily enable (turn on) the LED.
QSize sizeHint() const
void paintEvent(QPaintEvent *)
bool m_is_on
Led state on or off, default off.
Definition LEDLightWidget.h:56
int m_ping_cascade_count
Cascase level.
Definition LEDLightWidget.h:57
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
Definition ACIColor.h:37
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230