Remove max LED number constraint from Matrix layout (#1805)

This commit is contained in:
LordGrey
2024-12-09 06:21:53 +01:00
committed by GitHub
parent e8e102c25d
commit 179ee316d0
28 changed files with 231 additions and 76 deletions

View File

@@ -5,6 +5,7 @@
#include "QtHttpClientWrapper.h"
#include <api/JsonAPI.h>
#include <api/JsonCallbacks.h>
WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localConnection, QtHttpClientWrapper* parent)
: QObject(parent)
@@ -14,8 +15,10 @@ WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localC
{
const QString client = request->getClientInfo().clientAddress.toString();
_jsonAPI = new JsonAPI(client, _log, localConnection, this, true);
connect(_jsonAPI, &JsonAPI::callbackMessage, this, &WebJsonRpc::handleCallback);
connect(_jsonAPI, &JsonAPI::callbackReady, this, &WebJsonRpc::sendCallbackMessage);
connect(_jsonAPI, &JsonAPI::forceClose, [&]() { _wrapper->closeConnection(); _stopHandle = true; });
connect(_jsonAPI->getCallBack().get(), &JsonCallbacks::callbackReady, this, &WebJsonRpc::sendCallbackMessage);
_jsonAPI->initialize();
}
@@ -31,7 +34,7 @@ void WebJsonRpc::handleMessage(QtHttpRequest* request)
}
}
void WebJsonRpc::handleCallback(QJsonObject obj)
void WebJsonRpc::sendCallbackMessage(QJsonObject obj)
{
// guard against wrong callbacks; TODO: Remove when JSONAPI is more solid
if(!_unlocked) return;

View File

@@ -26,5 +26,5 @@ private:
bool _unlocked = false;
private slots:
void handleCallback(QJsonObject obj);
void sendCallbackMessage(QJsonObject obj);
};

View File

@@ -4,6 +4,7 @@
#include <hyperion/Hyperion.h>
#include <api/JsonAPI.h>
#include <api/JsonCallbacks.h>
#include <QTcpSocket>
#include <QtEndian>
@@ -24,9 +25,11 @@ WebSocketClient::WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, bool
// Json processor
_jsonAPI.reset(new JsonAPI(client, _log, localConnection, this));
connect(_jsonAPI.get(), &JsonAPI::callbackMessage, this, &WebSocketClient::sendMessage);
connect(_jsonAPI.get(), &JsonAPI::callbackReady, this, &WebSocketClient::sendMessage);
connect(_jsonAPI.get(), &JsonAPI::forceClose, this,[this]() { this->sendClose(CLOSECODE::NORMAL); });
connect(_jsonAPI->getCallBack().get(), &JsonCallbacks::callbackReady, this, &WebSocketClient::sendMessage);
connect(this, &WebSocketClient::handleMessage, _jsonAPI.get(), &JsonAPI::handleMessage);
Debug(_log, "New connection from %s", QSTRING_CSTR(client));