refine the prompt hint for other vendor's 3mf

Change-Id: I8dbb63031a0d32bb19ee67a0091cb80b35424b81
This commit is contained in:
lane.wei 2022-08-05 12:03:14 +08:00 committed by Lane.Wei
parent b30370196f
commit 11a7fe1f32
2 changed files with 23 additions and 18 deletions

View File

@ -2671,14 +2671,14 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
if (en_3mf_file_type == En3mfType::From_Prusa) { if (en_3mf_file_type == En3mfType::From_Prusa) {
// do not reset the model config // do not reset the model config
load_config = false; load_config = false;
show_info(q, _L("the 3mf is not compatible, load geometry data only!"), _L("Incompatible 3mf")); show_info(q, _L("The 3mf is not from Bambu lab, load geometry data only."), _L("Load 3mf"));
} }
else if (load_config && (file_version.maj() != app_version.maj())) { else if (load_config && (file_version.maj() != app_version.maj())) {
// version mismatch, only load geometries // version mismatch, only load geometries
load_config = false; load_config = false;
if (!load_model) { if (!load_model) {
// only load config case, return directly // only load config case, return directly
show_info(q, _L("The Config is not compatible and can not be loaded."), _L("Incompatible 3mf")); show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
return empty_result; return empty_result;
} }
load_old_project = true; load_old_project = true;
@ -2686,7 +2686,10 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
q->select_view_3D("3D"); q->select_view_3D("3D");
// select plate 0 as default // select plate 0 as default
q->select_plate(0); q->select_plate(0);
show_info(q, _L("the 3mf is not compatible, load geometry data only!"), _L("Incompatible 3mf")); if (en_3mf_file_type == En3mfType::From_BBS)
show_info(q, _L("The 3mf is generated by old Bambu Studio, load geometry data only."), _L("Load 3mf"));
else
show_info(q, _L("The 3mf is not from Bambu lab, load geometry data only."), _L("Load 3mf"));
for (ModelObject *model_object : model.objects) { for (ModelObject *model_object : model.objects) {
model_object->config.reset(); model_object->config.reset();
// Is there any modifier or advanced config data? // Is there any modifier or advanced config data?

View File

@ -478,7 +478,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
{ {
std::map<std::string, Resource> resource_list; std::map<std::string, Resource> resource_list;
BOOST_LOG_TRIVIAL(info) << format("[BBL Updater]: get preferred setting version for app version %1%, url: `%2%`", SLIC3R_APP_NAME, version_check_url); BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%")%SLIC3R_APP_NAME%http_url;
std::string query_params = "?"; std::string query_params = "?";
bool first = true; bool first = true;
@ -496,6 +496,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
std::string url = http_url; std::string url = http_url;
url += query_params; url += query_params;
Slic3r::Http http = Slic3r::Http::get(url); Slic3r::Http http = Slic3r::Http::get(url);
BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources request_url: %1%")%url;
http.on_progress([this](Slic3r::Http::Progress, bool &cancel_http) { http.on_progress([this](Slic3r::Http::Progress, bool &cancel_http) {
if (cancel) { if (cancel) {
cancel_http = true; cancel_http = true;
@ -503,7 +504,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
}) })
.on_complete([this, &resource_list, resources](std::string body, unsigned) { .on_complete([this, &resource_list, resources](std::string body, unsigned) {
try { try {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: request_resources, body=" << body; BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: request_resources, body=" << body;
json j = json::parse(body); json j = json::parse(body);
std::string message = j["message"].get<std::string>(); std::string message = j["message"].get<std::string>();
@ -528,22 +529,22 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map<std::str
url = sub_iter.value(); url = sub_iter.value();
} }
} }
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get type " << resource << ", version " << version << ", url " << url; BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: get type " << resource << ", version " << version << ", url " << url;
resource_list.emplace(resource, Resource{version, description, url}); resource_list.emplace(resource, Resource{version, description, url});
} }
} }
} else { } else {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get version of settings failed, body=" << body; BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed, body=" << body;
} }
} catch (std::exception &e) { } catch (std::exception &e) {
BOOST_LOG_TRIVIAL(trace) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%") % e.what() % body).str(); BOOST_LOG_TRIVIAL(error) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%") % e.what() % body).str();
} catch (...) { } catch (...) {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get version of settings failed,, body=" << body; BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed,, body=" << body;
} }
}) })
.on_error([&](std::string body, std::string error, unsigned status) { .on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(trace) << boost::format("[BBL Updater]: status=%1%, error=%2%, body=%3%") % status % error % body; BOOST_LOG_TRIVIAL(error) << boost::format("[BBL Updater]: status=%1%, error=%2%, body=%3%") % status % error % body;
}) })
.perform_sync(); .perform_sync();
@ -614,11 +615,11 @@ void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vend
{ {
std::map<std::string, std::pair<Semver, std::string>> vendor_list; std::map<std::string, std::pair<Semver, std::string>> vendor_list;
std::map<std::string, std::string> vendor_descriptions; std::map<std::string, std::string> vendor_descriptions;
BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: Syncing configuration cache"; BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: sync_config Syncing configuration cache";
if (!enabled_config_update) { return; } if (!enabled_config_update) { return; }
BOOST_LOG_TRIVIAL(info) << format("[BBL Updater]: get preferred setting version for app version %1%, url: `%2%`", SLIC3R_APP_NAME, version_check_url); BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_config get preferred setting version for app version %1%, http_url: %2%")%SLIC3R_APP_NAME%http_url;
std::string query_params = "?"; std::string query_params = "?";
bool first = true; bool first = true;
@ -641,6 +642,7 @@ void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vend
std::string url = http_url; std::string url = http_url;
url += query_params; url += query_params;
Slic3r::Http http = Slic3r::Http::get(url); Slic3r::Http http = Slic3r::Http::get(url);
BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_config request_url: %1%")%url;
http.on_progress([this](Slic3r::Http::Progress, bool &cancel_http) { http.on_progress([this](Slic3r::Http::Progress, bool &cancel_http) {
if (cancel) { if (cancel) {
cancel_http = true; cancel_http = true;
@ -649,7 +651,7 @@ void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vend
.on_complete( .on_complete(
[this, &vendor_list, &vendor_descriptions, vendors](std::string body, unsigned) { [this, &vendor_list, &vendor_descriptions, vendors](std::string body, unsigned) {
try { try {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]::body=" << body; BOOST_LOG_TRIVIAL(info) << "[BBL Updater]::body=" << body;
json j = json::parse(body); json j = json::parse(body);
std::string message = j["message"].get<std::string>(); std::string message = j["message"].get<std::string>();
@ -678,7 +680,7 @@ void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vend
url = sub_iter.value(); url = sub_iter.value();
} }
} }
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get type "<< type <<", version "<<version.to_string()<<", url " << url; BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: get type "<< type <<", version "<<version.to_string()<<", url " << url;
for (auto vendor_it :vendors) { for (auto vendor_it :vendors) {
const VendorProfile& vendor_profile = vendor_it.second; const VendorProfile& vendor_profile = vendor_it.second;
@ -697,21 +699,21 @@ void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vend
} }
} }
else { else {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get version of settings failed, body=" << body; BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed, body=" << body;
} }
} }
catch (std::exception& e) { catch (std::exception& e) {
BOOST_LOG_TRIVIAL(trace) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%") BOOST_LOG_TRIVIAL(error) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%")
% e.what() % e.what()
% body).str(); % body).str();
} }
catch (...) { catch (...) {
BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get version of settings failed,, body=" << body; BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed,, body=" << body;
} }
} }
) )
.on_error([&](std::string body, std::string error, unsigned status) { .on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(trace) << boost::format("[BBL Updater]: status=%1%, error=%2%, body=%3%") BOOST_LOG_TRIVIAL(error) << boost::format("[BBL Updater]: status=%1%, error=%2%, body=%3%")
% status % status
% error % error
% body; % body;