mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-23 10:52:15 +00:00
2.2.0 pre3 (#81)
* Hide the system filament * Fix: crash when using m_ProfileJson * Bump profile version to 02.02.41.02 * Update: Flutter 1222
This commit is contained in:
@@ -2319,6 +2319,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_values.push_back("PVB");
|
||||
def->enum_values.push_back("SBS");
|
||||
def->enum_values.push_back("TPU");
|
||||
def->enum_values.push_back("PETG-HF");
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionStrings { "PLA" });
|
||||
|
||||
|
||||
@@ -1154,7 +1154,14 @@ void GUI_App::shutdown()
|
||||
delete web_preprint_dialog;
|
||||
web_preprint_dialog = nullptr;
|
||||
}
|
||||
|
||||
|
||||
// Delete WebPresetDialog to ensure proper cleanup
|
||||
if (SSWCP_MqttAgent_Instance::m_dialog != nullptr) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": destroy WebPresetDialog");
|
||||
delete SSWCP_MqttAgent_Instance::m_dialog;
|
||||
SSWCP_MqttAgent_Instance::m_dialog = nullptr;
|
||||
}
|
||||
|
||||
|
||||
if (m_is_recreating_gui) return;
|
||||
m_is_closing = true;
|
||||
|
||||
@@ -183,7 +183,7 @@ WebPresetDialog::WebPresetDialog(GUI_App* pGUI, long style)
|
||||
// Connect the idle events
|
||||
// Bind(wxEVT_IDLE, &WebPresetDialog::OnIdle, this);
|
||||
// Bind(wxEVT_CLOSE_WINDOW, &WebPresetDialog::OnClose, this);
|
||||
std::thread* load_thread = new std::thread([this]() {
|
||||
m_load_thread = new std::thread([this]() {
|
||||
LoadProfile();
|
||||
});
|
||||
// LoadProfile();
|
||||
@@ -804,29 +804,30 @@ int WebPresetDialog::SaveProfile()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_ProfileJson_mutex);
|
||||
for (auto it = m_ProfileJson["model"].begin(); it != m_ProfileJson["model"].end(); ++it) {
|
||||
if (it.value().is_object()) {
|
||||
json temp_model = it.value();
|
||||
std::string model_name = temp_model["model"];
|
||||
std::string vendor_name = temp_model["vendor"];
|
||||
std::string selected = temp_model["nozzle_selected"];
|
||||
boost::trim(selected);
|
||||
std::string nozzle;
|
||||
while (selected.size() > 0) {
|
||||
auto pos = selected.find(';');
|
||||
if (pos != std::string::npos) {
|
||||
nozzle = selected.substr(0, pos);
|
||||
m_appconfig_new.set_variant(vendor_name, model_name, nozzle, "true");
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__
|
||||
<< boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected") % vendor_name %
|
||||
model_name % nozzle;
|
||||
selected = selected.substr(pos + 1);
|
||||
boost::trim(selected);
|
||||
} else {
|
||||
m_appconfig_new.set_variant(vendor_name, model_name, selected, "true");
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__
|
||||
<< boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected") % vendor_name %
|
||||
model_name % selected;
|
||||
break;
|
||||
if (it.value().is_object()) {
|
||||
json temp_model = it.value();
|
||||
std::string model_name = temp_model["model"];
|
||||
std::string vendor_name = temp_model["vendor"];
|
||||
std::string selected = temp_model["nozzle_selected"];
|
||||
boost::trim(selected);
|
||||
std::string nozzle;
|
||||
while (selected.size() > 0) {
|
||||
auto pos = selected.find(';');
|
||||
if (pos != std::string::npos) {
|
||||
nozzle = selected.substr(0, pos);
|
||||
m_appconfig_new.set_variant(vendor_name, model_name, nozzle, "true");
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
<< __FUNCTION__
|
||||
<< boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected") % vendor_name % model_name % nozzle;
|
||||
selected = selected.substr(pos + 1);
|
||||
boost::trim(selected);
|
||||
} else {
|
||||
m_appconfig_new.set_variant(vendor_name, model_name, selected, "true");
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
<< __FUNCTION__
|
||||
<< boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected") % vendor_name % model_name % selected;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +122,8 @@ public:
|
||||
|
||||
wxString m_sm_user_agent;
|
||||
std::string m_editing_filament_id;
|
||||
|
||||
std::thread* m_load_thread = nullptr;
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
Reference in New Issue
Block a user