mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
multi fix commit (#112)
* multi fix commit - refactoring leddevicefactory - adalight: default for "delayAfterConnect" is 1s now - needed for most arduino's because of there special behaviour on open - fadecandy: new option for disabling configuration send - if you want to keep your fadecandy defaults - Hyperion.cpp: simplify createSmoothing discussed in #105 - smoothing: -- add option for continuous output -- when updatedelay>0 and continousOutput is disabled, buffer is flushed correctly after no input is detected * add doxygen to travis
This commit is contained in:
@@ -26,14 +26,15 @@ LedDeviceFadeCandy::~LedDeviceFadeCandy()
|
||||
|
||||
bool LedDeviceFadeCandy::setConfig(const Json::Value &deviceConfig)
|
||||
{
|
||||
_host = deviceConfig.get("output", "127.0.0.1").asString();
|
||||
_port = deviceConfig.get("port", 7890).asInt();
|
||||
_channel = deviceConfig.get("channel", 0).asInt();
|
||||
_gamma = deviceConfig.get("gamma", 1.0).asDouble();
|
||||
_noDither = ! deviceConfig.get("dither", false).asBool();
|
||||
_noInterp = ! deviceConfig.get("interpolation", false).asBool();
|
||||
_manualLED = deviceConfig.get("manualLed", false).asBool();
|
||||
_ledOnOff = deviceConfig.get("ledOn", false).asBool();
|
||||
_host = deviceConfig.get("output", "127.0.0.1").asString();
|
||||
_port = deviceConfig.get("port", 7890).asInt();
|
||||
_channel = deviceConfig.get("channel", 0).asInt();
|
||||
_gamma = deviceConfig.get("gamma", 1.0).asDouble();
|
||||
_noDither = ! deviceConfig.get("dither", false).asBool();
|
||||
_noInterp = ! deviceConfig.get("interpolation", false).asBool();
|
||||
_manualLED = deviceConfig.get("manualLed", false).asBool();
|
||||
_ledOnOff = deviceConfig.get("ledOn", false).asBool();
|
||||
_setFcConfig = deviceConfig.get("setFcConfig", false).asBool();
|
||||
|
||||
_whitePoint_r = 1.0;
|
||||
_whitePoint_g = 1.0;
|
||||
@@ -62,8 +63,11 @@ bool LedDeviceFadeCandy::tryConnect()
|
||||
_client.connectToHost( _host.c_str(), _port);
|
||||
if ( _client.waitForConnected(1000) )
|
||||
{
|
||||
sendFadeCandyConfiguration();
|
||||
Info(_log,"fadecandy/opc: connected to %s:%i on channel %i", _host.c_str(), _port, _channel);
|
||||
if (_setFcConfig)
|
||||
{
|
||||
sendFadeCandyConfiguration();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +149,7 @@ int LedDeviceFadeCandy::sendSysEx(uint8_t systemId, uint8_t commandId, QByteArra
|
||||
|
||||
void LedDeviceFadeCandy::sendFadeCandyConfiguration()
|
||||
{
|
||||
Debug(_log, "send configuration to fadecandy");
|
||||
QString data = "{\"gamma\": "+QString::number(_gamma,'g',4)+", \"whitepoint\": ["+QString::number(_whitePoint_r,'g',4)+", "+QString::number(_whitePoint_g,'g',4)+", "+QString::number(_whitePoint_b,'g',4)+"]}";
|
||||
sendSysEx(1, 1, data.toLocal8Bit() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user