From b6e4f52c05350f08f4f38483aa87541566047eb6 Mon Sep 17 00:00:00 2001 From: peachismomo Date: Tue, 18 Aug 2026 19:00:53 +0800 Subject: [PATCH] fix: recursive include between HMS.hpp and GUI_App.hpp --- src/slic3r/GUI/HMS.cpp | 1 + src/slic3r/GUI/HMS.hpp | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/slic3r/GUI/HMS.cpp b/src/slic3r/GUI/HMS.cpp index 4d67a398f7..5471c16064 100644 --- a/src/slic3r/GUI/HMS.cpp +++ b/src/slic3r/GUI/HMS.cpp @@ -1,6 +1,7 @@ #include "HMS.hpp" #include "GUI.hpp" +#include "GUI_App.hpp" #include "DeviceManager.hpp" #include "DeviceCore/DevManager.h" #include "DeviceCore/DevUtil.h" diff --git a/src/slic3r/GUI/HMS.hpp b/src/slic3r/GUI/HMS.hpp index d2a87ebf42..c494539b36 100644 --- a/src/slic3r/GUI/HMS.hpp +++ b/src/slic3r/GUI/HMS.hpp @@ -1,7 +1,6 @@ #ifndef slic3r_HMS_hpp_ #define slic3r_HMS_hpp_ -#include "GUI_App.hpp" #include "GUI.hpp" #include "I18N.hpp" #include "Widgets/Label.hpp" @@ -11,7 +10,11 @@ #include "slic3r/Utils/Http.hpp" #include "libslic3r/Thread.hpp" #include "nlohmann/json.hpp" +#include #include +#include +#include +#include namespace Slic3r { @@ -26,12 +29,12 @@ namespace GUI { class HMSQuery { protected: - std::unordered_map m_hms_info_jsons; // key-> device id type, the first three digits of SN number - std::unordered_map m_hms_action_jsons;// key-> device id type + std::unordered_map m_hms_info_jsons; // key-> device id type, the first three digits of SN number + std::unordered_map m_hms_action_jsons;// key-> device id type std::unordered_map m_hms_local_images; // key-> image name mutable std::mutex m_hms_mutex; - std::unordered_map m_cloud_hms_last_update_time; + std::unordered_map m_cloud_hms_last_update_time; public: HMSQuery() { } @@ -61,18 +64,18 @@ private: // load hms void init_hms_info(const std::string& dev_type_id); void copy_from_data_dir_to_local(); - int download_hms_related(const std::string& hms_type, const std::string& dev_id_type, json* receive_json); - int load_from_local(const std::string& hms_type, const std::string& dev_id_type, json* receive_json, std::string& version_info); - int save_to_local(std::string lang, std::string hms_type, std::string dev_id_type, json save_json); + int download_hms_related(const std::string& hms_type, const std::string& dev_id_type, nlohmann::json* receive_json); + int load_from_local(const std::string& hms_type, const std::string& dev_id_type, nlohmann::json* receive_json, std::string& version_info); + int save_to_local(std::string lang, std::string hms_type, std::string dev_id_type, nlohmann::json save_json); std::string get_hms_file(std::string hms_type, std::string lang = std::string("en"), std::string dev_id_type = ""); // internal query - string get_dev_id_type(const MachineObject* obj) const; - wxString _query_hms_msg(const string& dev_id_type, const string& long_error_code, const string& lang_code = std::string("en")); + std::string get_dev_id_type(const MachineObject* obj) const; + wxString _query_hms_msg(const std::string& dev_id_type, const std::string& long_error_code, const std::string& lang_code = std::string("en")); - bool _is_internal_error(const string &dev_id_type, const string &long_error_code, const string &lang_code = std::string("en")); - wxString _query_error_msg(const string& dev_id_type, const std::string& long_error_code, const std::string& lang_code = std::string("en")); - wxString _query_error_image_action(const string& dev_id_type, const std::string& long_error_code, std::vector& button_action); + bool _is_internal_error(const std::string &dev_id_type, const std::string &long_error_code, const std::string &lang_code = std::string("en")); + wxString _query_error_msg(const std::string& dev_id_type, const std::string& long_error_code, const std::string& lang_code = std::string("en")); + wxString _query_error_image_action(const std::string& dev_id_type, const std::string& long_error_code, std::vector& button_action); }; int get_hms_info_version(std::string &version); @@ -85,4 +88,4 @@ std::string get_error_message(int error_code); } -#endif \ No newline at end of file +#endif