Panel definitiones moved into settings
This commit is contained in:
parent
a5e7848e11
commit
3a71ee786e
@ -16,6 +16,7 @@ SOURCES += \
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
settings.h \
|
||||
udpserver.h
|
||||
|
||||
FORMS += \
|
||||
|
@ -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)
|
||||
|
14
simulation/VirtualLedBoard/settings.h
Normal file
14
simulation/VirtualLedBoard/settings.h
Normal 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)
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user