218 lines
4.8 KiB
C++
218 lines
4.8 KiB
C++
#ifndef SERVOSYSTEM_H
|
|
#define SERVOSYSTEM_H
|
|
|
|
#include <QWidget>
|
|
#include "QMouseEvent"
|
|
#include "QDebug"
|
|
#include "QAction"
|
|
#include "QContextMenuEvent"
|
|
#include "QMenu"
|
|
#include "QColor"
|
|
#include "QLabel"
|
|
#include "mavlink.h"
|
|
#include "QStyle"
|
|
|
|
|
|
#include "Config/Config.h"
|
|
|
|
#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 ServoSystem;
|
|
}
|
|
|
|
class ServoSystem : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum state{
|
|
success = 0,
|
|
failure,
|
|
};
|
|
|
|
explicit ServoSystem(QWidget *parent = nullptr);
|
|
~ServoSystem();
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
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_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();
|
|
|
|
void on_pushButton_Zero_clicked();
|
|
|
|
void on_pushButton_setFuel_clicked();
|
|
|
|
//void on_pushButton_AngleZero_clicked();
|
|
|
|
void on_pushButton_HeatOn1_clicked();
|
|
|
|
void on_pushButton_HeatOn2_clicked();
|
|
|
|
|
|
void on_pushButton_ServoTest_clicked();
|
|
|
|
void on_pushButton_StabilizeTest_clicked();
|
|
|
|
void on_pushButton_ManualTest_clicked();
|
|
|
|
void on_pushButton_swep_clicked();
|
|
|
|
void on_pushButton_test_cmd_clicked();
|
|
|
|
void on_pushButton_test_stop_clicked();
|
|
|
|
void on_pushButton_IAS_SEL_0_clicked();
|
|
|
|
void on_pushButton_IAS_SEL_1_clicked();
|
|
|
|
void on_pushButton_IAS_SEL_2_clicked();
|
|
|
|
void on_pushButton_HeatOff_clicked();
|
|
|
|
//void on_pushButton_ZeroComplete_clicked();
|
|
|
|
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);
|
|
|
|
|
|
public slots:
|
|
void setFloat(void);
|
|
void setColor(QWidget *w,state s);
|
|
void setValue(QLabel *w,QString s);
|
|
|
|
void setCheckState(uint32_t pos,QVariant value);
|
|
void setBUMState(mavlink_bmustate_t *t);
|
|
void setServoState(mavlink_servo_output_raw_t *t);
|
|
|
|
|
|
|
|
float param_getvalue(QVariant param,uint8_t type);
|
|
|
|
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);
|
|
|
|
|
|
private:
|
|
QWidget *m_parent;
|
|
|
|
Ui::ServoSystem *ui;
|
|
|
|
|
|
QVariant dir_la;
|
|
QVariant dir_ra;
|
|
QVariant dir_le;
|
|
QVariant dir_re;
|
|
QVariant dir_ru;
|
|
|
|
QVariant max_la;
|
|
QVariant max_ra;
|
|
QVariant max_le;
|
|
QVariant max_re;
|
|
QVariant max_ru;
|
|
|
|
QVariant scale_la;
|
|
QVariant scale_ra;
|
|
QVariant scale_le;
|
|
QVariant scale_re;
|
|
QVariant scale_ru;
|
|
|
|
QVariant bias_la;
|
|
QVariant bias_ra;
|
|
QVariant bias_le;
|
|
QVariant bias_re;
|
|
QVariant bias_ru;
|
|
|
|
|
|
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 = 0;
|
|
uint8_t m_confirm = 0;
|
|
|
|
|
|
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
|
|
|
|
float m_ra = 0;
|
|
float m_la = 0;
|
|
float m_ru = 0;
|
|
float m_re = 0;
|
|
float m_le = 0;
|
|
|
|
};
|
|
|
|
#endif // SERVOSYSTEM_H
|