This commit is contained in:
sunsets
2023-07-17 19:01:45 +08:00
10 changed files with 5 additions and 424 deletions

View File

@@ -309,46 +309,4 @@ std::string PresetHints::top_bottom_shell_thickness_explanation(const PresetBund
return out;
}
//Y7
std::string PresetHints::drying_box_description(const Preset &preset)
{
std::string out;
std::string filament_type = preset.config.opt_string("filament_type", 0);
if (preset.config.option("filament_property_drying_box")->is_nil()) {
out += GUI::format(_L("%1% is no need to put the filament in the drying box when printing."), filament_type);
}
else {
int filament_property_drying_box = preset.config.option<ConfigOptionIntsNullable>("filament_property_drying_box")->get_at(0);
out += GUI::format(_L("%1% will not print properly if it is damp.\n"
"Please put the filament in the drying box when printing, "
"and keep the humidity in the drying box less than %2%."),
filament_type, filament_property_drying_box);
}
return out;
}
std::string PresetHints::anneal_temperature_description(const Preset &preset)
{
std::string out;
std::string filament_type = preset.config.opt_string("filament_type", 0);
if (preset.config.option("filament_property_anneal_temperature")->is_nil()) {
out += GUI::format(_L("%1% cannot be annealed."), filament_type);
}
else {
int filament_property_anneal_temperature = preset.config.option<ConfigOptionIntsNullable>("filament_property_anneal_temperature")->get_at(0);
int filament_property_anneal_temperature_max = filament_property_anneal_temperature + 20;
out += GUI::format(_L("Annealing the model immediately after printing can further improve the physical properties of %1%.\n"
"Put the model in a drying oven and set it at %2%-%3% °C for 4-6 hours."),
filament_type, filament_property_anneal_temperature, filament_property_anneal_temperature_max);
}
return out;
}
//Y7
}; // namespace Slic3r

View File

@@ -28,9 +28,6 @@ public:
// versus top/bottom_min_shell_thickness. Which of the two values wins depends
// on the active layer height.
static std::string top_bottom_shell_thickness_explanation(const PresetBundle &preset_bundle);
//Y7
static std::string drying_box_description(const Preset &preset);
static std::string anneal_temperature_description(const Preset &preset);
};
} // namespace Slic3r

View File

@@ -2047,38 +2047,6 @@ void TabFilament::build()
line.append_option(optgroup->get_option("volume_temperature"));
optgroup->append_line(line);
//Y7
optgroup = page->new_optgroup(L("Drying box"));
create_line_with_near_label_widget(optgroup, "filament_property_drying_box");
line = { "", "" };
line.full_width = 1;
line.widget = [this](wxWindow* parent) {
return description_line_widget(parent, &m_drying_box_description_line);
};
optgroup->append_line(line);
optgroup = page->new_optgroup(L("Anneal"));
create_line_with_near_label_widget(optgroup, "filament_property_anneal_temperature");
line = { "", "" };
line.full_width = 1;
line.widget = [this](wxWindow* parent) {
return description_line_widget(parent, &m_anneal_temperature_description_line);
};
optgroup->append_line(line);
optgroup = page->new_optgroup(L("Property"));
optgroup->append_single_option_line("filament_property_water_resistance");
optgroup->append_single_option_line("filament_property_corrosion_resistance");
optgroup->append_single_option_line("filament_property_creep_resistance");
optgroup->append_single_option_line("filament_property_hdt_045");
optgroup->append_single_option_line("filament_property_hdt_180");
optgroup->append_single_option_line("filament_property_tensile_strength");
optgroup->append_single_option_line("filament_property_tensile_modulus");
optgroup->append_single_option_line("filament_property_elongation_at_break");
optgroup->append_single_option_line("filament_property_flexural_strength");
optgroup->append_single_option_line("filament_property_flexural_modulus");
optgroup->append_single_option_line("filament_property_notch_impact_strength");
page = add_options_page(L("Cooling"), "cooling");
std::string category_path = "cooling_127569#";
optgroup = page->new_optgroup(L("Enable"));
@@ -2250,15 +2218,6 @@ void TabFilament::update_description_lines()
m_cooling_description_line->SetText(from_u8(PresetHints::cooling_description(m_presets->get_edited_preset())));
if (m_active_page->title() == "Advanced" && m_volumetric_speed_description_line)
this->update_volumetric_flow_preset_hints();
//Y7
if (m_active_page->title() == "Filament"){
if (m_drying_box_description_line){
m_drying_box_description_line->SetText(from_u8(PresetHints::drying_box_description(m_presets->get_edited_preset())));
}
if (m_anneal_temperature_description_line){
m_anneal_temperature_description_line->SetText(from_u8(PresetHints::anneal_temperature_description(m_presets->get_edited_preset())));
}
}
}
void TabFilament::toggle_options()
@@ -2298,46 +2257,6 @@ void TabFilament::toggle_options()
bool pa = m_config->opt_bool("enable_advance_pressure", 0);
toggle_option("advance_pressure", pa);
toggle_option("smooth_time", pa);
//Y7
bool notQIDI = (m_config->opt_string("filament_vendor", true) != "QIDI");
if (notQIDI)
{
const auto og_it2 = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Drying box"; });
if (og_it2 != page->m_optgroups.end())
{
update_line_with_near_label_widget(*og_it2, "filament_property_drying_box");
}
const auto og_it3 = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Anneal"; });
if (og_it3 != page->m_optgroups.end())
{
update_line_with_near_label_widget(*og_it3, "filament_property_anneal_temperature");
}
}
else
{
if (m_overrides_options["filament_property_drying_box"])
{
m_overrides_options["filament_property_drying_box"]->Enable(notQIDI);
}
if (m_overrides_options["filament_property_anneal_temperature"])
{
m_overrides_options["filament_property_anneal_temperature"]->Enable(notQIDI);
}
toggle_option("filament_property_drying_box", notQIDI);
toggle_option("filament_property_anneal_temperature", notQIDI);
}
toggle_option("filament_property_water_resistance", notQIDI);
toggle_option("filament_property_corrosion_resistance", notQIDI);
toggle_option("filament_property_creep_resistance", notQIDI);
toggle_option("filament_property_hdt_045", notQIDI);
toggle_option("filament_property_hdt_180", notQIDI);
toggle_option("filament_property_tensile_strength", notQIDI);
toggle_option("filament_property_tensile_modulus", notQIDI);
toggle_option("filament_property_elongation_at_break", notQIDI);
toggle_option("filament_property_flexural_strength", notQIDI);
toggle_option("filament_property_flexural_modulus", notQIDI);
toggle_option("filament_property_notch_impact_strength", notQIDI);
}
}
@@ -2365,9 +2284,6 @@ void TabFilament::clear_pages()
m_volumetric_speed_description_line = nullptr;
m_cooling_description_line = nullptr;
//Y7
m_drying_box_description_line = nullptr;
m_anneal_temperature_description_line = nullptr;
}
void TabFilament::msw_rescale()

View File

@@ -442,9 +442,6 @@ class TabFilament : public Tab
int m_active_extruder {0};
ogStaticText* m_volumetric_speed_description_line {nullptr};
ogStaticText* m_cooling_description_line {nullptr};
//Y7
ogStaticText* m_drying_box_description_line {nullptr};
ogStaticText* m_anneal_temperature_description_line {nullptr};
void create_line_with_near_label_widget(ConfigOptionsGroupShp optgroup, const std::string &opt_key, int opt_index = 0);
void update_line_with_near_label_widget(ConfigOptionsGroupShp optgroup, const std::string &opt_key, int opt_index = 0, bool is_checked = true);