ENH: add default params for long retraction
1. Only auto calculate flush when enabled 2. Add default params for long retraction 3. Disable filament override for unsupport machines jira:NEW Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ib5d51505b58101839527e944f9a237483951f9fe
This commit is contained in:
parent
081ac40f38
commit
7116c5a7c5
|
@ -8,6 +8,12 @@
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"1"
|
"1"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"compatible_printers": [
|
"compatible_printers": [
|
||||||
"Bambu Lab X1 Carbon 0.2 nozzle",
|
"Bambu Lab X1 Carbon 0.2 nozzle",
|
||||||
"Bambu Lab X1 0.2 nozzle",
|
"Bambu Lab X1 0.2 nozzle",
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
"fan_min_speed": [
|
"fan_min_speed": [
|
||||||
"20"
|
"20"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"16"
|
"16"
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"13"
|
"13"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"compatible_printers": [
|
"compatible_printers": [
|
||||||
"Bambu Lab X1 Carbon 0.4 nozzle",
|
"Bambu Lab X1 Carbon 0.4 nozzle",
|
||||||
"Bambu Lab X1 0.4 nozzle",
|
"Bambu Lab X1 0.4 nozzle",
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"21"
|
"21"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"slow_down_layer_time": [
|
"slow_down_layer_time": [
|
||||||
"8"
|
"8"
|
||||||
],
|
],
|
||||||
|
|
|
@ -5,6 +5,12 @@
|
||||||
"from": "system",
|
"from": "system",
|
||||||
"setting_id": "GFSA00_00",
|
"setting_id": "GFSA00_00",
|
||||||
"instantiation": "true",
|
"instantiation": "true",
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"2"
|
"2"
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"21"
|
"21"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"compatible_printers": [
|
"compatible_printers": [
|
||||||
"Bambu Lab X1 Carbon 0.8 nozzle",
|
"Bambu Lab X1 Carbon 0.8 nozzle",
|
||||||
"Bambu Lab P1S 0.8 nozzle",
|
"Bambu Lab P1S 0.8 nozzle",
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
"filament_max_volumetric_speed": [
|
"filament_max_volumetric_speed": [
|
||||||
"21"
|
"21"
|
||||||
],
|
],
|
||||||
|
"filament_long_retractions_when_cut": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"filament_retraction_distances_when_cut": [
|
||||||
|
"18"
|
||||||
|
],
|
||||||
"compatible_printers": [
|
"compatible_printers": [
|
||||||
"Bambu Lab X1 Carbon 0.4 nozzle",
|
"Bambu Lab X1 Carbon 0.4 nozzle",
|
||||||
"Bambu Lab X1 Carbon 0.6 nozzle",
|
"Bambu Lab X1 Carbon 0.6 nozzle",
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -247,6 +247,10 @@ void AppConfig::set_defaults()
|
||||||
set_bool("auto_calculate", true);
|
set_bool("auto_calculate", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get("auto_calculate_when_filament_change").empty()){
|
||||||
|
set_bool("auto_calculate_when_filament_change", true);
|
||||||
|
}
|
||||||
|
|
||||||
if (get("show_home_page").empty()) {
|
if (get("show_home_page").empty()) {
|
||||||
set_bool("show_home_page", true);
|
set_bool("show_home_page", true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,12 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
||||||
"activate_air_filtration",
|
"activate_air_filtration",
|
||||||
"during_print_exhaust_fan_speed",
|
"during_print_exhaust_fan_speed",
|
||||||
"complete_print_exhaust_fan_speed",
|
"complete_print_exhaust_fan_speed",
|
||||||
"use_firmware_retraction"
|
"use_firmware_retraction",
|
||||||
|
"enable_long_retraction_when_cut",
|
||||||
|
"long_retractions_when_cut",
|
||||||
|
"retraction_distances_when_cut",
|
||||||
|
"filament_long_retractions_when_cut",
|
||||||
|
"filament_retraction_distances_when_cut"
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::unordered_set<std::string> steps_ignore;
|
static std::unordered_set<std::string> steps_ignore;
|
||||||
|
|
|
@ -230,20 +230,22 @@ static t_config_option_keys print_config_diffs(
|
||||||
if (opt_new == nullptr)
|
if (opt_new == nullptr)
|
||||||
//FIXME This may happen when executing some test cases.
|
//FIXME This may happen when executing some test cases.
|
||||||
continue;
|
continue;
|
||||||
if ((opt_key == "long_retractions_when_cut" || opt_key == "retraction_distances_when_cut")
|
|
||||||
&& current_config.enable_long_retraction_when_cut.getInt() != 2)
|
|
||||||
continue; //BBS: hard code here, remove it later if the machine firwmare support
|
|
||||||
const ConfigOption *opt_new_filament = std::binary_search(extruder_retract_keys.begin(), extruder_retract_keys.end(), opt_key) ? new_full_config.option(filament_prefix + opt_key) : nullptr;
|
const ConfigOption *opt_new_filament = std::binary_search(extruder_retract_keys.begin(), extruder_retract_keys.end(), opt_key) ? new_full_config.option(filament_prefix + opt_key) : nullptr;
|
||||||
if (opt_new_filament != nullptr && ! opt_new_filament->is_nil()) {
|
if (opt_new_filament != nullptr && ! opt_new_filament->is_nil()) {
|
||||||
// An extruder retract override is available at some of the filament presets.
|
// An extruder retract override is available at some of the filament presets.
|
||||||
bool overriden = opt_new->overriden_by(opt_new_filament);
|
bool overriden = opt_new->overriden_by(opt_new_filament);
|
||||||
if (overriden || *opt_old != *opt_new) {
|
if (overriden || *opt_old != *opt_new) {
|
||||||
auto opt_copy = opt_new->clone();
|
auto opt_copy = opt_new->clone();
|
||||||
|
if (!((opt_key == "long_retractions_when_cut" || opt_key == "retraction_distances_when_cut")
|
||||||
|
&& new_full_config.option<ConfigOptionInt>("enable_long_retraction_when_cut")->value != LongRectrationLevel::EnableFilament)) // ugly code, remove it later if firmware supports
|
||||||
opt_copy->apply_override(opt_new_filament);
|
opt_copy->apply_override(opt_new_filament);
|
||||||
bool changed = *opt_old != *opt_copy;
|
bool changed = *opt_old != *opt_copy;
|
||||||
if (changed)
|
if (changed)
|
||||||
print_diff.emplace_back(opt_key);
|
print_diff.emplace_back(opt_key);
|
||||||
if (changed || overriden) {
|
if (changed || overriden) {
|
||||||
|
if ((opt_key == "long_retractions_when_cut" || opt_key == "retraction_distances_when_cut")
|
||||||
|
&& new_full_config.option<ConfigOptionInt>("enable_long_retraction_when_cut")->value != LongRectrationLevel::EnableFilament)
|
||||||
|
continue;
|
||||||
// filament_overrides will be applied to the placeholder parser, which layers these parameters over full_print_config.
|
// filament_overrides will be applied to the placeholder parser, which layers these parameters over full_print_config.
|
||||||
filament_overrides.set_key_value(opt_key, opt_copy);
|
filament_overrides.set_key_value(opt_key, opt_copy);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -112,6 +112,13 @@ enum SupportMaterialStyle {
|
||||||
smsDefault, smsGrid, smsSnug, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic
|
smsDefault, smsGrid, smsSnug, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum LongRectrationLevel
|
||||||
|
{
|
||||||
|
Disabled=0,
|
||||||
|
EnableMachine,
|
||||||
|
EnableFilament
|
||||||
|
};
|
||||||
|
|
||||||
enum SupportMaterialInterfacePattern {
|
enum SupportMaterialInterfacePattern {
|
||||||
smipAuto, smipRectilinear, smipConcentric, smipRectilinearInterlaced, smipGrid
|
smipAuto, smipRectilinear, smipConcentric, smipRectilinearInterlaced, smipGrid
|
||||||
};
|
};
|
||||||
|
|
|
@ -312,6 +312,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(m_opt_id == "filament_retraction_distances_when_cut" || opt_key_without_idx == "retraction_distances_when_cut"){
|
else if(m_opt_id == "filament_retraction_distances_when_cut" || opt_key_without_idx == "retraction_distances_when_cut"){
|
||||||
|
if (m_value.empty() || boost::any_cast<double>(m_value) != val) {
|
||||||
wxString msg_text = format_wxstr(_L("Value %s is out of range. The valid range is from %d to %d."), str, m_opt.min, m_opt.max);
|
wxString msg_text = format_wxstr(_L("Value %s is out of range. The valid range is from %d to %d."), str, m_opt.min, m_opt.max);
|
||||||
WarningDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxYES);
|
WarningDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxYES);
|
||||||
if (dialog.ShowModal()) {
|
if (dialog.ShowModal()) {
|
||||||
|
@ -324,6 +325,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||||
set_value(double_to_string(val), true);
|
set_value(double_to_string(val), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
show_error(m_parent, _L("Value is out of range."));
|
show_error(m_parent, _L("Value is out of range."));
|
||||||
if (m_opt.min > val) val = m_opt.min;
|
if (m_opt.min > val) val = m_opt.min;
|
||||||
|
|
|
@ -6352,10 +6352,12 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||||
|
|
||||||
view3D->deselect_all();
|
view3D->deselect_all();
|
||||||
}
|
}
|
||||||
|
#if 0 // do not toggle auto calc when change printer
|
||||||
// update flush matrix
|
// update flush matrix
|
||||||
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
|
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
|
||||||
for (size_t idx = 0; idx < filament_size; ++idx)
|
for (size_t idx = 0; idx < filament_size; ++idx)
|
||||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
|
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
@ -6364,6 +6366,10 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||||
// So, set the focus to the combobox explicitly
|
// So, set the focus to the combobox explicitly
|
||||||
combo->SetFocus();
|
combo->SetFocus();
|
||||||
#endif
|
#endif
|
||||||
|
if (preset_type == Preset::TYPE_FILAMENT && wxGetApp().app_config->get("auto_calculate_when_filament_change") == "true") {
|
||||||
|
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
|
||||||
|
}
|
||||||
|
|
||||||
// BBS: log modify of filament selection
|
// BBS: log modify of filament selection
|
||||||
Slic3r::put_other_changes();
|
Slic3r::put_other_changes();
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,6 @@ class Ams;
|
||||||
|
|
||||||
using ModelInstancePtrs = std::vector<ModelInstance*>;
|
using ModelInstancePtrs = std::vector<ModelInstance*>;
|
||||||
|
|
||||||
enum LongRectrationLevel
|
|
||||||
{
|
|
||||||
Disabled=0,
|
|
||||||
EnableMachine,
|
|
||||||
EnableFilament
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace UndoRedo {
|
namespace UndoRedo {
|
||||||
class Stack;
|
class Stack;
|
||||||
|
|
|
@ -877,6 +877,8 @@ PreferencesDialog::PreferencesDialog(wxWindow *parent, wxWindowID id, const wxSt
|
||||||
std::string value;
|
std::string value;
|
||||||
value = wxGetApp().app_config->get("auto_calculate");
|
value = wxGetApp().app_config->get("auto_calculate");
|
||||||
j["auto_flushing"] = value;
|
j["auto_flushing"] = value;
|
||||||
|
value = wxGetApp().app_config->get("auto_calculate_when_filament_change");
|
||||||
|
j["auto_calculate_when_filament_change"] = value;
|
||||||
agent->track_event("preferences_changed", j.dump());
|
agent->track_event("preferences_changed", j.dump());
|
||||||
}
|
}
|
||||||
} catch(...) {}
|
} catch(...) {}
|
||||||
|
@ -1035,6 +1037,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
"user_bed_type");
|
"user_bed_type");
|
||||||
//auto item_hints = create_item_checkbox(_L("Show \"Tip of the day\" notification after start"), page, _L("If enabled, useful hints are displayed at startup."), 50, "show_hints");
|
//auto item_hints = create_item_checkbox(_L("Show \"Tip of the day\" notification after start"), page, _L("If enabled, useful hints are displayed at startup."), 50, "show_hints");
|
||||||
auto item_calc_mode = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time when the color is changed."), page, _L("If enabled, auto-calculate every time when the color is changed."), 50, "auto_calculate");
|
auto item_calc_mode = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time when the color is changed."), page, _L("If enabled, auto-calculate every time when the color is changed."), 50, "auto_calculate");
|
||||||
|
auto item_calc_in_long_retract = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time when the filament is changed."), page, _L("If enabled, auto-calculate every time when filament is changed"), 50, "auto_calculate_when_filament_change");
|
||||||
auto title_presets = create_item_title(_L("Presets"), page, _L("Presets"));
|
auto title_presets = create_item_title(_L("Presets"), page, _L("Presets"));
|
||||||
auto item_user_sync = create_item_checkbox(_L("Auto sync user presets(Printer/Filament/Process)"), page, _L("User Sync"), 50, "sync_user_preset");
|
auto item_user_sync = create_item_checkbox(_L("Auto sync user presets(Printer/Filament/Process)"), page, _L("User Sync"), 50, "sync_user_preset");
|
||||||
auto item_system_sync = create_item_checkbox(_L("Update built-in Presets automatically."), page, _L("System Sync"), 50, "sync_system_preset");
|
auto item_system_sync = create_item_checkbox(_L("Update built-in Presets automatically."), page, _L("System Sync"), 50, "sync_system_preset");
|
||||||
|
@ -1101,6 +1104,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
sizer_page->Add(item_bed_type_follow_preset, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_bed_type_follow_preset, 0, wxTOP, FromDIP(3));
|
||||||
//sizer_page->Add(item_hints, 0, wxTOP, FromDIP(3));
|
//sizer_page->Add(item_hints, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(item_calc_mode, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_calc_mode, 0, wxTOP, FromDIP(3));
|
||||||
|
sizer_page->Add(item_calc_in_long_retract, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(title_presets, 0, wxTOP | wxEXPAND, FromDIP(20));
|
sizer_page->Add(title_presets, 0, wxTOP | wxEXPAND, FromDIP(20));
|
||||||
sizer_page->Add(item_user_sync, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_user_sync, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(item_system_sync, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_system_sync, 0, wxTOP, FromDIP(3));
|
||||||
|
|
|
@ -1560,14 +1560,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||||
"Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications."), "", wxICON_WARNING | wxOK);
|
"Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications."), "", wxICON_WARNING | wxOK);
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
}
|
}
|
||||||
update_flush_volume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_key_without_idx == "retraction_distances_when_cut")
|
|
||||||
update_flush_volume();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (opt_key == "filament_long_retractions_when_cut"){
|
if (opt_key == "filament_long_retractions_when_cut"){
|
||||||
unsigned char activate = boost::any_cast<unsigned char>(value);
|
unsigned char activate = boost::any_cast<unsigned char>(value);
|
||||||
if (activate == 1) {
|
if (activate == 1) {
|
||||||
|
@ -1576,12 +1570,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||||
"Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications.Please use with the latest printer firmware."), "", wxICON_WARNING | wxOK);
|
"Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications.Please use with the latest printer firmware."), "", wxICON_WARNING | wxOK);
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
}
|
}
|
||||||
update_flush_volume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_key == "filament_retraction_distances_when_cut")
|
|
||||||
update_flush_volume();
|
|
||||||
|
|
||||||
|
|
||||||
// BBS
|
// BBS
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -376,7 +376,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
|
||||||
auto message_sizer = new wxBoxSizer(wxVERTICAL);
|
auto message_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
tip_message_panel->SetSizer(message_sizer);
|
tip_message_panel->SetSizer(message_sizer);
|
||||||
{
|
{
|
||||||
wxString message = _L("Studio would re-calculate your flushing volumes everytime the filaments color changed. You could disable the auto-calculate in Bambu Studio > Preferences");
|
wxString message = _L("Studio would re-calculate your flushing volumes everytime the filaments color changed or filaments changed. You could disable the auto-calculate in Bambu Studio > Preferences");
|
||||||
m_tip_message_label = new Label(tip_message_panel, wxEmptyString);
|
m_tip_message_label = new Label(tip_message_panel, wxEmptyString);
|
||||||
wxClientDC dc(tip_message_panel);
|
wxClientDC dc(tip_message_panel);
|
||||||
wxString multiline_message;
|
wxString multiline_message;
|
||||||
|
@ -386,7 +386,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
|
||||||
message_sizer->Add(m_tip_message_label, 0, wxEXPAND | wxALL, TIP_MESSAGES_PADDING);
|
message_sizer->Add(m_tip_message_label, 0, wxEXPAND | wxALL, TIP_MESSAGES_PADDING);
|
||||||
}
|
}
|
||||||
m_sizer_advanced->Add(tip_message_panel, 0, wxEXPAND | wxRIGHT | wxLEFT, TABLE_BORDER);
|
m_sizer_advanced->Add(tip_message_panel, 0, wxEXPAND | wxRIGHT | wxLEFT, TABLE_BORDER);
|
||||||
bool is_show = wxGetApp().app_config->get("auto_calculate") == "true";
|
bool is_show = wxGetApp().app_config->get("auto_calculate") == "true" || wxGetApp().app_config->get("auto_calculate_when_filament_change") == "true";
|
||||||
tip_message_panel->Show(is_show);
|
tip_message_panel->Show(is_show);
|
||||||
m_sizer_advanced->AddSpacer(FromDIP(10));
|
m_sizer_advanced->AddSpacer(FromDIP(10));
|
||||||
auto calc_btn_sizer = create_calc_btn_sizer(m_page_advanced);
|
auto calc_btn_sizer = create_calc_btn_sizer(m_page_advanced);
|
||||||
|
|
Loading…
Reference in New Issue