mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
Add filament option ——Seal
This commit is contained in:
@@ -799,8 +799,12 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
auto change_extruder_set_fan = [this, layer_id, layer_time, &new_gcode, &bridge_fan_control, &bridge_fan_speed]() {
|
||||
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder)
|
||||
int min_fan_speed = EXTRUDER_CONFIG(min_fan_speed);
|
||||
//B15
|
||||
int enable_auxiliary_fan = EXTRUDER_CONFIG(enable_auxiliary_fan);
|
||||
//B15//Y26
|
||||
int enable_auxiliary_fan;
|
||||
if (m_config.opt_bool("seal_print"))
|
||||
enable_auxiliary_fan = EXTRUDER_CONFIG(enable_auxiliary_fan);
|
||||
else
|
||||
enable_auxiliary_fan = EXTRUDER_CONFIG(enable_auxiliary_fan_unseal);
|
||||
//B25
|
||||
int enable_volume_fan = EXTRUDER_CONFIG(enable_volume_fan);
|
||||
int fan_speed_new = EXTRUDER_CONFIG(fan_always_on) ? min_fan_speed : 0;
|
||||
|
||||
@@ -518,6 +518,8 @@ static std::vector<std::string> s_Preset_filament_options {
|
||||
"filament_vendor", "compatible_prints", "compatible_prints_condition", "compatible_printers", "compatible_printers_condition", "inherits",
|
||||
//B15
|
||||
"enable_auxiliary_fan",
|
||||
//Y26
|
||||
"enable_auxiliary_fan_unseal",
|
||||
//B24
|
||||
"volume_temperature",
|
||||
//B25
|
||||
@@ -532,6 +534,8 @@ static std::vector<std::string> s_Preset_filament_options {
|
||||
"disable_rapid_cooling_fan_first_layers",
|
||||
//Y23
|
||||
"filament_shrink",
|
||||
//Y26
|
||||
"seal_print",
|
||||
//w15
|
||||
"filament_wipe_distance"
|
||||
};
|
||||
|
||||
@@ -529,6 +529,13 @@ void PrintConfigDef::init_fff_params()
|
||||
def->max = 65;
|
||||
def->set_default_value(new ConfigOptionInts { 0 });
|
||||
|
||||
//Y26
|
||||
def = this->add("seal_print", coBool);
|
||||
def->label = L("Seal");
|
||||
def->tooltip = L("Sealing box printing will be more stable and reliable, but the heat dissipation of the model will be poor. "
|
||||
"Determine whether to unpack and print according to the actual situation.");
|
||||
def->set_default_value(new ConfigOptionBool(true));
|
||||
|
||||
def = this->add("before_layer_gcode", coString);
|
||||
def->label = L("Before layer change G-code");
|
||||
def->tooltip = L("This custom code is inserted at every layer change, right before the Z move. "
|
||||
@@ -2199,15 +2206,24 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
//B15
|
||||
//B15//Y26
|
||||
def = this->add("enable_auxiliary_fan", coInts);
|
||||
def->label = L("Rapid Cooling Fan Speed");
|
||||
def->tooltip = L("This setting represents the PWM your rapid cooling fan needs to work.");
|
||||
def->label = L("Seal");
|
||||
def->tooltip = L("This setting represents the PWM your rapid cooling fan needs to work when the printing is sealing.");
|
||||
def->sidetext = L("%");
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionInts { 35 });
|
||||
def->set_default_value(new ConfigOptionInts { 100 });
|
||||
|
||||
def = this->add("enable_auxiliary_fan_unseal", coInts);
|
||||
def->label = L("Unseal");
|
||||
def->tooltip = L("This setting represents the PWM your rapid cooling fan needs to work when the printing is unsealing.");
|
||||
def->sidetext = L("%");
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionInts { 0 });
|
||||
|
||||
//B25
|
||||
def = this->add("enable_volume_fan", coInts);
|
||||
|
||||
@@ -837,6 +837,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionBool, chamber_temperature))
|
||||
//B24
|
||||
((ConfigOptionInts, volume_temperature))
|
||||
//Y26
|
||||
((ConfigOptionBool, seal_print))
|
||||
((ConfigOptionFloat, bridge_acceleration))
|
||||
((ConfigOptionInts, bridge_fan_speed))
|
||||
((ConfigOptionBools, enable_dynamic_fan_speeds))
|
||||
@@ -854,6 +856,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionInts, enable_volume_fan))
|
||||
//B15
|
||||
((ConfigOptionInts, enable_auxiliary_fan))
|
||||
//Y26
|
||||
((ConfigOptionInts, enable_auxiliary_fan_unseal))
|
||||
((ConfigOptionFloat, default_acceleration))
|
||||
((ConfigOptionInts, disable_fan_first_layers))
|
||||
//B39
|
||||
|
||||
@@ -345,6 +345,8 @@ class FreqChangedParams : public OG_Settings
|
||||
wxButton* m_wiping_dialog_button{ nullptr };
|
||||
wxSizer* m_sizer {nullptr};
|
||||
|
||||
//Y26
|
||||
std::shared_ptr<ConfigOptionsGroup> m_og_filament;
|
||||
std::shared_ptr<ConfigOptionsGroup> m_og_sla;
|
||||
std::vector<ScalableButton*> m_empty_buttons;
|
||||
public:
|
||||
@@ -354,6 +356,8 @@ public:
|
||||
wxButton* get_wiping_dialog_button() { return m_wiping_dialog_button; }
|
||||
wxSizer* get_sizer() override;
|
||||
ConfigOptionsGroup* get_og(const bool is_fff);
|
||||
//Y26
|
||||
ConfigOptionsGroup* get_og_filament();
|
||||
void Show(const bool is_fff) override;
|
||||
|
||||
void msw_rescale();
|
||||
@@ -363,12 +367,16 @@ public:
|
||||
void FreqChangedParams::msw_rescale()
|
||||
{
|
||||
m_og->msw_rescale();
|
||||
//Y26
|
||||
m_og_filament->msw_rescale();
|
||||
m_og_sla->msw_rescale();
|
||||
}
|
||||
|
||||
void FreqChangedParams::sys_color_changed()
|
||||
{
|
||||
m_og->sys_color_changed();
|
||||
//Y26
|
||||
m_og_filament->sys_color_changed();
|
||||
m_og_sla->sys_color_changed();
|
||||
|
||||
for (auto btn: m_empty_buttons)
|
||||
@@ -624,8 +632,38 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
||||
choice = dynamic_cast<Choice*>(m_og_sla->get_field("pad"));
|
||||
choice->suppress_scroll();
|
||||
|
||||
//Y26
|
||||
m_og_filament = std::make_shared<ConfigOptionsGroup>(parent, "");
|
||||
DynamicPrintConfig* filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
|
||||
m_og_filament->set_config(filament_config);
|
||||
m_og_filament->hide_labels();
|
||||
|
||||
m_og_filament->m_on_change = [filament_config, this](t_config_option_key opt_key, boost::any value) {
|
||||
Tab* tab_filament = wxGetApp().get_tab(Preset::TYPE_FILAMENT);
|
||||
if (!tab_filament) return;
|
||||
|
||||
if (opt_key == "seal_print") {
|
||||
tab_filament->update_dirty();
|
||||
tab_filament->reload_config();
|
||||
tab_filament->update();
|
||||
}
|
||||
};
|
||||
|
||||
line = Line { "", "" };
|
||||
|
||||
option = m_og_filament->get_option("seal_print");
|
||||
option.opt.label = L("Seal");
|
||||
line.append_option(option);
|
||||
line.append_widget(empty_widget);
|
||||
|
||||
m_og_filament->append_line(line);
|
||||
m_og_filament->activate();
|
||||
|
||||
m_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_sizer->Add(m_og->sizer, 0, wxEXPAND);
|
||||
//Y26
|
||||
m_sizer->Add(m_og_filament->sizer, 0, wxEXPAND);
|
||||
m_sizer->Add(m_og_sla->sizer, 0, wxEXPAND);
|
||||
}
|
||||
|
||||
@@ -639,6 +677,8 @@ void FreqChangedParams::Show(const bool is_fff)
|
||||
{
|
||||
const bool is_wdb_shown = m_wiping_dialog_button->IsShown();
|
||||
m_og->Show(is_fff);
|
||||
//Y26
|
||||
m_og_filament->Show(is_fff);
|
||||
m_og_sla->Show(!is_fff);
|
||||
|
||||
// correct showing of the FreqChangedParams sizer when m_wiping_dialog_button is hidden
|
||||
@@ -651,6 +691,12 @@ ConfigOptionsGroup* FreqChangedParams::get_og(const bool is_fff)
|
||||
return is_fff ? m_og.get() : m_og_sla.get();
|
||||
}
|
||||
|
||||
//Y26
|
||||
ConfigOptionsGroup* FreqChangedParams::get_og_filament()
|
||||
{
|
||||
return m_og_filament.get();
|
||||
}
|
||||
|
||||
// Sidebar / private
|
||||
|
||||
enum class ActionButtonType : int {
|
||||
@@ -1328,6 +1374,12 @@ ConfigOptionsGroup* Sidebar::og_freq_chng_params(const bool is_fff)
|
||||
return p->frequently_changed_parameters->get_og(is_fff);
|
||||
}
|
||||
|
||||
//Y26
|
||||
ConfigOptionsGroup* Sidebar::og_filament_chng_params()
|
||||
{
|
||||
return p->frequently_changed_parameters->get_og_filament();
|
||||
}
|
||||
|
||||
wxButton* Sidebar::get_wiping_dialog_button()
|
||||
{
|
||||
return p->frequently_changed_parameters->get_wiping_dialog_button();
|
||||
@@ -5847,7 +5899,6 @@ void Plater::calib_pa_pattern(const double StartPA, double EndPA, double PAStep)
|
||||
}
|
||||
}
|
||||
}
|
||||
gcode << "\n";
|
||||
gcode << "\nM107\nM106 P2 S0\nM106 P3 S0\n";
|
||||
|
||||
auto pa_end_gcode = printer_config->opt_string("end_gcode");
|
||||
|
||||
@@ -102,6 +102,8 @@ public:
|
||||
wxPanel* presets_panel();
|
||||
|
||||
ConfigOptionsGroup* og_freq_chng_params(const bool is_fff);
|
||||
//Y26
|
||||
ConfigOptionsGroup* og_filament_chng_params();
|
||||
wxButton* get_wiping_dialog_button();
|
||||
void update_objects_list_extruder_column(size_t extruders_count);
|
||||
void show_info_sizer();
|
||||
|
||||
@@ -1121,6 +1121,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
og_freq_chng_params->set_value("brim", val);
|
||||
}
|
||||
|
||||
//Y26
|
||||
if (opt_key == "seal_print")
|
||||
{
|
||||
ConfigOptionsGroup* og_filament_chng_params = wxGetApp().sidebar().og_filament_chng_params();
|
||||
DynamicPrintConfig* filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
og_filament_chng_params->set_value("seal_print", filament_config->opt_bool("seal_print"));
|
||||
}
|
||||
|
||||
if (opt_key == "wipe_tower" || opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" )
|
||||
update_wiping_button_visibility();
|
||||
|
||||
@@ -1410,6 +1418,18 @@ void Tab::update_frequently_changed_parameters()
|
||||
}
|
||||
}
|
||||
|
||||
//Y26
|
||||
void Tab::update_frequently_filament_changed_parameters()
|
||||
{
|
||||
ConfigOptionsGroup* og_filament_chng_params = wxGetApp().sidebar().og_filament_chng_params();
|
||||
const bool is_fff = supports_printer_technology(ptFFF);
|
||||
|
||||
if (is_fff)
|
||||
{
|
||||
og_filament_chng_params->set_value("seal_print", m_config->opt_bool("seal_print"));
|
||||
}
|
||||
}
|
||||
|
||||
void TabPrint::build()
|
||||
{
|
||||
m_presets = &m_preset_bundle->prints;
|
||||
@@ -2230,6 +2250,8 @@ void TabFilament::build()
|
||||
line.append_option(optgroup->get_option("first_layer_bed_temperature"));
|
||||
line.append_option(optgroup->get_option("bed_temperature"));
|
||||
optgroup->append_line(line);
|
||||
//Y26
|
||||
optgroup->append_single_option_line("seal_print");
|
||||
//B24
|
||||
optgroup->append_single_option_line("volume_temperature");
|
||||
|
||||
@@ -2254,9 +2276,11 @@ void TabFilament::build()
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup->append_single_option_line("bridge_fan_speed", category_path + "fan-settings");
|
||||
//B15
|
||||
// optgroup->append_single_option_line("auxiliary_fan_speed", category_path + "fan-settings");
|
||||
optgroup->append_single_option_line("enable_auxiliary_fan", category_path + "fan-settings");
|
||||
//B15//Y26
|
||||
line = { L("Rapido Cooling Fan Speed"), "" };
|
||||
line.append_option(optgroup->get_option("enable_auxiliary_fan"));
|
||||
line.append_option(optgroup->get_option("enable_auxiliary_fan_unseal"));
|
||||
optgroup->append_line(line);
|
||||
//B25
|
||||
optgroup->append_single_option_line("enable_volume_fan", category_path + "fan-settings");
|
||||
optgroup->append_single_option_line("disable_fan_first_layers", category_path + "fan-settings");
|
||||
@@ -2441,14 +2465,23 @@ void TabFilament::toggle_options()
|
||||
bool dynamic_fan_speeds = m_config->opt_bool("enable_dynamic_fan_speeds", 0);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
toggle_option("overhang_fan_speed_"+std::to_string(i),dynamic_fan_speeds);
|
||||
//Y16
|
||||
//Y16//Y26
|
||||
bool auxiliary_fan = printer_config->opt_bool("auxiliary_fan");
|
||||
toggle_option("enable_auxiliary_fan", auxiliary_fan);
|
||||
bool seal_print = m_config->opt_bool("seal_print");
|
||||
toggle_option("enable_auxiliary_fan", auxiliary_fan && seal_print);
|
||||
toggle_option("enable_auxiliary_fan_unseal", auxiliary_fan && !seal_print);
|
||||
|
||||
bool chamber_fan = printer_config->opt_bool("chamber_fan");
|
||||
toggle_option("enable_volume_fan", chamber_fan);
|
||||
|
||||
int auxiliary_fan_speed = m_config->opt_int("enable_auxiliary_fan", 0);
|
||||
int auxiliary_fan_speed;
|
||||
if (seal_print && auxiliary_fan)
|
||||
auxiliary_fan_speed = m_config->opt_int("enable_auxiliary_fan", 0);
|
||||
else if (!seal_print && auxiliary_fan)
|
||||
auxiliary_fan_speed = m_config->opt_int("enable_auxiliary_fan_unseal", 0);
|
||||
else
|
||||
auxiliary_fan_speed = 0;
|
||||
|
||||
if (auxiliary_fan_speed == 0)
|
||||
toggle_option("disable_rapid_cooling_fan_first_layers", false);
|
||||
else
|
||||
@@ -2478,9 +2511,14 @@ void TabFilament::toggle_options()
|
||||
bool pa = m_config->opt_bool("enable_advance_pressure", 0);
|
||||
toggle_option("advance_pressure", pa);
|
||||
toggle_option("smooth_time", pa);
|
||||
//Y16
|
||||
bool chamber_temp = printer_config->opt_bool("chamber_temperature");
|
||||
//Y16//Y26
|
||||
bool chamber_temp = printer_config->opt_bool("chamber_temperature") && m_config->opt_bool("seal_print");
|
||||
toggle_option("volume_temperature", chamber_temp);
|
||||
if (!chamber_temp) {
|
||||
DynamicPrintConfig new_conf = *m_config;
|
||||
new_conf.set_key_value("volume_temperature", new ConfigOptionInts{0});
|
||||
load_config(new_conf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3802,6 +3840,9 @@ void Tab::load_current_preset()
|
||||
on_presets_changed();
|
||||
if (m_type == Preset::TYPE_SLA_PRINT || m_type == Preset::TYPE_PRINT)
|
||||
update_frequently_changed_parameters();
|
||||
//Y26
|
||||
else if (m_type == Preset::TYPE_FILAMENT)
|
||||
update_frequently_filament_changed_parameters();
|
||||
}
|
||||
|
||||
m_opt_status_value = (m_presets->get_selected_preset_parent() ? osSystemValue : 0) | osInitValue;
|
||||
|
||||
@@ -410,6 +410,8 @@ protected:
|
||||
void build_preset_description_line(ConfigOptionsGroup* optgroup);
|
||||
void update_preset_description_line();
|
||||
void update_frequently_changed_parameters();
|
||||
//Y26
|
||||
void update_frequently_filament_changed_parameters();
|
||||
void fill_icon_descriptions();
|
||||
void set_tooltips_text();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user