Files
gcs-nf/App/CommandUI/CommandUI.h
T

122 lines
2.1 KiB
C++
Raw Normal View History

2020-04-30 14:33:57 +08:00
#ifndef COMMANDUI_H
#define COMMANDUI_H
#include <QWidget>
2020-05-12 18:05:47 +08:00
#include "QFile"
#include "QDebug"
2020-04-30 14:33:57 +08:00
#include "QPushButton"
#include "QJsonArray"
#include "QJsonDocument"
#include "QJsonObject"
#include "QJsonParseError"
2020-06-09 18:11:28 +08:00
#include "QDir"
2020-06-20 16:51:11 +08:00
#include <QCommonStyle>
#include "QStyle"
2020-07-09 18:00:23 +08:00
#include "multiselector.h"
#include "Selector.h"
#include "Inputter.h"
#include "CharInputter.h"
#include "Confirm.h"
2020-06-20 16:51:11 +08:00
2020-04-30 14:33:57 +08:00
namespace Ui {
class CommandUI;
}
class CommandUI : public QWidget
{
Q_OBJECT
public:
2020-06-20 16:51:11 +08:00
enum state{
success = 0,
failure,
twinkle,
};
2020-04-30 14:33:57 +08:00
explicit CommandUI(QWidget *parent = nullptr);
~CommandUI();
2020-06-24 17:04:15 +08:00
public slots:
void commandAccepted(bool flag,uint16_t command,uint8_t result);
signals:
void cmd_int(float param1, float param2, float param3, float param4, int x, int y, float z);
2020-06-03 18:09:41 +08:00
void cmd_long( float param1,float param2,float param3,float param4,float param5,float param6,float param7,uint16_t command,uint8_t confirmation);
private slots:
void on_commandClicked();
2020-07-20 18:06:14 +08:00
void setSecondConfirm(QVariant value);
protected:
void loadCommandJson(const QString& jsonFilename);
2020-04-30 14:33:57 +08:00
private:
static const char* _versionJsonKey;
static const char* _commentJsonKey;
static const char* _CommandButtonJsonKey;
2020-06-03 18:09:41 +08:00
static const char* _WidthJsonKey;
static const char* _HeightJsonKey;
static const char* _TextJsonKey;
static const char* _rowJsonKey;
static const char* _columnJsonKey;
2020-06-03 18:09:41 +08:00
2020-07-20 18:06:14 +08:00
static const char* _noticeJsonKey;
static const char* _param1JsonKey;
static const char* _param2JsonKey;
static const char* _param3JsonKey;
static const char* _param4JsonKey;
static const char* _param5JsonKey;
static const char* _param6JsonKey;
static const char* _param7JsonKey;
2020-06-03 18:09:41 +08:00
static const char* _commandJsonKey;
static const char* _confirmJsonKey;
QJsonArray CMD_infoArray;
2020-06-03 18:09:41 +08:00
int CMDwidth = 60;
int CMDheight = 60;
2020-06-03 18:09:41 +08:00
int CMD_version;
2020-04-30 14:33:57 +08:00
Ui::CommandUI *ui;
2020-07-20 18:06:14 +08:00
QString name;
float param1;
float param2;
float param3;
float param4;
float param5;
float param6;
float param7;
uint16_t command;
uint8_t confirm;
2020-04-30 14:33:57 +08:00
};
#endif // COMMANDUI_H