实现QT6启动器,QT版本有qt5升级到qt6

This commit is contained in:
lixiaoyuan
2025-09-10 20:10:51 +08:00
parent 3d03bbe9b5
commit e822d57b67
188 changed files with 1376 additions and 219 deletions

View File

@@ -25,6 +25,17 @@ struct REGInfo
}
};
//struct TopicInfo
//{
// std::string name;
// std::string topic;
// int deviceType;
// TopicInfo() {};
// TopicInfo(std::string name, std::string topic, int deviceType)
// :name(name), topic(topic), deviceType(deviceType)
// {};
//};
using namespace std;
class MqttClient
@@ -36,7 +47,9 @@ public:
void destory();
void subscribe();
int publish(string topic, string text);
//int publish();
int polling();
void onConnectionLost(char* cause);
int onMessageArrived(char* topic, int len, MQTTAsync_message* msg);
@@ -46,33 +59,17 @@ public:
void onConnectFaiure(MQTTAsync_failureData* resp);
void parseEMS_YX(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseEMS_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parsePCU_YX(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parsePCU_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parsePCS_YX(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parsePCS_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseBMS_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseBCU_YX(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseBCU_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseMEM_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseTH_YC(std::shared_ptr<Station> station, njson& json, std::map<std::string, REGInfo>& mapRegInfo);
//void parseFire40_YX(std::string& text);
//void parseCooling_YX(std::string& text);
//void parseCooling_YC(std::string& text);
//void parseCharger_YC(std::string& text);
//void parseGateway_YX(std::string& text);
//void parseGateway_YC(std::string& text);
//void parseGateway_YT(std::string& text);
//void parseTQ(std::string& text);
public:
std::string clientId;
MQTTAsync client = nullptr;
std::vector<std::string> vecTopic;
std::string addr; // "tcp://localhost:1883"
int qos {0};
bool isConnected {false};
bool isSubscribed {false};
std::map<std::string, int> mapTopicInfo;
};