NDEVR
API Documentation
LEDLightWidget.h
1
#pragma once
2
#include "DLLInfo.h"
3
#include <NDEVR/RGBColor.h>
4
#include <QWidget>
5
namespace
NDEVR
6
{
7
class
RGBColor
;
12
class
NDEVR_WIDGETS_API
LEDLightWidget
:
public
QWidget
13
{
14
Q_OBJECT
15
public
:
18
explicit
LEDLightWidget
(QWidget* parent = 0);
21
QSize
sizeHint
()
const
;
25
void
setColor
(QColor crOn, QColor crOff);
29
void
setColor
(
RGBColor
crOn,
RGBColor
crOff = Constant<RGBColor>::Invalid);
32
RGBColor
currentColor
()
const
;
35
void
ping
(
int
mSec = 1000);
37
void
enable
();
38
signals:
42
bool
lightToggledSignal
(
bool
is_on);
43
public
slots:
45
void
disableSlot
();
47
void
updateBlinkSlot
();
48
protected
:
51
void
paintEvent
(QPaintEvent* paint_event);
52
protected
:
53
QTimer*
m_ping_timer
=
nullptr
;
54
QTimer*
m_blink_timer
=
nullptr
;
55
RGBColor
m_on_color
;
56
RGBColor
m_off_color
;
57
bool
m_is_on
;
58
int
m_ping_cascade_count
;
59
60
};
61
62
}
LEDLightWidget::paintEvent
void paintEvent(QPaintEvent *paint_event)
Paints the LED as a filled circle with the current color.
LEDLightWidget::LEDLightWidget
LEDLightWidget(QWidget *parent=0)
Constructs an LED light widget.
LEDLightWidget::m_ping_cascade_count
int m_ping_cascade_count
The number of overlapping ping requests currently active.
Definition
LEDLightWidget.h:58
LEDLightWidget::currentColor
RGBColor currentColor() const
Returns the current displayed color of the LED.
LEDLightWidget::lightToggledSignal
bool lightToggledSignal(bool is_on)
Emitted when the LED state changes.
LEDLightWidget::m_on_color
RGBColor m_on_color
The color displayed when the LED is on.
Definition
LEDLightWidget.h:55
LEDLightWidget::setColor
void setColor(RGBColor crOn, RGBColor crOff=Constant< RGBColor >::Invalid)
Sets the LED on and off colors using RGBColor values.
LEDLightWidget::setColor
void setColor(QColor crOn, QColor crOff)
Sets the LED on and off colors using QColor values.
LEDLightWidget::m_off_color
RGBColor m_off_color
The color displayed when the LED is off.
Definition
LEDLightWidget.h:56
LEDLightWidget::enable
void enable()
Manually turns on the LED.
LEDLightWidget::m_ping_timer
QTimer * m_ping_timer
Timer used for temporary ping illumination.
Definition
LEDLightWidget.h:53
LEDLightWidget::disableSlot
void disableSlot()
Manually turns off the LED.
LEDLightWidget::updateBlinkSlot
void updateBlinkSlot()
Slot that toggles the LED state for blink animation.
LEDLightWidget::m_is_on
bool m_is_on
Whether the LED is currently on.
Definition
LEDLightWidget.h:57
LEDLightWidget::m_blink_timer
QTimer * m_blink_timer
Timer used for continuous blink animation.
Definition
LEDLightWidget.h:54
LEDLightWidget::sizeHint
QSize sizeHint() const
Returns the preferred size hint for the LED widget.
LEDLightWidget::ping
void ping(int mSec=1000)
Momentarily turns on the LED for a specified duration.
RGBColor
Represents a color in the RGB space with optional alpha transparency.
Definition
RGBColor.h:57
NDEVR
The primary namespace for the NDEVR SDK.
Definition
ArialTileFetcherModule.h:35
Widgets
Headers
LEDLightWidget.h
NDEVR.org