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