Merge branch 'dev' of https://github.com/prusa3d/PrusaSlicer into et_texture_support

This commit is contained in:
enricoturri1966 2021-12-10 09:38:03 +01:00
commit 36ce076de9
3 changed files with 31 additions and 9 deletions

View File

@ -2751,7 +2751,8 @@ void PrintConfigDef::init_fff_params()
def->label = L("Synchronize with object layers");
def->category = L("Support material");
def->tooltip = L("Synchronize support layers with the object print layers. This is useful "
"with multi-material printers, where the extruder switch is expensive.");
"with multi-material printers, where the extruder switch is expensive. "
"This option is only available when top contact Z distance is set to zero.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(false));

View File

@ -2522,24 +2522,34 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
{
wxString header, caption = _L("Configuration is edited in ConfigWizard");
const auto enabled_vendors = appconfig_new.vendors();
const auto enabled_vendors_old = app_config->vendors();
bool suppress_sla_printer = model_has_multi_part_objects(wxGetApp().model());
PrinterTechnology preferred_pt = ptAny;
auto get_preferred_printer_technology = [enabled_vendors, suppress_sla_printer](const std::string& bundle_name, const Bundle& bundle) {
auto get_preferred_printer_technology = [enabled_vendors, enabled_vendors_old, suppress_sla_printer](const std::string& bundle_name, const Bundle& bundle) {
const auto config = enabled_vendors.find(bundle_name);
PrinterTechnology pt = ptAny;
if (config != enabled_vendors.end()) {
for (const auto& model : bundle.vendor_profile->models) {
if (const auto model_it = config->second.find(model.id);
model_it != config->second.end() && model_it->second.size() > 0) {
if (pt == ptAny)
pt = model.technology;
// if preferred printer model has SLA printer technology it's important to check the model for multypart state
const auto config_old = enabled_vendors_old.find(bundle_name);
if (config_old == enabled_vendors_old.end() || config_old->second.find(model.id) == config_old->second.end()) {
// if preferred printer model has SLA printer technology it's important to check the model for multi-part state
if (pt == ptSLA && suppress_sla_printer)
continue;
else
return pt;
}
if (const auto model_it_old = config_old->second.find(model.id);
model_it_old == config_old->second.end() || model_it_old->second != model_it->second) {
// if preferred printer model has SLA printer technology it's important to check the model for multi-part state
if (pt == ptSLA && suppress_sla_printer)
continue;
return pt;
}
}
}
}
return pt;
@ -2645,7 +2655,6 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
std::string preferred_model;
std::string preferred_variant;
const auto enabled_vendors_old = app_config->vendors();
auto get_preferred_printer_model = [enabled_vendors, enabled_vendors_old, preferred_pt](const std::string& bundle_name, const Bundle& bundle, std::string& variant) {
const auto config = enabled_vendors.find(bundle_name);
if (config == enabled_vendors.end())

View File

@ -549,9 +549,13 @@ RENDER_AGAIN:
m_imgui->text(m_desc.at("offset"));
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
ImGui::PushItemWidth(window_width - settings_sliders_left);
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm", 1.0f, true, _L(opts[0].second->tooltip));
#else
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm");
if (m_imgui->get_last_slider_status().hovered)
m_imgui->tooltip((_utf8(opts[0].second->tooltip)).c_str(), max_tooltip_width);
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
bool slider_clicked = m_imgui->get_last_slider_status().clicked; // someone clicked the slider
bool slider_edited =m_imgui->get_last_slider_status().edited; // someone is dragging the slider
@ -561,9 +565,13 @@ RENDER_AGAIN:
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("quality"));
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f", 1.0f, true, _L(opts[1].second->tooltip));
#else
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f");
if (m_imgui->get_last_slider_status().hovered)
m_imgui->tooltip((_utf8(opts[1].second->tooltip)).c_str(), max_tooltip_width);
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
slider_clicked |= m_imgui->get_last_slider_status().clicked;
slider_edited |= m_imgui->get_last_slider_status().edited;
@ -574,9 +582,13 @@ RENDER_AGAIN:
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("closing_distance"));
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm", 1.0f, true, _L(opts[2].second->tooltip));
#else
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm");
if (m_imgui->get_last_slider_status().hovered)
m_imgui->tooltip((_utf8(opts[2].second->tooltip)).c_str(), max_tooltip_width);
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
slider_clicked |= m_imgui->get_last_slider_status().clicked;
slider_edited |= m_imgui->get_last_slider_status().edited;