modbus_rtu_test/subform.h

81 lines
1.5 KiB
C++

#ifndef SUBFORM_H
#define SUBFORM_H
#include <QWidget>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QBarSet>
#include <QtCharts/QChart>
#include <QtCharts/QValueAxis>
#include <QtCharts/QAreaSeries>
#include <QtCharts/QBarCategoryAxis>
#include <QDateTime>
#include "global.h"
#include <QStandardItemModel>
#include <QStandardItem>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QAreaSeries>
QT_BEGIN_NAMESPACE
namespace Ui { class Form; }
QT_END_NAMESPACE
using namespace QtCharts;
class SubForm :public QWidget
{
Q_OBJECT
public:
SubForm(QString,int baurate,int device_addr,int rate);
void init_charts();
private slots:
void on_pushButton_clicked();
void on_pushButton_2_clicked(bool checked);
void on_pushButton_2_clicked();
void on_log(QString);
void on_pushButton_3_clicked();
void on_pushButton_4_clicked();
void on_pushButton_5_clicked();
void on_pushButton_6_clicked();
public slots:
void rubberZoomAdapt(QPointF fp, QPointF tp);
signals:
void rubberBandChanged(QPointF fp, QPointF tp);
private:
Ui::Form *ui;
QChart *mChart;
QValueAxis *mAxisX;
QValueAxis *mAxisY;
QValueAxis *mAxisY2;
int baurate;
QLineSeries *mSeries1;
QMap<uint16_t,QLineSeries*> mLines;
QVector<QString> pTime;
Config *mConfig;
float mMaxX;
QDateTime mStartTime;
bool mStart;
QStandardItemModel *mModel;
int mCapMax = 0;
QRubberBand *mRubberBand;
};
#endif // SUBFORM_H