#ifndef CMESSAGEMANAGE_H #define CMESSAGEMANAGE_H #include "net/net_msg_bus_api/MsgBusApi.h" #include "net/net_msg_bus_api/CMbCommunicator.h" #include "public/pub_sysinfo_api/SysInfoApi.h" #include "perm_mng_api/PermMngApi.h" #include "service/operate_server_api/JsonMessageStruct.h" #include "service/operate_server_api/JsonOptCommand.h" #include "common/MessageChannel.h" #include #include struct SReadQueue { QString tag_name; QString rtu_tag; int dev_id; QString dev_name; }; struct SReplyQueue { QString rtu_tag; int isSuccess; QString resultStr; int dev_id; int cur_group; QList dotList; QList valueList; }; using namespace iot_public; using namespace iot_service; class CMessageManage : public QObject { Q_OBJECT public: CMessageManage(QObject *parent = 0); ~CMessageManage(); bool sendMessage(const SReadQueue &queueList, int nDstDomainId); signals: void dataChanged(const SReplyQueue& reply); private slots: void recvMessage(); private: void init(); void initMsg(); void closeMsg(); bool addSub(int appID, int channel); bool delSub(int appID, int channel); SOptReqHead createReqHead(int nDstDomainId); std::vector createCtrlQueue(int devID); void parseMsg(const SOptCustCtrlReply &sOptCustCtrlReply); bool checkMsg(std::string strHostName, std::string strInstName, int nOptTime); void test(); private: iot_net::CMbCommunicator *m_communicator; CSysInfoInterfacePtr m_sysInfo; CPermMngApiPtr m_permMng; QTimer *m_timer; std::string m_curRtu; std::string m_strHostName; std::string m_strInstName; int m_nOptTime; // bool m_test; // int m_testDevId; // QString m_testRtuTag; // int m_testNum; }; #endif // CMESSAGEMANAGE_H