XORDE  v1.0
eXtensible Operational Robotic Development Environment
ModuleBaseAppONB.h
1 #ifndef MODULEBASEAPPONB_H
2 #define MODULEBASEAPPONB_H
3 
4 #include <QObject>
5 #include <QtWebSockets/QWebSocket>
6 #include "network/WebSocket/WebSocketClient.h"
7 #include "ModuleBaseONB.h"
8 #include "tronostools_global.h"
9 
12 class TRONOSTOOLSSHARED_EXPORT ModuleBaseAppONB : public ModuleBaseONB
13 {
14  Q_OBJECT
15 
16 public:
21  explicit ModuleBaseAppONB(QString in_id, QString host, QString port, QObject *parent = nullptr);
22 
24  ~ModuleBaseAppONB() override;
25 
26  virtual bool isActive() override;
27  virtual bool work() override;
28 
31  bool tryConnect();
32 
34  void closeConnect();
35 
36 private:
37  QString m_id;
38  QString m_port;
39  QString m_host;
40  WebSocketClient* m_pClientSocket = nullptr;
41 
42 //signals:
43 // void disconnection();
44 // void connectionDone();
45 
46 protected:
48  virtual void sendPacket(const ONBPacket &packet) override;
50  virtual bool start() override;
51 
52 private slots:
53  void onConnect();
54 
55 protected slots:
58  virtual void receiveData(const QByteArray &data);
59 };
60 
61 #endif // MODULEBASEAPPONB_H
The base class for XORDE module.
Definition: ModuleBaseONB.h:59
ONB module base for external modules.
Definition: ModuleBaseAppONB.h:12