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 += \ HEADERS += \
mainwindow.h \ mainwindow.h \
settings.h \
udpserver.h udpserver.h
FORMS += \ FORMS += \

View File

@ -5,17 +5,7 @@
#include <QImage> #include <QImage>
#include "udpserver.h" #include "udpserver.h"
#include "settings.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)
#define COLOR_BACKGROUND Qt::black #define COLOR_BACKGROUND Qt::black
#define COLOR_FOREGROUND QColor(255, 127, 0, 255) #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 "udpserver.h"
#include "settings.h"
#include <QUdpSocket> #include <QUdpSocket>
#include <QNetworkDatagram> #include <QNetworkDatagram>
@ -29,7 +30,7 @@ void UdpLedServer ::readPendingDatagrams()
} }
void UdpLedServer::processTheDatagram(QNetworkDatagram datagram) { void UdpLedServer::processTheDatagram(QNetworkDatagram datagram) {
if (datagram.isValid()) { if (datagram.isValid() && datagram.data().length() == PACKET_LENGTH) {
qDebug() << "Received datagram:" << datagram.data().size(); qDebug() << "Received datagram:" << datagram.data().size();
} }
} }