| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef LOGSERIALPORT_H
- #define LOGSERIALPORT_H
- #include <QObject>
- #include <QWidget>
- #include <QSerialPort>
- #include <QQueue>
- #include <pqQtlib/serialport/pqrtuhelper.h>
- #include <QPair>
- #include <QDateTime>
- #include <QFile>
- #include <QTimer>
- #include "QDebug"
- #include "globalinfo.h"
- #include "serialbasehandle.h"
- class LogSerialPort : public PQ::RTUHelper, public SerialBaseHandle
- {
- public:
- explicit LogSerialPort();
- ~LogSerialPort();
- float toFloat(const QByteArray & ray);
- bool needSend();
- QByteArray sendData();
- void handle(QByteArray & data);
- void doHandle(const QByteArray & data);
- // void save(int, const QDateTime &tm, double v);
- private:
- QSerialPort * _port;
- QTimer * _timer;
- QQueue<QByteArray> _sendQueue;
- bool started;
- bool needReply;
- bool opened;
- QPair<QDateTime,QFile * > _save;
- QByteArray _getData;
- QByteArray _resetData;
- QByteArray ret;
- double buchang;
- double max;
- double min;
- };
- #endif // LOGSERIALPORT_H
|