hyperion.ng
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
LedDevice Class Referenceabstract

Interface (pure virtual base class) for LedDevices. More...

#include <LedDevice.h>

Inheritance diagram for LedDevice:
LedDeviceAtmoOrb LedDeviceFadeCandy LedDeviceFile LedDeviceHyperionUsbasp LedDeviceLightpack LedDeviceMultiLightpack LedDevicePhilipsHue LedDevicePiBlaster LedDeviceTinkerforge LedDeviceWS281x LinearColorSmoothing ProviderHID ProviderRs232 ProviderSpi ProviderUdp

Public Slots

virtual void start ()
 Is called on thread start, all construction tasks and init should run here.
 

Signals

void enableStateChanged (bool newState)
 Emits whenever the led device switches between on/off. More...
 
void visiblePriorityChanged (const quint8 &priority)
 PIPER signal for Priority Muxer -> LedDevice. More...
 

Public Member Functions

 LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr)
 
virtual int switchOff ()
 Switch the leds off (led hardware disable)
 
virtual int switchOn ()
 Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation.
 
virtual int setLedValues (const std::vector< ColorRgb > &ledValues)
 
const QString & getColorOrder ()
 Get color order of device. More...
 
void setActiveDevice (QString dev)
 
const QString & getActiveDevice ()
 
void setLedCount (int ledCount)
 
int getLedCount ()
 
void setEnable (bool enable)
 
bool enabled ()
 
int getLatchTime ()
 
bool componentState ()
 
virtual int write (const std::vector< ColorRgb > &ledValues)=0
 Writes the RGB-Color values to the leds. More...
 

Protected Slots

int rewriteLeds ()
 Write the last data to the leds again.
 

Protected Member Functions

virtual bool init (const QJsonObject &deviceConfig)
 
virtual int open ()
 Opens and configures the output device. More...
 

Protected Attributes

QJsonObject _devConfig
 
Logger_log
 The common Logger instance for all LedDevices.
 
std::vector< uint8_t > _ledBuffer
 The buffer containing the packed RGB values.
 
bool _deviceReady
 
QString _activeDevice
 
int _ledCount
 
int _ledRGBCount
 
int _ledRGBWCount
 
QTimer _refresh_timer
 Timer object which makes sure that led data is written at a minimum rate e.g. More...
 
unsigned int _refresh_timer_interval
 
qint64 _last_write_time
 
unsigned int _latchTime_ms
 

Detailed Description

Interface (pure virtual base class) for LedDevices.

Member Function Documentation

§ enableStateChanged

void LedDevice::enableStateChanged ( bool  newState)
signal

Emits whenever the led device switches between on/off.

Parameters
newStateThe new state of the device

§ getColorOrder()

const QString& LedDevice::getColorOrder ( )
inline

Get color order of device.

Returns
The color order

§ open()

int LedDevice::open ( )
protectedvirtual

Opens and configures the output device.

Returns
Zero on succes else negative

Reimplemented in LedDeviceHyperionUsbasp, LedDeviceLightpack, LedDeviceTinkerforge, ProviderHID, ProviderRs232, LedDeviceMultiLightpack, ProviderUdp, LedDevicePiBlaster, and ProviderSpi.

§ visiblePriorityChanged

void LedDevice::visiblePriorityChanged ( const quint8 &  priority)
signal

PIPER signal for Priority Muxer -> LedDevice.

Handle priority updates from Priority Muxer

Parameters
priorityThe new visible priority

§ write()

virtual int LedDevice::write ( const std::vector< ColorRgb > &  ledValues)
pure virtual

Writes the RGB-Color values to the leds.

Parameters
[in]ledValuesThe RGB-color per led
Returns
Zero on success else negative

Implemented in LedDevicePhilipsHue, LedDeviceHyperionUsbasp, LedDeviceNanoleaf, LedDeviceFile, LinearColorSmoothing, LedDeviceUdpRaw, and LedDeviceWs2801.

Member Data Documentation

§ _refresh_timer

QTimer LedDevice::_refresh_timer
protected

Timer object which makes sure that led data is written at a minimum rate e.g.

Adalight device will switch off when it does not receive data at least every 15 seconds


The documentation for this class was generated from the following files: