| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef LOGSERIALPORT_H
- #define LOGSERIALPORT_H
- #include <QObject>
- #include <QWidget>
- #include <QSerialPort>
- #include <QQueue>
- #include "handle/utils/rtuhelper.h"
- #include <QPair>
- #include <QDateTime>
- #include <QFile>
- #include <QTimer>
- #include "QDebug"
- #include "globalinfo.h"
- #include "serialbasehandle.h"
- #ifdef _MSC_VER
- #pragma execution_character_set("utf-8")
- #endif
- class LogSerialPort : public UtilsFun::RTUHelper, public SerialBaseHandle
- {
- public:
- explicit LogSerialPort();
- ~LogSerialPort();
- // inline bool isStart() const {return started;}
- // inline bool isOpened() const {return opened;}
- 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;
- scaledata _scaledata;
- QByteArray ret;
- double buchang;
- double max;
- double min;
- };
- #endif // LOGSERIALPORT_H
|