134 lines
3.2 KiB
C++
134 lines
3.2 KiB
C++
#ifndef COMMANDBOX_H
|
|
#define COMMANDBOX_H
|
|
|
|
#include <QWidget>
|
|
#include "QDebug"
|
|
#include "QAction"
|
|
#include "QContextMenuEvent"
|
|
#include "QMenu"
|
|
#include "QMessageBox"
|
|
|
|
#include "multiselector.h"
|
|
#include "Selector.h"
|
|
#include "Inputter.h"
|
|
#include "CharInputter.h"
|
|
#include "Confirm.h"
|
|
#include "CommandEditor.h"
|
|
#include "QtTextToSpeech/QtTextToSpeech"
|
|
#include "mavlink.h"
|
|
|
|
|
|
namespace Ui {
|
|
class CommandBox;
|
|
}
|
|
|
|
class CommandBox : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CommandBox(QWidget *parent = nullptr);
|
|
~CommandBox();
|
|
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent *event);
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
public slots:
|
|
void setFloat(void);
|
|
void setFloatFlag(bool flag);
|
|
|
|
void commandAccepted(bool flag,uint16_t command,uint8_t result);
|
|
|
|
void on_comboBox_TestPoint_currentIndexChanged(int index);
|
|
void on_pushButton_SendTest_clicked();
|
|
|
|
void setSecondConfirm(QVariant value);
|
|
void on_commandClicked(QString name,
|
|
float param1, float param2, float param3, float param4,
|
|
float param5, float param6, float param7,
|
|
uint16_t command, uint8_t confirmation);
|
|
void on_paramClicked(uint8_t sysid, uint8_t compid , QString id, uint8_t type, float value);
|
|
|
|
void addVehicles(int sysid, int compid);
|
|
|
|
signals:
|
|
void showMessage(const QString &message,int TimeOut = 0);
|
|
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);
|
|
|
|
void WriteCmd(uint8_t m_sysid, uint8_t m_compid , const char *id, uint8_t type, float value);
|
|
|
|
private slots:
|
|
void on_pushButton_Servo_Check_clicked();
|
|
|
|
void on_pushButton_Servo_Read_clicked();
|
|
|
|
void on_pushButton_Servo_Zero_clicked();
|
|
|
|
void on_pushButton_Servo_Work_clicked();
|
|
|
|
void on_pushButton_AirHeatOn_clicked();
|
|
|
|
void on_pushButton_AirHeatOff_clicked();
|
|
|
|
void on_pushButton_coldrun_clicked();
|
|
|
|
void on_pushButton_groundstartup_clicked();
|
|
|
|
void on_pushButton_Afterburner_off_clicked();
|
|
|
|
void on_pushButton_stop_clicked();
|
|
|
|
void on_pushButton_EmergencyStop_clicked();
|
|
|
|
void on_pushButton_Afterburner_on_clicked();
|
|
|
|
void on_pushButton_Afterburner_half_clicked();
|
|
|
|
void on_pushButton_setRPM_clicked();
|
|
|
|
void on_pushButton_SendCommand_clicked();
|
|
|
|
void on_pushButton_Cancel_clicked();
|
|
|
|
void on_pushButton_IMU_clicked();
|
|
|
|
void on_pushButton_ServoSet_clicked();
|
|
|
|
private:
|
|
|
|
QWidget *m_parent;
|
|
|
|
bool floatflag = true;
|
|
|
|
Ui::CommandBox *ui;
|
|
|
|
|
|
QString m_name = 0;
|
|
float m_param1 = 0;
|
|
float m_param2 = 0;
|
|
float m_param3 = 0;
|
|
float m_param4 = 0;
|
|
float m_param5 = 0;
|
|
float m_param6 = 0;
|
|
float m_param7 = 0;
|
|
uint16_t m_command = 10;
|
|
uint8_t m_confirm = 10;
|
|
|
|
|
|
uint8_t m_sysid;
|
|
uint8_t m_compid;
|
|
QString m_id;
|
|
uint8_t m_type;
|
|
float m_value;
|
|
|
|
|
|
uint32_t cmdType = 0;//0 cmd 1 param
|
|
|
|
|
|
};
|
|
|
|
#endif // COMMANDBOX_H
|