Panel definitiones moved into settings

This commit is contained in:
Ollo 2023-08-15 13:38:07 +02:00
parent a5e7848e11
commit 3a71ee786e
4 changed files with 18 additions and 12 deletions

View File

@ -16,6 +16,7 @@ SOURCES += \
HEADERS += \
mainwindow.h \
settings.h \
udpserver.h
FORMS += \

View File

@ -5,17 +5,7 @@
#include <QImage>
#include "udpserver.h"
#define MAXIMUM_PANELSIZE 5
#define PANEL_WIDTH 32
#define PANEL_HEIGHT 40
#define LED_DIAMETER 8
#define LED_DISTANCE (LED_DIAMETER + 3)
#define DEFAULT_WIDTH (LED_DISTANCE * MAXIMUM_PANELSIZE * PANEL_WIDTH)
#define DEFAULT_HEIGHT (LED_DISTANCE * PANEL_HEIGHT)
#include "settings.h"
#define COLOR_BACKGROUND Qt::black
#define COLOR_FOREGROUND QColor(255, 127, 0, 255)

View File

@ -0,0 +1,14 @@
#define PACKET_LENGTH 801
#define PACKET_INDEX_BRIGHTNESS 0
#define PACKET_INDEX_PANEL0 1
#define MAXIMUM_PANELSIZE 5
#define PANEL_WIDTH 32
#define PANEL_HEIGHT 40
#define LED_DIAMETER 8
#define LED_DISTANCE (LED_DIAMETER + 3)
#define DEFAULT_WIDTH (LED_DISTANCE * MAXIMUM_PANELSIZE * PANEL_WIDTH)
#define DEFAULT_HEIGHT (LED_DISTANCE * PANEL_HEIGHT)

View File

@ -1,4 +1,5 @@
#include "udpserver.h"
#include "settings.h"
#include <QUdpSocket>
#include <QNetworkDatagram>
@ -29,7 +30,7 @@ void UdpLedServer ::readPendingDatagrams()
}
void UdpLedServer::processTheDatagram(QNetworkDatagram datagram) {
if (datagram.isValid()) {
if (datagram.isValid() && datagram.data().length() == PACKET_LENGTH) {
qDebug() << "Received datagram:" << datagram.data().size();
}
}