feat: AiAnalysis - 16通道AI数据UDP实时采集与分析
功能: - UDP端口监听,实时接收数据 - 解析16通道逗号分隔的ADC数据 - 实时波形绘制(支持滚轮缩放、右键拖拽、双击恢复) - 数据自动保存到 data_端口号/ 目录 - 支持打开历史CSV文件回放查看 - 16通道独立颜色,可切换显示/隐藏 - 深色主题界面
This commit is contained in:
32
udpreceiver.h
Normal file
32
udpreceiver.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef UDPRECEIVER_H
|
||||
#define UDPRECEIVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QUdpSocket>
|
||||
#include <QHostAddress>
|
||||
|
||||
class UdpReceiver : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UdpReceiver(QObject *parent = nullptr);
|
||||
~UdpReceiver();
|
||||
|
||||
bool start(quint16 port);
|
||||
void stop();
|
||||
bool isRunning() const;
|
||||
|
||||
signals:
|
||||
void dataReceived(const QByteArray &data);
|
||||
void errorOccurred(const QString &error);
|
||||
|
||||
private slots:
|
||||
void onReadyRead();
|
||||
|
||||
private:
|
||||
QUdpSocket *m_socket;
|
||||
quint16 m_port;
|
||||
};
|
||||
|
||||
#endif // UDPRECEIVER_H
|
||||
Reference in New Issue
Block a user