72842c39f733f32cbb60b857e7c95a1882ef4018.svn-base 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. void setCommType(quint16 type);
  16. quint16 chk_crcc(quint8 *d, int len);
  17. QByteArray comm_work(QByteArray cmd, bool needrtn);
  18. void comm_read();
  19. void ef_comm_read();
  20. void chk_rtn(QByteArray Rtn);
  21. void set_speed(int speed);
  22. int set_Parity(int databits,int stopbits,int parity);
  23. int open_comm();
  24. void chk_e2(QByteArray d, uint t);
  25. void chk_e3(QByteArray d, uint t);
  26. // void chk_list();
  27. void run();
  28. signals:
  29. void dbg_log(QString txt);
  30. void log(QString txt);
  31. void recsql(QString sql);
  32. void stasql(QString sql);
  33. void confsql(QString sql);
  34. public slots:
  35. private:
  36. quint8 Id;
  37. bool Enabled;
  38. bool CommOpened;
  39. QString CommPath;
  40. quint16 CommType;
  41. bool reopen;
  42. int fd;
  43. int ef_idx;
  44. // quint8 liveCur,deathCur;
  45. // QList<quint8> liveList,deathList;
  46. };
  47. #endif // DNCOMMTHREAD_H