post changes after merging BS1.7.4

Remove tracking etc..
This commit is contained in:
SoftFever 2023-08-26 18:24:13 +08:00
parent e65b11a831
commit 2a478ab4f9
615 changed files with 46215 additions and 54844 deletions

View file

@ -38,7 +38,7 @@ using namespace nlohmann;
namespace Slic3r {
static const std::string VERSION_CHECK_URL = "";
static const std::string VERSION_CHECK_URL = "https://api.github.com/repos/softfever/OrcaSlicer/releases";
static const std::string MODELS_STR = "models";
const std::string AppConfig::SECTION_FILAMENTS = "filaments";
@ -65,19 +65,19 @@ std::string AppConfig::get_hms_host()
{
std::string sel = get("iot_environment");
std::string host = "";
#if !BBL_RELEASE_TO_PUBLIC
if (sel == ENV_DEV_HOST)
host = "e-dev.bambu-lab.com";
else if (sel == ENV_QAT_HOST)
host = "e-qa.bambu-lab.com";
else if (sel == ENV_PRE_HOST)
host = "e-pre.bambu-lab.com";
else if (sel == ENV_PRODUCT_HOST)
host = "e.bambulab.com";
return host;
#else
// #if !BBL_RELEASE_TO_PUBLIC
// if (sel == ENV_DEV_HOST)
// host = "e-dev.bambu-lab.com";
// else if (sel == ENV_QAT_HOST)
// host = "e-qa.bambu-lab.com";
// else if (sel == ENV_PRE_HOST)
// host = "e-pre.bambu-lab.com";
// else if (sel == ENV_PRODUCT_HOST)
// host = "e.bambulab.com";
// return host;
// #else
return "e.bambulab.com";
#endif
// #endif
}
void AppConfig::reset()
@ -178,6 +178,9 @@ void AppConfig::set_defaults()
set_bool("show_hints", true);
//#endif
if (get("show_gcode_window").empty())
set_bool("show_gcode_window", true);
#ifdef _WIN32
@ -226,6 +229,10 @@ void AppConfig::set_defaults()
set("slicer_uuid", to_string(uuid));
}
// Orca
if (get("stealth_mode").empty()) {
set_bool("stealth_mode", false);
}
if (get("show_model_mesh").empty()) {
set_bool("show_model_mesh", false);
}
@ -318,15 +325,19 @@ void AppConfig::set_defaults()
set("curr_bed_type", "1");
}
#if BBL_RELEASE_TO_PUBLIC
// #if BBL_RELEASE_TO_PUBLIC
if (get("iot_environment").empty()) {
set("iot_environment", "3");
}
#else
if (get("iot_environment").empty()) {
set("iot_environment", "1");
// #else
// if (get("iot_environment").empty()) {
// set("iot_environment", "1");
// }
// #endif
if (get("presets", "filament_colors").empty()) {
set_str("presets", "filament_colors", "#F2754E");
}
#endif
if (get("print", "bed_leveling").empty()) {
set_str("print", "bed_leveling", "1");
@ -531,6 +542,10 @@ std::string AppConfig::load()
}
m_printer_cali_infos.emplace_back(cali_info);
}
} else if (it.key() == "orca_presets") {
for (auto& j_model : it.value()) {
m_printer_settings[j_model["machine"].get<std::string>()] = j_model;
}
} else {
if (it.value().is_object()) {
for (auto iter = it.value().begin(); iter != it.value().end(); iter++) {
@ -702,6 +717,10 @@ void AppConfig::save()
}
}
// write machine settings
for (const auto& preset : m_printer_settings) {
j["orca_presets"].push_back(preset.second);
}
boost::nowide::ofstream c;
c.open(path_pid, std::ios::out | std::ios::trunc);
c << std::setw(4) << j << std::endl;
@ -1128,29 +1147,29 @@ void AppConfig::update_last_backup_dir(const std::string& dir)
std::string AppConfig::get_region()
{
#if BBL_RELEASE_TO_PUBLIC
// #if BBL_RELEASE_TO_PUBLIC
return this->get("region");
#else
std::string sel = get("iot_environment");
std::string region;
if (sel == ENV_DEV_HOST)
region = "ENV_CN_DEV";
else if (sel == ENV_QAT_HOST)
region = "ENV_CN_QA";
else if (sel == ENV_PRE_HOST)
region = "ENV_CN_PRE";
if (region.empty())
return this->get("region");
return region;
#endif
// #else
// std::string sel = get("iot_environment");
// std::string region;
// if (sel == ENV_DEV_HOST)
// region = "ENV_CN_DEV";
// else if (sel == ENV_QAT_HOST)
// region = "ENV_CN_QA";
// else if (sel == ENV_PRE_HOST)
// region = "ENV_CN_PRE";
// if (region.empty())
// return this->get("region");
// return region;
// #endif
}
std::string AppConfig::get_country_code()
{
std::string region = get_region();
#if !BBL_RELEASE_TO_PUBLIC
if (is_engineering_region()) { return region; }
#endif
// #if !BBL_RELEASE_TO_PUBLIC
// if (is_engineering_region()) { return region; }
// #endif
if (region == "CHN" || region == "China")
return "CN";
else if (region == "USA")