The WebUI remote page has been rearranged

Set interuption flag to running effects when hyperion emits finished signal
Protobuffer, Flatbuffer and Boblight connection priority check to avoid unwanted program behavior

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
Paulchen-Panther
2019-08-02 21:12:13 +02:00
parent 2e8014bdbb
commit cacfbada7a
8 changed files with 66 additions and 33 deletions

View File

@@ -6,9 +6,6 @@
#include <QTimer>
#include <QRgb>
#include <hyperion/Hyperion.h>
#include <hyperion/HyperionIManager.h>
FlatBufferClient::FlatBufferClient(QTcpSocket* socket, const int &timeout, QObject *parent)
: QObject(parent)
, _log(Logger::getInstance("FLATBUFSERVER"))
@@ -72,7 +69,9 @@ void FlatBufferClient::disconnected()
{
Debug(_log, "Socket Closed");
_socket->deleteLater();
emit clearGlobalInput(_priority);
if (_priority != 0 && _priority >= 100 && _priority < 200)
emit clearGlobalInput(_priority);
emit clientDisconnected();
}
@@ -122,6 +121,13 @@ void FlatBufferClient::registationRequired(const int priority)
void FlatBufferClient::handleRegisterCommand(const hyperionnet::Register *regReq)
{
if (regReq->priority() < 100 || regReq->priority() >= 200)
{
// Warning(_log, "Register request from client %s contains invalid priority %d. Valid rage is between 100 and 199.", QSTRING_CSTR(_clientAddress), regReq->priority());
sendErrorReply("The priority " + std::to_string(regReq->priority()) + " is not in the priority range between 100 and 199.");
return;
}
_priority = regReq->priority();
emit registerGlobalInput(_priority, hyperion::COMP_FLATBUFSERVER, regReq->origin()->c_str()+_clientAddress);

View File

@@ -12,10 +12,9 @@
class QTcpSocket;
class QTimer;
class Hyperion;
namespace flatbuf {
class HyperionRequest;
class HyperionRequest;
}
///

View File

@@ -217,5 +217,8 @@ bool FlatBufferConnection::parseReply(const hyperionnet::Reply *reply)
return true;
}
else
throw std::runtime_error(reply->error()->str());
return false;
}