76 lines
1.8 KiB
C++
Executable File
76 lines
1.8 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Display Panel Simulator widget; manages the LED-lines and servers
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Florian Schult, SLSE, 2016-03-18
|
|
*/
|
|
#pragma once
|
|
|
|
//===Include specifications==================================================
|
|
#include "customMapsAndEnum.h"
|
|
|
|
#include <QMainWindow>
|
|
#include <QVector>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
|
|
namespace Ui
|
|
{
|
|
class DisplayPanelSimulatorWidget;
|
|
}
|
|
|
|
class DisplayPanelSimulatorTcpServer;
|
|
class QLedLine;
|
|
class DebugMessages;
|
|
class QLabel;
|
|
class QImage;
|
|
class QSize;
|
|
|
|
|
|
class DisplayPanelSimulatorWidget : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
DisplayPanelSimulatorWidget(/*QWidget *parent = nullptr*/);
|
|
~DisplayPanelSimulatorWidget();
|
|
static DisplayPanelSimulatorWidget *self();
|
|
int initialize(const QString &mode_, const QVector<int> &ports, bool fullscreen, bool showPort, const QString &imagePath);
|
|
|
|
|
|
protected:
|
|
virtual void changeEvent(QEvent *event);
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
virtual void keyPressEvent(QKeyEvent *e);
|
|
|
|
|
|
public slots:
|
|
void onDebugInfosAction();
|
|
void onFullscreenAction(bool fullscreen);
|
|
|
|
private Q_SLOTS:
|
|
void writeMultiLiners(const QString &string);
|
|
void onErrorMsg(int port, const QString &string, MsgLvl lvl);
|
|
void onExitAction();
|
|
void onSaveSettingsAction();
|
|
|
|
|
|
private:
|
|
static QString findFullMode(const QString &stubMode, const ModeMap &map);
|
|
void scaleImage(QImage &image);
|
|
|
|
|
|
QVector<DisplayPanelSimulatorTcpServer *> m_servers;
|
|
Ui::DisplayPanelSimulatorWidget *m_ui;
|
|
PortMap m_ports;
|
|
QVector<QLedLine *> m_ledLines;
|
|
Mode m_mode;
|
|
QString m_message;
|
|
DebugMessages *m_debugMessages;
|
|
QLabel *m_statusLabel;
|
|
NGL::INGLLogger &m_logger;
|
|
QSize m_charSize;
|
|
};
|
|
|