wsserver.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef WSSERVER_H
  2. #define WSSERVER_H
  3. #include <QObject>
  4. #include <QList>
  5. #include <QByteArray>
  6. #include <QJsonArray>
  7. #include <QJsonDocument>
  8. #include <QJsonObject>
  9. #include <QJsonValue>
  10. #include <QJsonParseError>
  11. #include "QtWebSockets/QWebSocketServer"
  12. #include "QtWebSockets/QWebSocket"
  13. #include "algorithms/coder_array.h"
  14. #include "algorithms/fun1_false_target_distance.h"
  15. #include "algorithms/fun2.h"
  16. #include "algorithms/fun4_S_jam.h"
  17. #include "algorithms/fun8_2_FMjamming_H.h"
  18. #include "algorithms/fun8_AMJamming_H.h"
  19. #include "algorithms/fun8_3_jamming_H.h"
  20. #include "algorithms/fun5.h"
  21. #include "algorithms/fun6.h"
  22. #include "algorithms/fun7_DRFMRF.h"
  23. //QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
  24. //QT_FORWARD_DECLARE_CLASS(QWebSocket)
  25. class WSServer : public QObject
  26. {
  27. Q_OBJECT
  28. public:
  29. QWebSocketServer *m_pWebSocketServer;
  30. QList<QWebSocket *> m_clients;
  31. explicit WSServer(QObject *parent = nullptr, quint16 port = 80);
  32. virtual ~WSServer();
  33. signals:
  34. public slots:
  35. void onNewConnection();
  36. QJsonObject processJsonObj(QJsonObject objin);
  37. void processMessage(QString message);
  38. void socketDisconnected();
  39. void returnMessage(QWebSocket *pSender, QJsonObject *obj);
  40. // 初始化状态接口
  41. void getInit(QWebSocket *pSender, QJsonObject obj);
  42. // 平台表接口
  43. void getPlatformTable(QWebSocket *pSender, QJsonObject obj);
  44. // 任务管理显控接口
  45. void getLeadPost(QWebSocket *pSender, QJsonObject obj);
  46. void getTaskPlan(QWebSocket *pSender, QJsonObject obj);
  47. // 态势显控接口
  48. void getLocalMap(QWebSocket *pSender, QJsonObject obj);
  49. void getRemoteMap(QWebSocket *pSender, QJsonObject obj);
  50. void getCombineMap(QWebSocket *pSender, QJsonObject obj);
  51. void getGlobalMap(QWebSocket *pSender, QJsonObject obj);
  52. // 雷达、ECM显控接口
  53. void getRadarInstances(QWebSocket *pSender, QJsonObject obj);
  54. void getRadarParams(QWebSocket *pSender, QJsonObject obj);
  55. void getJammingInstances(QWebSocket *pSender, QJsonObject obj);
  56. void getJammingParams(QWebSocket *pSender, QJsonObject obj);
  57. void setJammingStyle(QWebSocket *pSender, QJsonObject obj);
  58. void getJammingSig(QWebSocket *pSender, QJsonObject obj);
  59. };
  60. #endif // WSSERVER_H