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

160 lines
3.3 KiB
C++
Raw Normal View History

2020-05-15 18:47:47 +08:00
#ifndef CHECKUI_H
#define CHECKUI_H
#include <QWidget>
#include "QFile"
#include "QDebug"
2020-06-17 18:01:56 +08:00
#include "QPushButton"
#include "QJsonArray"
#include "QJsonDocument"
#include "QJsonObject"
#include "QJsonParseError"
#include "QDir"
#include <QCommonStyle>
#include "QStyle"
2020-06-18 18:13:25 +08:00
#include "mavlinknode.h"
2020-06-17 18:01:56 +08:00
#include "multiselector.h"
#include "Selector.h"
#include "Inputter.h"
#include "CharInputter.h"
2020-06-17 18:01:56 +08:00
2020-05-15 18:47:47 +08:00
namespace Ui {
class CheckUI;
}
class CheckUI : public QWidget
{
Q_OBJECT
2020-06-17 18:01:56 +08:00
2020-05-15 18:47:47 +08:00
public:
explicit CheckUI(QWidget *parent = nullptr);
~CheckUI();
2020-06-17 18:01:56 +08:00
enum CheckState{
Init = 0,
Pass,
Fail,
};
Q_ENUM(CheckState)
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);
public slots:
2020-06-18 18:13:25 +08:00
void RecieveMsg(mavlink_message_t msg);
2020-06-17 18:01:56 +08:00
void addVehicles(int sysid, int compid);
2020-06-24 17:04:15 +08:00
void commandAccepted(bool flag,uint16_t command,uint8_t result);
2020-06-17 18:01:56 +08:00
private slots:
void setVehicle(QVariant value);
2020-06-17 18:01:56 +08:00
void on_commandClicked();
void on_pushButton_Vehicle_clicked();
2020-06-24 17:04:15 +08:00
void on_pushButton_Previous_clicked();
void on_pushButton_Next_clicked();
2020-06-17 18:01:56 +08:00
protected:
QJsonObject parseCheckfiles(const QString& jsonFilename);
void LoadCheckFiles(QString path);
void reBuild(void);
void loadCommandJson(QJsonObject jsonFilename);
2020-06-17 18:01:56 +08:00
2020-05-15 18:47:47 +08:00
private:
2020-06-17 18:01:56 +08:00
2020-06-18 18:13:25 +08:00
uint8_t sysid; /* ID of message sender system/aircraft */
uint8_t compid; /* ID of the message sender component */
mavlink_autopilot_version_t autopilot_version;
mavlink_sys_status_t sys_status;
mavlink_heartbeat_t heartbeat;
mavlink_ping_t ping;
mavlink_attitude_t attitude;
mavlink_gps_raw_int_t gps_raw_int;
mavlink_global_position_int_t global_position_int;
mavlink_servo_output_raw_t servo_output_raw;
mavlink_rc_channels_raw_t rc_channels_raw;
mavlink_nav_controller_output_t nav_controller_output;
mavlink_airspeed_autocal_t airspeed_autocal;
mavlink_rpm_t rpm;
mavlink_scaled_pressure_t scaled_pressure;
mavlink_extended_sys_state_t extended_sys_state;
mavlink_battery_status_t battery_status;
mavlink_vibration_t vibration;
mavlink_enginestate_t enginestate;
mavlink_vfr_hud_t vfr_hud;
2020-06-17 18:01:56 +08:00
static const char* _versionJsonKey;
2020-06-18 18:13:25 +08:00
static const char* _spacingJsonKey;
2020-06-17 18:01:56 +08:00
static const char* _commentJsonKey;
static const char* _vehicleJsonKey;
2020-06-17 18:01:56 +08:00
static const char* _ButtonJsonKey;
static const char* _WidthJsonKey;
static const char* _HeightJsonKey;
static const char* _TextJsonKey;
static const char* _rowJsonKey;
2020-06-24 17:04:15 +08:00
static const char* _descriptionJsonKey;
2020-06-17 18:01:56 +08:00
static const char* _columnJsonKey;
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 infoArray;
2020-06-18 18:13:25 +08:00
int spacing = 10;
2020-06-17 18:01:56 +08:00
int width = 60;
int height = 60;
int version;
QHash<int,QJsonObject> CheckFiles;// vehicle,check
QHash<int,QString> Vehicles;
2020-06-17 18:01:56 +08:00
2020-05-15 18:47:47 +08:00
Ui::CheckUI *ui;
};
#endif // CHECKUI_H