mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
Add filament property
This commit is contained in:
@@ -511,7 +511,12 @@ static std::vector<std::string> s_Preset_filament_options {
|
||||
//B26
|
||||
"advance_pressure",
|
||||
//B26
|
||||
"smooth_time"
|
||||
"smooth_time",
|
||||
//Y7
|
||||
"filament_property_drying_box", "filament_property_anneal_temperature", "filament_property_water_resistance", "filament_property_corrosion_resistance",
|
||||
"filament_property_creep_resistance", "filament_property_hdt_045", "filament_property_hdt_180", "filament_property_tensile_strength",
|
||||
"filament_property_tensile_modulus", "filament_property_elongation_at_break", "filament_property_flexural_strength","filament_property_flexural_modulus",
|
||||
"filament_property_notch_impact_strength"
|
||||
};
|
||||
|
||||
static std::vector<std::string> s_Preset_machine_limits_options {
|
||||
|
||||
@@ -206,6 +206,14 @@ static const t_config_enum_values s_keys_map_GCodeThumbnailsFormat = {
|
||||
{ "QOI", int(GCodeThumbnailsFormat::QOI) }
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(GCodeThumbnailsFormat)
|
||||
//Y7
|
||||
static const t_config_enum_values s_keys_map_WaterResistance = {
|
||||
{ "none", int(WaterResistance::None) },
|
||||
{ "weak", int(WaterResistance::Weak) },
|
||||
{ "fine", int(WaterResistance::Fine) },
|
||||
{ "strong", int(WaterResistance::Strong) }
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(WaterResistance)
|
||||
|
||||
static const t_config_enum_values s_keys_map_ForwardCompatibilitySubstitutionRule = {
|
||||
{ "disable", ForwardCompatibilitySubstitutionRule::Disable },
|
||||
@@ -1373,6 +1381,121 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionInts { 0 });
|
||||
|
||||
////////////Y7
|
||||
def = this->add_nullable("filament_property_drying_box", coInts);
|
||||
def->label = L("Drying box");
|
||||
def->tooltip = L("The maximum humidity in the drying box. Please place the desiccant in the drying box so that the internal humidity is lower than this value.");
|
||||
def->sidetext = L("%");
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionIntsNullable { ConfigOptionIntsNullable::nil_value() });
|
||||
|
||||
def = this->add_nullable("filament_property_anneal_temperature", coInts);
|
||||
def->label = L("Anneal temperature");
|
||||
def->tooltip = L("Annealing temperature of the filament.Placing the model in a drying oven for 4-6 hours immediately after printing can improve its physical properties.");
|
||||
def->sidetext = L("°C");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionIntsNullable { ConfigOptionIntsNullable::nil_value() });
|
||||
|
||||
def = this->add("filament_property_water_resistance", coEnum);
|
||||
def->label = L("Water resistance");
|
||||
def->tooltip = L("Water resistance of the filament.");
|
||||
def->set_enum<WaterResistance>({
|
||||
{ "none", L("None") },
|
||||
{ "weak", L("Weak") },
|
||||
{ "fine", L("Fine") },
|
||||
{ "strong", L("Strong") }
|
||||
});
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<WaterResistance>(WaterResistance::None));
|
||||
|
||||
def = this->add("filament_property_corrosion_resistance", coEnum);
|
||||
def->label = L("Corrosion resistance");
|
||||
def->tooltip = L("Corrosion resistance of the filament.");
|
||||
def->set_enum<WaterResistance>({
|
||||
{ "none", L("None") },
|
||||
{ "weak", L("Weak") },
|
||||
{ "fine", L("Fine") },
|
||||
{ "strong", L("Strong") }
|
||||
});
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<WaterResistance>(WaterResistance::None));
|
||||
|
||||
def = this->add("filament_property_creep_resistance", coEnum);
|
||||
def->label = L("Creep resistance");
|
||||
def->tooltip = L("Creep resistance of the filament.");
|
||||
def->set_enum<WaterResistance>({
|
||||
{ "none", L("None") },
|
||||
{ "weak", L("Weak") },
|
||||
{ "fine", L("Fine") },
|
||||
{ "strong", L("Strong") }
|
||||
});
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<WaterResistance>(WaterResistance::None));
|
||||
|
||||
def = this->add("filament_property_hdt_045", coFloats);
|
||||
def->label = L("HDT(0.45MPa)");
|
||||
def->tooltip = L("Heat distortion temp(0.45MPa).");
|
||||
def->sidetext = L("°C");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloats { 0. });
|
||||
|
||||
def = this->add("filament_property_hdt_180", coFloats);
|
||||
def->label = L("HDT(1.80MPa)");
|
||||
def->tooltip = L("Heat distortion temp(1.80MPa).");
|
||||
def->sidetext = L("°C");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloats { 0. });
|
||||
|
||||
def = this->add("filament_property_tensile_strength", coStrings);
|
||||
def->label = L("Tensile strength");
|
||||
def->tooltip = L("Tensile strength of the filament.");
|
||||
def->sidetext = L("MPa");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
|
||||
def = this->add("filament_property_tensile_modulus", coStrings);
|
||||
def->label = L("Tensile modulus");
|
||||
def->tooltip = L("Tensile modulus of the filament.");
|
||||
def->sidetext = L("MPa");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
|
||||
def = this->add("filament_property_elongation_at_break", coStrings);
|
||||
def->label = L("Elongation at break");
|
||||
def->tooltip = L("Elongation at break of the filament.");
|
||||
def->sidetext = L("%");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
|
||||
def = this->add("filament_property_flexural_strength", coStrings);
|
||||
def->label = L("Flexural strength");
|
||||
def->tooltip = L("Flexural strength of the filament.");
|
||||
def->sidetext = L("MPa");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
|
||||
def = this->add("filament_property_flexural_modulus", coStrings);
|
||||
def->label = L("Flexural modulus");
|
||||
def->tooltip = L("Flexural modulus of the filament.");
|
||||
def->sidetext = L("MPa");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
|
||||
def = this->add("filament_property_notch_impact_strength", coStrings);
|
||||
def->label = L("Notch impact strength");
|
||||
def->tooltip = L("Notch impact strength of the filament.");
|
||||
def->sidetext = L("MPa");
|
||||
def->width = 15;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings { "" });
|
||||
////////////Y7
|
||||
def = this->add("fuzzy_skin", coEnum);
|
||||
def->label = L("Fuzzy Skin");
|
||||
def->category = L("Fuzzy Skin");
|
||||
|
||||
@@ -135,7 +135,11 @@ enum class PerimeterGeneratorType
|
||||
};
|
||||
//B3
|
||||
enum class GCodeThumbnailsFormat {
|
||||
QIDI,PNG, JPG, QOI
|
||||
QIDI, PNG, JPG, QOI
|
||||
};
|
||||
//Y7
|
||||
enum class WaterResistance {
|
||||
None, Weak, Fine, Strong
|
||||
};
|
||||
|
||||
#define CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NAME) \
|
||||
@@ -163,6 +167,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(DraftShield)
|
||||
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(GCodeThumbnailsFormat)
|
||||
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(ForwardCompatibilitySubstitutionRule)
|
||||
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(PerimeterGeneratorType)
|
||||
//Y7
|
||||
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(WaterResistance)
|
||||
|
||||
|
||||
#undef CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS
|
||||
@@ -789,6 +795,21 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionFloatOrPercent, first_layer_height))
|
||||
((ConfigOptionFloatOrPercent, first_layer_speed))
|
||||
((ConfigOptionInts, first_layer_temperature))
|
||||
//Y7
|
||||
((ConfigOptionIntsNullable, filament_property_drying_box))
|
||||
((ConfigOptionIntsNullable, filament_property_anneal_temperature))
|
||||
((ConfigOptionEnum<WaterResistance>, filament_property_water_resistance))
|
||||
((ConfigOptionEnum<WaterResistance>, filament_property_corrosion_resistance))
|
||||
((ConfigOptionEnum<WaterResistance>, filament_property_creep_resistance))
|
||||
((ConfigOptionFloats, filament_property_hdt_045))
|
||||
((ConfigOptionFloats, filament_property_hdt_180))
|
||||
((ConfigOptionStrings, filament_property_tensile_strength))
|
||||
((ConfigOptionStrings, filament_property_tensile_modulus))
|
||||
((ConfigOptionStrings, filament_property_elongation_at_break))
|
||||
((ConfigOptionStrings, filament_property_flexural_strength))
|
||||
((ConfigOptionStrings, filament_property_flexural_modulus))
|
||||
((ConfigOptionStrings, filament_property_notch_impact_strength))
|
||||
|
||||
((ConfigOptionIntsNullable, idle_temperature))
|
||||
//B26
|
||||
((ConfigOptionBools, enable_advance_pressure))
|
||||
|
||||
@@ -309,5 +309,46 @@ 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 mechanical 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
|
||||
|
||||
@@ -28,6 +28,9 @@ 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
|
||||
|
||||
@@ -2040,6 +2040,38 @@ 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"));
|
||||
@@ -2211,6 +2243,15 @@ 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()
|
||||
@@ -2247,11 +2288,20 @@ void TabFilament::toggle_options()
|
||||
update_line_with_near_label_widget(*og_it, "idle_temperature");
|
||||
}
|
||||
//B26
|
||||
if (m_active_page->title() == "Filament") {
|
||||
bool pa = m_config->opt_bool("enable_advance_pressure", 0);
|
||||
toggle_option("advance_pressure", pa);
|
||||
toggle_option("smooth_time", pa);
|
||||
}
|
||||
bool pa = m_config->opt_bool("enable_advance_pressure", 0);
|
||||
toggle_option("advance_pressure", pa);
|
||||
toggle_option("smooth_time", pa);
|
||||
//Y7
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2278,7 +2328,10 @@ void TabFilament::clear_pages()
|
||||
Tab::clear_pages();
|
||||
|
||||
m_volumetric_speed_description_line = nullptr;
|
||||
m_cooling_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()
|
||||
|
||||
@@ -441,6 +441,9 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user