rtuport.h 643 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef RTUPORT_H
  2. #define RTUPORT_H
  3. #include <QObject>
  4. #include "QDebug"
  5. #include <QSerialPort>
  6. #include "QTimer"
  7. //#include "globalinfo.h"
  8. #include "handle/seriport/serialbasehandle.h"
  9. class RtuPort : public QObject
  10. {
  11. Q_OBJECT
  12. public:
  13. RtuPort(QObject * p);
  14. void start(QString & name, int band, SerialBaseHandle * handle);
  15. inline bool isStart() const {return stard;}
  16. inline SerialBaseHandle * handle() {return _handle;}
  17. private slots:
  18. void receiveInfo();
  19. void portWrite();
  20. private:
  21. QSerialPort *m_serialPort;
  22. QTimer *timer;
  23. SerialBaseHandle * _handle;
  24. bool stard;
  25. };
  26. #endif // RTUPORT_H