#ifndef COMMANDUI_H #define COMMANDUI_H #include #include "QFile" #include "QDebug" #include "QPushButton" #include "QJsonArray" #include "QJsonDocument" #include "QJsonObject" #include "QJsonParseError" #include "QDir" #include #include "QStyle" #include "multiselector.h" #include "Selector.h" #include "Inputter.h" #include "CharInputter.h" #include "Confirm.h" namespace Ui { class CommandUI; } class CommandUI : public QWidget { Q_OBJECT public: enum state{ success = 0, failure, twinkle, }; explicit CommandUI(QWidget *parent = nullptr); ~CommandUI(); 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); 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(); void setSecondConfirm(QVariant value); protected: void loadCommandJson(const QString& jsonFilename); private: static const char* _versionJsonKey; static const char* _commentJsonKey; static const char* _CommandButtonJsonKey; static const char* _WidthJsonKey; static const char* _HeightJsonKey; static const char* _TextJsonKey; static const char* _rowJsonKey; static const char* _columnJsonKey; 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; static const char* _commandJsonKey; static const char* _confirmJsonKey; QJsonArray CMD_infoArray; int CMDwidth = 60; int CMDheight = 60; int CMD_version; Ui::CommandUI *ui; QString name; float param1; float param2; float param3; float param4; float param5; float param6; float param7; uint16_t command; uint8_t confirm; }; #endif // COMMANDUI_H