1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef READTASK_H |
5 | #define READTASK_H |
6 | |
7 | #include <QObject> |
8 | #include <QtSerialBus> |
9 | #include <QCanBusFrame> |
10 | |
11 | class ReadTask : public QObject |
12 | { |
13 | Q_OBJECT |
14 | public: |
15 | explicit ReadTask(QTextStream &m_output, QObject *parent = nullptr); |
16 | void setShowTimeStamp(bool showStamp); |
17 | bool isShowFlags() const; |
18 | void setShowFlags(bool isShowFlags); |
19 | |
20 | public slots: |
21 | void handleFrames(); |
22 | void handleError(QCanBusDevice::CanBusError /*error*/); |
23 | |
24 | private: |
25 | QTextStream &m_output; |
26 | bool m_showTimeStamp = false; |
27 | bool m_showFlags = false; |
28 | }; |
29 | |
30 | #endif // READTASK_H |
31 | |