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