#ifndef WSSERVER_H #define WSSERVER_H #include #include #include #include #include #include #include #include #include "QtWebSockets/QWebSocketServer" #include "QtWebSockets/QWebSocket" struct EsmWorkParaStruct { // 工作状态 0: stby 1: 工作 uint32_t uRrPowerOn; // 0: 全面搜索模式,1 精测向模式 uint32_t uRrWorkMode; //侦察方位中心,机体系,单位:deg double dScanAzCentDeg; //侦察方位范围,单位:deg double dScanAzWidthDeg; //侦察俯仰中心,机体系,单位:deg double dScanElCentDeg; //一个景福所拥有的行数 uint32_t uLineNumPerFrame; //天线扫描速度,单位:deg/s float fAntScanVel; //频率扫描速度,单位:MHz/s float fFreqScanVel; //侦收起始频率,如2000MHz float fTecBeginFreqMhz; //侦收终止频率,如18000MHz float fTecEndFreqMhz; }; class WSServer : public QObject { Q_OBJECT public: QWebSocketServer *m_pWebSocketServer; QList m_clients; EsmWorkParaStruct EsmworkPara; explicit WSServer(QObject *parent = nullptr, quint16 port = 80); virtual ~WSServer(); signals: public slots: void onNewConnection(); QJsonObject processJsonObj(QJsonObject objin); void processMessage(QString message); void socketDisconnected(); void returnMessage(QWebSocket *pSender, QJsonObject *jsonObj); // 初始化状态接口 void getInit(QWebSocket *pSender, QJsonObject obj); // 平台表接口 void getPlatformTable(QWebSocket *pSender, QJsonObject obj); // 任务管理显控接口 void getLeadPost(QWebSocket *pSender, QJsonObject obj); void getTaskPlan(QWebSocket *pSender, QJsonObject obj); // 雷侦、通侦显控接口 void getESMInstances(QWebSocket *pSender, QJsonObject obj); void setESMParams(QWebSocket *pSender, QJsonObject obj); void getESMParams(QWebSocket *pSender, QJsonObject obj); void getESMStatus(QWebSocket *pSender, QJsonObject obj); void getESMData(QWebSocket *pSender, QJsonObject obj); // 态势显控接口 void getLocalMap(QWebSocket *pSender, QJsonObject obj); void getRemoteMap(QWebSocket *pSender, QJsonObject obj); void getCombineMap(QWebSocket *pSender, QJsonObject obj); void getGlobalMap(QWebSocket *pSender, QJsonObject obj); void getNavParams(QWebSocket *pSender, QJsonObject obj); void setFreePost(QWebSocket *pSender, QJsonObject obj); }; #endif // WSSERVER_H