12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #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);
- QByteArray comm_work(QByteArray cmd, bool needrtn);
- void set_speed(int speed);
- int set_Parity(int databits,int stopbits,int parity);
- int open_comm();
- 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;
- bool reopen;
- int fd;
- quint8 liveCur,deathCur;
- QList<quint8> liveList,deathList;
- };
- #endif // DNCOMMTHREAD_H
|