Added lights panel tab to send LED commands. However we can not get in-game lighting as its on the socket not websocket. More reason for the bridge
This commit is contained in:
43
LightsPanel.h
Normal file
43
LightsPanel.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
#include <QColor>
|
||||
#include <QMap>
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
class LightsPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LightsPanel(QWidget *parent = nullptr);
|
||||
|
||||
void setRnpCount(int count);
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
void commandRequested(const QString &cmd);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
int segmentAt(const QPointF &pos) const;
|
||||
void sendLedCommand(int panel, const QColor &color);
|
||||
void pickColor();
|
||||
void updateSendBtn();
|
||||
|
||||
int m_count = 0;
|
||||
int m_selected = -1;
|
||||
QColor m_ledColor = QColor(255, 0, 0);
|
||||
|
||||
QMap<int, QColor> m_panelColors;
|
||||
|
||||
QLabel *m_statusLabel = nullptr;
|
||||
QLabel *m_selectedLabel = nullptr;
|
||||
QPushButton *m_colorBtn = nullptr;
|
||||
QPushButton *m_sendBtn = nullptr;
|
||||
QPushButton *m_sendAllBtn = nullptr;
|
||||
QPushButton *m_clearAllBtn = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user