929a7be708ee6b5545a09d71249baa55c5f51b34.svn-base 974 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef DNCOMMTHREAD_H
  2. #define DNCOMMTHREAD_H
  3. #include <QThread>
  4. #include <QDateTime>
  5. #include <QList>
  6. class DNCommThread : public QThread
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit DNCommThread(QObject *parent = 0,
  11. quint8 id=0,
  12. bool enabled=false,
  13. QString path="");
  14. void setparam(QString path, bool enabled);
  15. QByteArray comm_work(QByteArray cmd, bool needrtn);
  16. void set_speed(int speed);
  17. int set_Parity(int databits,int stopbits,int parity);
  18. int open_comm();
  19. void chk_list();
  20. void run();
  21. signals:
  22. void dbg_log(QString txt);
  23. void log(QString txt);
  24. void recsql(QString sql);
  25. void stasql(QString sql);
  26. void confsql(QString sql);
  27. public slots:
  28. private:
  29. quint8 Id;
  30. bool Enabled;
  31. bool CommOpened;
  32. QString CommPath;
  33. bool reopen;
  34. int fd;
  35. quint8 liveCur,deathCur;
  36. QList<quint8> liveList,deathList;
  37. };
  38. #endif // DNCOMMTHREAD_H