BLEProthesisInterfaceQtWorkerThread.cpp
Go to the documentation of this file.
2 
3 
5  _owner{&owner},
6  _mac{QString::fromStdString(mac)}
7 {}
8 
10  = default;
11 
13 {
14  _worker->kill();
15 }
16 
18 {
19  _worker->sendCommand(cmd);
20 }
21 
22 void BLEProthesisInterfaceQtWorkerThread::run()
23 {
24  _worker = new BLEProthesisInterfaceQtWorker{_mac, *_owner};
25  qDebug() << '[' << _mac << ']' << " Starting qt event loop.";
26  int r = exec();
27  if (_worker)
28  {
29  _worker->kill();
30  delete _worker;
31  }
32  qDebug() << '[' << _mac << ']' << " Sopped qt event loop -> " << r;
33 }
BLEProthesisInterfaceQtWorkerThread::kill
void kill()
Definition: BLEProthesisInterfaceQtWorkerThread.cpp:12
BLEProthesisInterfaceQtWorkerThread::sendCommand
void sendCommand(const std::string &cmd)
Definition: BLEProthesisInterfaceQtWorkerThread.cpp:17
BLEProthesisInterfaceQtWorker
Definition: BLEProthesisInterfaceQtWorker.h:15
BLEProthesisInterfaceQtWorker::sendCommand
void sendCommand(const std::string &cmd)
Definition: BLEProthesisInterfaceQtWorker.cpp:26
BLEProthesisInterfaceQtWorkerThread::BLEProthesisInterfaceQtWorkerThread
BLEProthesisInterfaceQtWorkerThread(const std::string &mac, BLEProthesisInterface &owner)
Definition: BLEProthesisInterfaceQtWorkerThread.cpp:4
BLEProthesisInterfaceQtWorkerThread.h
BLEProthesisInterface
Definition: BLEProthesisInterface.h:10
BLEProthesisInterfaceQtWorker::kill
void kill()
Definition: BLEProthesisInterfaceQtWorker.cpp:21
BLEProthesisInterfaceQtWorkerThread::~BLEProthesisInterfaceQtWorkerThread
~BLEProthesisInterfaceQtWorkerThread()