FIX:fixed issue with chinese path
jira:[Fixed the issue of failed loading of configuration files under Chinese path] Change-Id: I9badd8fc158fcf49f46411ac4e5f72d58823eeb2
This commit is contained in:
parent
689331e2bf
commit
aa8d7acf3b
|
@ -2212,7 +2212,8 @@ int Print::get_hrc_by_nozzle_type(const NozzleType&type)
|
||||||
static std::map<std::string, int>nozzle_type_to_hrc;
|
static std::map<std::string, int>nozzle_type_to_hrc;
|
||||||
if (nozzle_type_to_hrc.empty()) {
|
if (nozzle_type_to_hrc.empty()) {
|
||||||
fs::path file_path = fs::path(resources_dir()) / "info" / "nozzle_info.json";
|
fs::path file_path = fs::path(resources_dir()) / "info" / "nozzle_info.json";
|
||||||
std::ifstream in(file_path.string());
|
boost::nowide::ifstream in(file_path.string());
|
||||||
|
//std::ifstream in(file_path.string());
|
||||||
json j;
|
json j;
|
||||||
try {
|
try {
|
||||||
j = json::parse(in);
|
j = json::parse(in);
|
||||||
|
|
|
@ -5534,7 +5534,7 @@ std::vector<std::string> DeviceManager::get_resolution_supported(std::string typ
|
||||||
std::vector<std::string> resolution_supported;
|
std::vector<std::string> resolution_supported;
|
||||||
|
|
||||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||||
std::ifstream json_file(config_file.c_str());
|
boost::nowide::ifstream json_file(config_file.c_str());
|
||||||
try {
|
try {
|
||||||
json jj;
|
json jj;
|
||||||
if (json_file.is_open()) {
|
if (json_file.is_open()) {
|
||||||
|
@ -5556,7 +5556,7 @@ std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_
|
||||||
{
|
{
|
||||||
std::vector<std::string> compatible_machine;
|
std::vector<std::string> compatible_machine;
|
||||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||||
std::ifstream json_file(config_file.c_str());
|
boost::nowide::ifstream json_file(config_file.c_str());
|
||||||
try {
|
try {
|
||||||
json jj;
|
json jj;
|
||||||
if (json_file.is_open()) {
|
if (json_file.is_open()) {
|
||||||
|
@ -5575,10 +5575,12 @@ std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DeviceManager::load_filaments_blacklist_config(std::string config_file)
|
bool DeviceManager::load_filaments_blacklist_config()
|
||||||
{
|
{
|
||||||
filaments_blacklist = json::object();
|
filaments_blacklist = json::object();
|
||||||
std::ifstream json_file(config_file.c_str());
|
|
||||||
|
std::string config_file = Slic3r::resources_dir() + "/printers/filaments_blacklist.json";
|
||||||
|
boost::nowide::ifstream json_file(config_file.c_str());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (json_file.is_open()) {
|
if (json_file.is_open()) {
|
||||||
|
|
|
@ -1029,7 +1029,7 @@ public:
|
||||||
static bool get_printer_is_enclosed(std::string type_str);
|
static bool get_printer_is_enclosed(std::string type_str);
|
||||||
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||||
static bool load_filaments_blacklist_config(std::string config_file);
|
static bool load_filaments_blacklist_config();
|
||||||
static void check_filaments_in_blacklist(std::string tag_vendor, std::string tag_type, bool& in_blacklist, std::string& ac, std::string& info);
|
static void check_filaments_in_blacklist(std::string tag_vendor, std::string tag_type, bool& in_blacklist, std::string& ac, std::string& info);
|
||||||
static std::string load_gcode(std::string type_str, std::string gcode_file);
|
static std::string load_gcode(std::string type_str, std::string gcode_file);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1280,8 +1280,7 @@ void GUI_App::post_init()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
std::string filaments_blacklist_config_file = Slic3r::resources_dir() + "/printers/filaments_blacklist.json";
|
DeviceManager::load_filaments_blacklist_config();
|
||||||
DeviceManager::load_filaments_blacklist_config(encode_path(filaments_blacklist_config_file.c_str()));
|
|
||||||
|
|
||||||
// remove old log files over LOG_FILES_MAX_NUM
|
// remove old log files over LOG_FILES_MAX_NUM
|
||||||
std::string log_addr = data_dir();
|
std::string log_addr = data_dir();
|
||||||
|
|
Loading…
Reference in New Issue