16 #include <QSerialPort>
22 : QThread(parent), _communication(communication)
33 emit
error(tr(
"Wątek nie mógł otworzyć portu"));
37 emit
info(tr(
"Otwarto port szeregowy"));
38 emit
setSerialStatus(tr(
"Połączono z portem szeregowym | Nazwa portu: ") +
45 emit
error(tr(
"Wątek nie mógł poprawnie zamknąć portu!"));
49 emit
info(tr(
"Zamknięto połączenie."));
The class connecting main application and serial port.
void receiveData()
Receive line one by one from the serial device in loop until end of communication.
bool closeSerialPort()
Close the serial port.
const std::string & getDeviceName() const
Get the serial device name.
void setDevice(QSerialPort *device)
Set a new handle to the serial device.
bool openSerialPort(const char *serialPort)
Open the serial port.
void run() override
Run main thread function.
void setSerialStatus(const QString &message)
Signal emmitted to change connection status with the serial device on the status bar.
FrameThread(Communication *communication=nullptr, QObject *parent=nullptr)
Construct a new FrameThread object.
Communication * _communication
Communication class handle.
void info(const QString &info)
Signal emmitted to add informations to logs.
void error(const QString &error)
Signal emmitted to add errors on the status bar.
Communication class declaration.
FrameThread class declaration.