mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-03 00:02:14 +00:00
Enable wipe with firmware retractions is set 100% before wipe. (#13812)
Enable wipe with firmware retractions
This commit is contained in:
@@ -5526,7 +5526,7 @@ void TabPrinter::toggle_options()
|
|||||||
// some options only apply when not using firmware retraction
|
// some options only apply when not using firmware retraction
|
||||||
vec.resize(0);
|
vec.resize(0);
|
||||||
vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe",
|
vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe",
|
||||||
"retract_length", "retract_restart_extra", "wipe",
|
"retract_length", "retract_restart_extra",
|
||||||
"wipe_distance"};
|
"wipe_distance"};
|
||||||
for (auto el : vec)
|
for (auto el : vec)
|
||||||
//BBS
|
//BBS
|
||||||
@@ -5534,20 +5534,25 @@ void TabPrinter::toggle_options()
|
|||||||
|
|
||||||
bool wipe = retraction && m_config->opt_bool("wipe", variant_index);
|
bool wipe = retraction && m_config->opt_bool("wipe", variant_index);
|
||||||
toggle_option("retract_before_wipe", wipe, i);
|
toggle_option("retract_before_wipe", wipe, i);
|
||||||
|
float retract_before_wipe = static_cast<ConfigOptionPercents*>(m_config->option("retract_before_wipe"))->values[variant_index];
|
||||||
|
|
||||||
if (use_firmware_retraction && wipe) {
|
if (use_firmware_retraction && wipe && retract_before_wipe < 100.0) {
|
||||||
//wxMessageDialog dialog(parent(),
|
//wxMessageDialog dialog(parent(),
|
||||||
MessageDialog dialog(parent(),
|
MessageDialog dialog(parent(),
|
||||||
_(L("The Wipe option is not available when using the Firmware Retraction mode.\n"
|
_(L("The Retract before wipe option could be only 100% when using the Firmware Retraction mode.\n"
|
||||||
"\nShall I disable it in order to enable Firmware Retraction?")),
|
"\nShall I set it to 100% in order to enable Firmware Retraction?")),
|
||||||
_(L("Firmware Retraction")), wxICON_WARNING | wxYES | wxNO);
|
_(L("Firmware Retraction")), wxICON_WARNING | wxYES | wxNO);
|
||||||
|
|
||||||
DynamicPrintConfig new_conf = *m_config;
|
DynamicPrintConfig new_conf = *m_config;
|
||||||
if (dialog.ShowModal() == wxID_YES) {
|
if (dialog.ShowModal() == wxID_YES) {
|
||||||
auto wipe = static_cast<ConfigOptionBools*>(m_config->option("wipe")->clone());
|
auto wipe = static_cast<ConfigOptionBools*>(m_config->option("wipe")->clone());
|
||||||
for (size_t w = 0; w < wipe->values.size(); w++)
|
auto retract_before_wipe = static_cast<ConfigOptionPercents*>(m_config->option("retract_before_wipe")->clone());
|
||||||
|
for (size_t w = 0; w < wipe->values.size(); w++) {
|
||||||
wipe->values[w] = false;
|
wipe->values[w] = false;
|
||||||
|
retract_before_wipe->values[w] = 100.0;
|
||||||
|
}
|
||||||
new_conf.set_key_value("wipe", wipe);
|
new_conf.set_key_value("wipe", wipe);
|
||||||
|
new_conf.set_key_value("retract_before_wipe", retract_before_wipe);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new_conf.set_key_value("use_firmware_retraction", new ConfigOptionBool(false));
|
new_conf.set_key_value("use_firmware_retraction", new ConfigOptionBool(false));
|
||||||
|
|||||||
Reference in New Issue
Block a user