NEW: add HMS to query hms info

display hms msg in HMS tab of Monitor

Change-Id: I4df1c63b104463ba62cdf7eb079a540a4176f8c5
Signed-off-by: Stone Li <stone.li@bambulab.com>
(cherry picked from commit f4635d18f3383e70177536dfbe5edf2e1370b746)
This commit is contained in:
Stone Li 2022-08-05 17:57:07 +08:00 committed by Lane.Wei
parent efd20d0a84
commit 73e4078348
17 changed files with 385 additions and 128 deletions

45
src/slic3r/GUI/HMS.hpp Normal file
View file

@ -0,0 +1,45 @@
#ifndef slic3r_HMS_hpp_
#define slic3r_HMS_hpp_
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/Button.hpp"
#include "Widgets/StepCtrl.hpp"
#include "BitmapCache.hpp"
#include "slic3r/Utils/Http.hpp"
#include "libslic3r/Thread.hpp"
#include "nlohmann/json.hpp"
namespace Slic3r {
namespace GUI {
#define HMS_INFO_FILE "hms.json"
class HMSQuery {
protected:
json m_hms_json;
int download_hms_info();
int load_from_local(std::string& version_info);
int save_to_local();
std::string get_hms_file();
public:
HMSQuery() {}
int check_hms_info();
wxString query_hms_msg(std::string long_error_code);
wxString query_error_msg(std::string error_code);
wxString query_print_error_msg(int print_error);
};
int get_hms_info_version(std::string &version);
std::string get_hms_wiki_url(int code);
std::string get_error_message(int error_code);
}
}
#endif