完成主要交互、高性能组件、国际化和A型传感器数据包接收
This commit is contained in:
@@ -4,51 +4,50 @@
|
||||
|
||||
#ifndef TACTILEIPC3D_BACKEND_H
|
||||
#define TACTILEIPC3D_BACKEND_H
|
||||
#include <qobject.h>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
#include "data_backend.h"
|
||||
#include "serial/serial_backend.h"
|
||||
|
||||
class Backend : public QObject {
|
||||
class AppBackend : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int minValue READ minValue WRITE setMinValue NOTIFY minValueChanged)
|
||||
Q_PROPERTY(int maxValue READ maxValue WRITE setMaxValue NOTIFY maxValueChanged)
|
||||
Q_PROPERTY(QString renderMode READ renderMode WRITE setRenderMode NOTIFY renderModeChanged)
|
||||
Q_PROPERTY(bool showLegend READ showLegend WRITE setShowLegend NOTIFY showLegendChanged)
|
||||
Q_PROPERTY(QString labelMode READ labelMode WRITE setLabelMode NOTIFY labelModeChanged)
|
||||
Q_PROPERTY(bool lightMode READ lightMode WRITE setLightMode NOTIFY lightModeChanged)
|
||||
Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged)
|
||||
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
|
||||
Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid NOTIFY showGridChanged);
|
||||
Q_PROPERTY(SerialBackend* serial READ serial CONSTANT)
|
||||
Q_PROPERTY(DataBackend* data READ data CONSTANT)
|
||||
|
||||
public:
|
||||
explicit Backend(QObject* parent = nullptr);
|
||||
explicit AppBackend(QObject* parent=nullptr);
|
||||
|
||||
int minValue() const { return m_min; }
|
||||
int maxValue() const { return m_max; }
|
||||
QString renderMode() const { return m_renderMode; }
|
||||
bool showLegend() const { return m_showLegend; }
|
||||
QString labelMode() const { return m_labelMode; }
|
||||
bool lightMode() const { return m_lightMode; }
|
||||
QString language() const { return m_language; }
|
||||
bool connected() const;
|
||||
|
||||
public slots:
|
||||
void setMinValue(int v);
|
||||
void setMaxValue(int v);
|
||||
void setRenderMode(const QString& mode);
|
||||
void setShowLegend(bool show);
|
||||
void setLabelMode(const QString& mode);
|
||||
SerialBackend* serial() const { return m_serial; }
|
||||
DataBackend* data() const { return m_data; }
|
||||
|
||||
void setLanguage(const QString& lang);
|
||||
void setLightMode(bool on);
|
||||
|
||||
bool showGrid() const { return m_showGrid; }
|
||||
void setShowGrid(bool on);
|
||||
|
||||
signals:
|
||||
void minValueChanged();
|
||||
void maxValueChanged();
|
||||
void renderModeChanged();
|
||||
void showLegendChanged();
|
||||
void labelModeChanged();
|
||||
|
||||
void rangeChanged(int minV, int maxV);
|
||||
void renderModeValueChanged(const QString& mode);
|
||||
void labelModeValueChanged(const QString& mode);
|
||||
|
||||
void lightModeChanged();
|
||||
void languageChanged();
|
||||
void connectedChanged();
|
||||
void showGridChanged(bool on);
|
||||
private:
|
||||
int m_min = 100;
|
||||
int m_max = 2000;
|
||||
QString m_renderMode = QStringLiteral("dataViz");
|
||||
bool m_showLegend = true;
|
||||
QString m_labelMode = QStringLiteral("off");
|
||||
SerialBackend* m_serial = nullptr;
|
||||
DataBackend* m_data = nullptr;
|
||||
bool m_lightMode = true;
|
||||
QString m_language = QStringLiteral("zh_CN");
|
||||
|
||||
bool m_showGrid = true;
|
||||
};
|
||||
|
||||
#endif //TACTILEIPC3D_BACKEND_H
|
||||
|
||||
Reference in New Issue
Block a user