modbus_rtu_test/subform.h

81 lines
1.5 KiB
C
Raw Normal View History

2023-09-27 17:30:27 +00:00
#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>
2024-01-15 10:04:07 +00:00
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QAreaSeries>
2023-09-27 17:30:27 +00:00
QT_BEGIN_NAMESPACE
namespace Ui { class Form; }
QT_END_NAMESPACE
2024-01-15 10:04:07 +00:00
using namespace QtCharts;
2023-09-27 17:30:27 +00:00
2024-01-15 10:04:07 +00:00
class SubForm :public QWidget
2023-09-27 17:30:27 +00:00
{
Q_OBJECT
public:
2023-10-03 16:11:49 +00:00
SubForm(QString,int baurate,int device_addr,int rate);
2023-09-27 17:30:27 +00:00
void init_charts();
private slots:
void on_pushButton_clicked();
void on_pushButton_2_clicked(bool checked);
void on_pushButton_2_clicked();
2023-10-03 16:11:49 +00:00
void on_log(QString);
2023-10-04 16:30:14 +00:00
void on_pushButton_3_clicked();
void on_pushButton_4_clicked();
2024-01-15 10:04:07 +00:00
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);
2023-09-27 17:30:27 +00:00
private:
Ui::Form *ui;
QChart *mChart;
QValueAxis *mAxisX;
QValueAxis *mAxisY;
QValueAxis *mAxisY2;
2023-09-30 04:06:01 +00:00
int baurate;
2023-09-27 17:30:27 +00:00
QLineSeries *mSeries1;
2023-10-03 15:48:41 +00:00
QMap<uint16_t,QLineSeries*> mLines;
2023-09-27 17:30:27 +00:00
QVector<QString> pTime;
Config *mConfig;
float mMaxX;
QDateTime mStartTime;
bool mStart;
QStandardItemModel *mModel;
2023-10-04 15:48:12 +00:00
int mCapMax = 0;
2024-01-15 10:04:07 +00:00
QRubberBand *mRubberBand;
2023-09-27 17:30:27 +00:00
};
#endif // SUBFORM_H