implement origin for effects (#408)

* implement rigin for efx

* implement origin for effects and other components
add experimental adalight firmware for arduino with upto 5 pwm channels

* cleanup

* origin ip now with dns lookup

* fix compile

* move some code
This commit is contained in:
redPanther
2017-03-01 15:23:53 +01:00
committed by GitHub
parent 31f352e7ce
commit 221af075a4
24 changed files with 376 additions and 98 deletions

View File

@@ -11,6 +11,7 @@
#include <QRgb>
#include <QResource>
#include <QDateTime>
#include <QHostInfo>
// hyperion util includes
#include "hyperion/ImageProcessorFactory.h"
@@ -27,13 +28,13 @@ ProtoClientConnection::ProtoClientConnection(QTcpSocket *socket)
, _hyperion(Hyperion::getInstance())
, _receiveBuffer()
, _priority(-1)
, _priorityChannelName("Proto-Server")
, _clientAddress(QHostInfo::fromName(socket->peerAddress().toString()).hostName())
{
// connect internal signals and slots
connect(_socket, SIGNAL(disconnected()), this, SLOT(socketClosed()));
connect(_socket, SIGNAL(readyRead()), this, SLOT(readData()));
connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _imageProcessor, SLOT(setLedMappingType(int)));
_priorityChannelName = "proto@"+ _socket->peerAddress().toString().toStdString();
}
ProtoClientConnection::~ProtoClientConnection()
@@ -198,7 +199,7 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag
// process the image
std::vector<ColorRgb> ledColors = _imageProcessor->process(image);
_hyperion->setColors(_priority, ledColors, duration);
_hyperion->setColors(_priority, ledColors, duration, true, hyperion::COMP_PROTOSERVER , "proto@"+_clientAddress);
_hyperion->setImage(_priority, image, duration);
// send reply

View File

@@ -7,6 +7,7 @@
#include <QByteArray>
#include <QTcpSocket>
#include <QStringList>
#include <QString>
// Hyperion includes
#include <hyperion/Hyperion.h>
@@ -140,5 +141,8 @@ private:
int _priority;
std::string _priorityChannelName;
QString _priorityChannelName;
/// address of client
QString _clientAddress;
};