ENH:remove restrictions on mixed use of high and low temp filaments

jira: STUDIO-10482
Change-Id: Ifdf6f11b45f2e6d138ea615a3ad1f23d40ad3fe9
(cherry picked from commit 0178e930809cabcdbc09ab305e70e4323598b343)
(cherry picked from commit 8f92391717e37dd0f51aa067ad626b83630a46b1)
This commit is contained in:
zhimin.zeng
2025-02-18 15:15:24 +08:00
committed by Noisyfox
parent ae7438f249
commit 27b16455b7
7 changed files with 64 additions and 4 deletions

View File

@@ -305,6 +305,10 @@ void AppConfig::set_defaults()
set_bool("remember_printer_config", true);
}
if (get("enable_high_low_temp_mixed_printing").empty()){
set_bool("enable_high_low_temp_mixed_printing", false);
}
if (get("auto_calculate_when_filament_change").empty()){
set_bool("auto_calculate_when_filament_change", true);
}

View File

@@ -1058,6 +1058,9 @@ int Print::get_compatible_filament_type(const std::set<int>& filament_types)
//BBS: this function is used to check whether multi filament can be printed
StringObjectException Print::check_multi_filament_valid(const Print& print)
{
if (!print.need_check_multi_filaments_compatibility())
return {std::string()};
auto print_config = print.config();
std::vector<unsigned int> extruders = print.extruders();
std::vector<std::string> filament_types;

View File

@@ -1059,6 +1059,9 @@ public:
BoundingBoxf get_wipe_tower_bbx() const { return m_wipe_tower_data.bbx; }
Vec2f get_rib_offset() const { return m_wipe_tower_data.rib_offset; }
void set_check_multi_filaments_compatibility(bool check) { m_need_check_multi_filaments_compatibility = check; }
bool need_check_multi_filaments_compatibility() const { return m_need_check_multi_filaments_compatibility; }
// scaled point
Vec2d translate_to_print_space(const Point &point) const;
static FilamentTempType get_filament_temp_type(const std::string& filament_type);
@@ -1151,6 +1154,8 @@ private:
//SoftFever: calibration
Calib_Params m_calib_params;
bool m_need_check_multi_filaments_compatibility{true};
// To allow GCode to set the Print's GCodeExport step status.
friend class GCode;
// Allow PrintObject to access m_mutex and m_cancel_callback.

View File

@@ -220,7 +220,13 @@ void MsgDialog::finalize()
// Text shown as HTML, so that mouse selection and Ctrl-V to copy will work.
static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxString msg, bool monospaced_font = false, bool is_marked_msg = false)
static void add_msg_content(wxWindow *parent,
wxBoxSizer *content_sizer,
wxString msg,
bool monospaced_font = false,
bool is_marked_msg = false,
const wxString &link_text = "",
std::function<void(const wxString &)> link_callback = nullptr)
{
wxHtmlWindow* html = new wxHtmlWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
html->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
@@ -302,9 +308,19 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin
if (monospaced_font)
// Code formatting will be preserved. This is useful for reporting errors from the placeholder parser.
msg_escaped = std::string("<pre><code>") + msg_escaped + "</code></pre>";
if (!link_text.IsEmpty() && link_callback) {
msg_escaped += "<span><a href=\"#\" style=\"color:rgb(8, 153, 46); text-decoration:underline;\">" + std::string(link_text.ToUTF8().data()) + "</a></span>";
}
html->SetPage("<html><body bgcolor=\"" + bgr_clr_str + "\"><font color=\"" + text_clr_str + "\">" + wxString::FromUTF8(msg_escaped.data()) + "</font></body></html>");
content_sizer->Add(html, 1, wxEXPAND|wxRIGHT, 8);
wxGetApp().UpdateDarkUIWin(html);
html->Bind(wxEVT_HTML_LINK_CLICKED, [=](wxHtmlLinkEvent& event) {
if (link_callback)
link_callback(event.GetLinkInfo().GetHref());
});
}
// ErrorDialog
@@ -344,10 +360,12 @@ MessageDialog::MessageDialog(wxWindow* parent,
const wxString& message,
const wxString& caption/* = wxEmptyString*/,
long style /* = wxOK*/,
const wxString &forward_str /* = wxEmptyString*/)
const wxString &forward_str /* = wxEmptyString*/,
const wxString &link_text /* = wxEmptyString*/,
std::function<void(const wxString &)> link_callback /* = nullptr*/)
: MsgDialog(parent, caption.IsEmpty() ? wxString::Format(_L("%s info"), SLIC3R_APP_FULL_NAME) : caption, wxEmptyString, style, wxBitmap(),forward_str)
{
add_msg_content(this, content_sizer, message);
add_msg_content(this, content_sizer, message, false, false, link_text, link_callback);
SetMaxSize(MSG_DLG_MAX_SIZE);
finalize();
}

View File

@@ -155,7 +155,13 @@ class MessageDialog : public MsgDialog
{
public:
// NOTE! Don't change a signature of contsrucor. It have to be tha same as for wxMessageDialog
MessageDialog(wxWindow *parent,const wxString& message, const wxString &caption = wxEmptyString, long style = wxOK,const wxString& forward_str = "");
MessageDialog(wxWindow *parent,
const wxString &message,
const wxString &caption = wxEmptyString,
long style = wxOK,
const wxString &forward_str = "",
const wxString &link_text = "",
std::function<void(const wxString &)> link_callback = nullptr);
MessageDialog(MessageDialog&&) = delete;
MessageDialog(const MessageDialog&) = delete;
MessageDialog &operator=(MessageDialog&&) = delete;

View File

@@ -6670,6 +6670,8 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
this->preview->update_gcode_result(partplate_list.get_current_slice_result());
}
background_process.fff_print()->set_check_multi_filaments_compatibility(wxGetApp().app_config->get("enable_high_low_temp_mixed_printing") == "false");
Print::ApplyStatus invalidated;
const auto& preset_bundle = wxGetApp().preset_bundle;
if (preset_bundle->get_printer_extruder_count() > 1) {
@@ -15894,6 +15896,7 @@ void Plater::validate_current_plate(bool& model_fits, bool& validate_error)
StringObjectException warning;
Polygons polygons;
std::vector<std::pair<Polygon, float>> height_polygons;
p->background_process.fff_print()->set_check_multi_filaments_compatibility(wxGetApp().app_config->get("enable_high_low_temp_mixed_printing") == "false");
StringObjectException err = p->background_process.validate(&warning, &polygons, &height_polygons);
// update string by type
post_process_string_object_exception(err);

View File

@@ -829,6 +829,25 @@ wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *pa
}
}
if (param == "enable_high_low_temp_mixed_printing") {
if (checkbox->GetValue()) {
MessageDialog msg_wingow(nullptr, _L("Printing with multiple filaments that have a large temperature difference can cause the extruder and nozzle to be blocked or dameged during printing.\nPlease enable with caution."),
_L("Warning"), wxICON_WARNING | wxYES | wxYES_DEFAULT | wxCANCEL | wxCENTRE, wxEmptyString,
_L("Click Wiki for help."), [](const wxString){
std::string language = wxGetApp().app_config->get("language");
wxString region = L"en";
if (language.find("zh") == 0) region = L"zh";
const wxString wiki_link = wxString::Format(L"https://wiki.bambulab.com/%s/filament-acc/filament/h2d-filament-config-limit", region);
wxGetApp().open_browser_with_warning_dialog(wiki_link);
});
if (msg_wingow.ShowModal() != wxID_YES) {
checkbox->SetValue(false);
app_config->set_bool(param, false);
app_config->save();
}
}
}
e.Skip();
});
@@ -1212,6 +1231,7 @@ wxWindow* PreferencesDialog::create_general_page()
auto item_remember_printer_config = create_item_checkbox(_L("Remember printer configuration"), page, _L("If enabled, Orca will remember and switch filament/process configuration for each printer automatically."), 50, "remember_printer_config");
auto item_step_mesh_setting = create_item_checkbox(_L("Show the step mesh parameter setting dialog."), page, _L("If enabled,a parameter settings dialog will appear during STEP file import."), 50, "enable_step_mesh_setting");
auto item_multi_machine = create_item_checkbox(_L("Multi-device Management (Take effect after restarting Orca Slicer)."), page, _L("With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices."), 50, "enable_multi_machine");
auto item_mix_print_high_low_temperature = create_item_checkbox(_L("Remove the restriction on high and low temperature mixed printing."), page, _L("With this option enabled, you can print materials with different chamber temperatures together."), 50, "enable_high_low_temp_mixed_printing");
auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), page, _L("Auto arrange plate after object cloning"), 50, "auto_arrange");
auto title_presets = create_item_title(_L("Presets"), page, _L("Presets"));
auto title_network = create_item_title(_L("Network"), page, _L("Network"));
@@ -1304,6 +1324,7 @@ wxWindow* PreferencesDialog::create_general_page()
sizer_page->Add(item_multi_machine, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_step_mesh_setting, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_auto_arrange, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_mix_print_high_low_temperature, 0, wxTOP, FromDIP(3));
sizer_page->Add(title_presets, 0, wxTOP | wxEXPAND, FromDIP(20));
sizer_page->Add(item_calc_mode, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_user_sync, 0, wxTOP, FromDIP(3));