Implementation of the LedDevice interface for sending to fadecandy/opc-server via network by using the 'open pixel control' protocol.
More...
#include <LedDeviceFadeCandy.h>
|
| LedDeviceFadeCandy (const QJsonObject &deviceConfig) |
| Constructs the LedDevice for fadecandy/opc server. More...
|
|
virtual | ~LedDeviceFadeCandy () |
| Destructor of the LedDevice; closes the tcp client.
|
|
bool | init (const QJsonObject &deviceConfig) |
| Sets configuration. More...
|
|
| 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 () |
|
|
QTcpSocket * | _client |
|
QString | _host |
|
uint16_t | _port |
|
unsigned | _channel |
|
QByteArray | _opc_data |
|
bool | _setFcConfig |
|
double | _gamma |
|
double | _whitePoint_r |
|
double | _whitePoint_g |
|
double | _whitePoint_b |
|
bool | _noDither |
|
bool | _noInterp |
|
bool | _manualLED |
|
bool | _ledOnOff |
|
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 |
|
Implementation of the LedDevice interface for sending to fadecandy/opc-server via network by using the 'open pixel control' protocol.
§ LedDeviceFadeCandy()
LedDeviceFadeCandy::LedDeviceFadeCandy |
( |
const QJsonObject & |
deviceConfig | ) |
|
Constructs the LedDevice for fadecandy/opc server.
following code shows all config options
"device" :
{
"name" : "MyPi",
"type" : "fadecandy",
"output" : "localhost",
"colorOrder" : "rgb",
"setFcConfig" : false,
"gamma" : 1.0,
"whitepoint" : [1.0, 1.0, 1.0],
"dither" : false,
"interpolation" : false,
"manualLed" : false,
"ledOn" : false
},
- Parameters
-
deviceConfig | json config for fadecandy |
§ init()
bool LedDeviceFadeCandy::init |
( |
const QJsonObject & |
deviceConfig | ) |
|
|
virtual |
Sets configuration.
- Parameters
-
deviceConfig | the json device config |
- Returns
- true if success
Reimplemented from LedDevice.
§ isConnected()
bool LedDeviceFadeCandy::isConnected |
( |
| ) |
|
|
protected |
return the conenction state
- Returns
- True if connection established
§ sendSysEx()
int LedDeviceFadeCandy::sendSysEx |
( |
uint8_t |
systemId, |
|
|
uint8_t |
commandId, |
|
|
QByteArray |
msg |
|
) |
| |
|
protected |
send system exclusive commands
- Parameters
-
systemId | fadecandy device identifier (for standard fadecandy always: 1) |
commandId | id of command |
msg | the sysEx message |
- Returns
- amount bytes written, -1 if fail
§ transferData()
int LedDeviceFadeCandy::transferData |
( |
| ) |
|
|
protected |
transfer current opc_data buffer to opc server
- Returns
- amount of transfered bytes. -1 error while transfering, -2 error while connecting
§ tryConnect()
bool LedDeviceFadeCandy::tryConnect |
( |
| ) |
|
|
protected |
try to establish connection to opc server, if not connected yet
- Returns
- true if connection is established
The documentation for this class was generated from the following files: