2020-10-26 21:42:04 +08:00
|
|
|
#ifndef DIAGRAM_H
|
|
|
|
|
#define DIAGRAM_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include "QMouseEvent"
|
|
|
|
|
#include "QDebug"
|
|
|
|
|
#include "QAction"
|
|
|
|
|
#include "QContextMenuEvent"
|
|
|
|
|
#include "QMenu"
|
|
|
|
|
#include "QColor"
|
|
|
|
|
#include "QLabel"
|
|
|
|
|
#include "mavlink.h"
|
|
|
|
|
#include "QStyle"
|
|
|
|
|
#include "QDebug"
|
|
|
|
|
#include "QScreen"
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
|
|
#include "Chart.h"
|
2020-12-07 16:29:08 +08:00
|
|
|
#include "QCheckBox"
|
2020-10-26 21:42:04 +08:00
|
|
|
|
|
|
|
|
#include "QChart"
|
|
|
|
|
#include <QChartView>
|
|
|
|
|
#include <QLineSeries>
|
|
|
|
|
#include <QValueAxis>
|
|
|
|
|
#include <QDateTimeAxis>
|
|
|
|
|
|
2020-11-19 11:39:28 +08:00
|
|
|
|
|
|
|
|
#include "QDateTime"
|
|
|
|
|
|
2020-10-26 21:42:04 +08:00
|
|
|
namespace Ui {
|
|
|
|
|
class Diagram;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Diagram : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2020-11-19 11:39:28 +08:00
|
|
|
|
|
|
|
|
enum state{
|
|
|
|
|
success = 0,
|
|
|
|
|
failure = 1,
|
|
|
|
|
warning = 2,
|
|
|
|
|
inital = 3,
|
|
|
|
|
};
|
|
|
|
|
|
2020-10-26 21:42:04 +08:00
|
|
|
explicit Diagram(QWidget *parent = nullptr);
|
|
|
|
|
~Diagram();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Chart *attChart = nullptr;
|
|
|
|
|
Chart *gyroChart = nullptr;
|
|
|
|
|
Chart *accChart = nullptr;
|
|
|
|
|
Chart *asChart = nullptr;
|
|
|
|
|
Chart *vzChart = nullptr;
|
|
|
|
|
Chart *altChart = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void setFloat(void);
|
2020-10-27 15:04:51 +08:00
|
|
|
|
2020-11-17 22:55:22 +08:00
|
|
|
void setAttitude(uint8_t source,
|
|
|
|
|
float ax,float ay,float az,
|
|
|
|
|
float p,float q,float r,
|
|
|
|
|
float rol,float pit,float yaw);
|
2020-10-27 15:04:51 +08:00
|
|
|
|
2020-11-17 22:55:22 +08:00
|
|
|
void setBaseState(uint32_t pos,QVariant real,QVariant meas);
|
2020-10-27 15:04:51 +08:00
|
|
|
void setServo(uint32_t pos,QVariant real,QVariant meas);
|
|
|
|
|
void setEngine(uint32_t pos,QVariant value);
|
|
|
|
|
void setBattery(uint32_t pos,QVariant value);
|
|
|
|
|
void setDlink(uint32_t pos,QVariant value);
|
2020-11-17 22:55:22 +08:00
|
|
|
void setNavigation(uint32_t pos,QVariant value);
|
|
|
|
|
void setControlState(uint32_t pos,QVariant value);
|
2020-11-19 11:39:28 +08:00
|
|
|
void setTime(uint32_t pos, QTime Value);
|
|
|
|
|
|
|
|
|
|
void setTargetPoint(int Value);
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setColor(QWidget *w,state s);
|
|
|
|
|
void setValue(QLabel *w,QString s);
|
2020-10-26 21:42:04 +08:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
|
|
2020-10-28 13:48:15 +08:00
|
|
|
private slots:
|
|
|
|
|
|
2020-12-07 16:29:08 +08:00
|
|
|
void on_checkBox_att_stateChanged(int arg1);
|
|
|
|
|
void on_checkBox_gyro_stateChanged(int arg1);
|
|
|
|
|
void on_checkBox_acc_stateChanged(int arg1);
|
2020-11-21 18:19:28 +08:00
|
|
|
|
2020-10-26 21:42:04 +08:00
|
|
|
private:
|
|
|
|
|
Ui::Diagram *ui;
|
|
|
|
|
QWidget *m_parent;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // DIAGRAM_H
|