12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef DNCOMMTHREAD_H
- #define DNCOMMTHREAD_H
- #include <QThread>
- #include <QDateTime>
- #include <QList>
- class DNCommThread : public QThread
- {
- Q_OBJECT
- public:
- explicit DNCommThread(QObject *parent = 0,
- quint8 id=0,
- bool enabled=false,
- QString path="");
- void setparam(QString path, bool enabled);
- void setCommType(quint16 type);
- quint16 chk_crcc(quint8 *d, int len);
- QByteArray comm_work(QByteArray cmd, bool needrtn);
- void comm_read();
- void ef_comm_read();
- void chk_rtn(QByteArray Rtn);
- void set_speed(int speed);
- int set_Parity(int databits,int stopbits,int parity);
- int open_comm();
- void chk_e2(QByteArray d, uint t);
- void chk_e3(QByteArray d, uint t);
- // void chk_list();
- void run();
- signals:
- void dbg_log(QString txt);
- void log(QString txt);
- void recsql(QString sql);
- void stasql(QString sql);
- void confsql(QString sql);
- public slots:
- private:
- quint8 Id;
- bool Enabled;
- bool CommOpened;
- QString CommPath;
- quint16 CommType;
- bool reopen;
- int fd;
- int ef_idx;
- // quint8 liveCur,deathCur;
- // QList<quint8> liveList,deathList;
- };
- #endif // DNCOMMTHREAD_H
|