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

60 lines
951 B
C++
Raw Normal View History

2020-10-22 21:52:01 +08:00
#ifndef HEALTHUI_H
2020-10-10 20:22:04 +08:00
#define HEALTHUI_H
#include <QWidget>
#include "QFile"
#include "QDir"
#include "QStyle"
#include "QTextStream"
#include "QLabel"
2020-10-22 21:52:01 +08:00
#include "QDebug"
2020-10-10 20:22:04 +08:00
#include "mavlink.h"
2020-10-22 21:52:01 +08:00
#include "QLabel"
2020-12-23 17:38:45 +08:00
#include "StateLabel.h"
2020-10-10 20:22:04 +08:00
namespace Ui {
class HealthUI;
}
class HealthUI : public QWidget
{
Q_OBJECT
public:
enum state{
success = 0,
failure = 1,
warning = 2,
2020-10-16 17:06:18 +08:00
inital = 3,
2020-10-10 20:22:04 +08:00
};
explicit HealthUI(QWidget *parent = nullptr);
~HealthUI();
2020-10-11 19:10:57 +08:00
2020-10-16 17:06:18 +08:00
void setState(uint32_t pos, state sta);
2020-12-30 10:41:05 +08:00
void setValue(uint32_t pos,QVariant sta);
2020-10-11 19:10:57 +08:00
2020-12-30 10:41:05 +08:00
QLabel* findLabel(int key);
void AllLabel(void);
2020-12-23 17:38:45 +08:00
void StateInstall(QString name,state s,QVariant value);
2020-10-10 20:22:04 +08:00
private slots:
void setColor(QWidget *w,state s);
2020-12-30 10:41:05 +08:00
void setString(QLabel *w,QString s);
2020-10-10 20:22:04 +08:00
private:
Ui::HealthUI *ui;
2020-12-30 10:41:05 +08:00
QHash<int,QLabel*> LabelMap;
2020-10-10 20:22:04 +08:00
};
#endif // HEALTHUI_H