Fix Ironing/Support patterns (#10278)

NoisyGoat

Co-authored-by: Rodrigo <162915171+RF47@users.noreply.github.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
Ian Bassi
2025-08-01 23:59:01 -03:00
committed by GitHub
parent 468c8492b6
commit b16d3a2f4a
6 changed files with 42 additions and 18 deletions

View File

@@ -232,8 +232,8 @@ CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SlicingMode)
static t_config_enum_values s_keys_map_SupportMaterialPattern {
{ "rectilinear", smpRectilinear },
{ "rectilinear-grid", smpRectilinearGrid },
{ "lightning", smpLightning },
{ "honeycomb", smpHoneycomb },
{ "lightning", smpLightning },
{ "default", smpDefault},
{ "hollow", smpNone},
};
@@ -5091,14 +5091,14 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("default");
def->enum_values.push_back("rectilinear");
def->enum_values.push_back("rectilinear-grid");
def->enum_values.push_back("lightning");
def->enum_values.push_back("honeycomb");
def->enum_values.push_back("lightning");
def->enum_values.push_back("hollow");
def->enum_labels.push_back(L("Default"));
def->enum_labels.push_back(L("Rectilinear"));
def->enum_labels.push_back(L("Rectilinear grid"));
def->enum_labels.push_back(L("Lightning"));
def->enum_labels.push_back(L("Honeycomb"));
def->enum_labels.push_back(L("Lightning"));
def->enum_labels.push_back(L("Hollow"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<SupportMaterialPattern>(smpDefault));

View File

@@ -65,8 +65,9 @@ enum AuthorizationType {
};
enum InfillPattern : int {
ipMonotonic, ipMonotonicLine,
ipRectilinear, ipAlignedRectilinear, ipZigZag, ipCrossZag, ipLockedZag,
ipLine, ipGrid, ipMonotonic, ipMonotonicLine,
ipLine, ipGrid,
ipTriangles, ipStars,
ipCubic, ipAdaptiveCubic, ipQuarterCubic, ipSupportCubic, ipLightning,
ipHoneycomb, ip3DHoneycomb, ip2DHoneycomb, ip2DLattice,

View File

@@ -1549,7 +1549,11 @@ void Choice::set_value(const boost::any& value, bool change_event)
if (m_opt_id.compare("host_type") == 0 && val != 0 &&
m_opt.enum_values.size() > field->GetCount()) // for case, when PrusaLink isn't used as a HostType
val--;
if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" || m_opt_id == "support_style" || m_opt_id == "curr_bed_type")
if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" ||
m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" ||
m_opt_id == "support_base_pattern" || m_opt_id == "support_interface_pattern" ||
m_opt_id == "ironing_pattern" || m_opt_id == "support_ironing_pattern" ||
m_opt_id == "support_style" || m_opt_id == "curr_bed_type")
{
std::string key;
const t_config_enum_values& map_names = *m_opt.enum_keys_map;
@@ -1633,21 +1637,27 @@ boost::any& Choice::get_value()
// BBS
if (m_opt.type == coEnum || m_opt.type == coEnums)
{
{
if (m_opt.nullable && field->GetSelection() == -1)
m_value = ConfigOptionEnumsGenericNullable::nil_value();
else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" ||
m_opt_id == "support_style" || m_opt_id == "curr_bed_type") {
const std::string& key = m_opt.enum_values[field->GetSelection()];
m_value = int(m_opt.enum_keys_map->at(key));
}
else if ( m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" ||
m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" ||
m_opt_id == "support_base_pattern" || m_opt_id == "support_interface_pattern" ||
m_opt_id == "ironing_pattern" || m_opt_id == "support_ironing_pattern" ||
m_opt_id == "support_style" || m_opt_id == "curr_bed_type")
{
const std::string &key = m_opt.enum_values[field->GetSelection()];
m_value = int(m_opt.enum_keys_map->at(key));
}
// Support ThirdPartyPrinter
else if (m_opt_id.compare("host_type") == 0 && m_opt.enum_values.size() > field->GetCount()) {
else if (m_opt_id.compare("host_type") == 0 && m_opt.enum_values.size() > field->GetCount())
{
// for case, when PrusaLink isn't used as a HostType
m_value = field->GetSelection() + 1;
} else
m_value = field->GetSelection();
}
}
else
m_value = field->GetSelection();
}
else if (m_opt.gui_type == ConfigOptionDef::GUIType::f_enum_open || m_opt.gui_type == ConfigOptionDef::GUIType::i_enum_open) {
const int ret_enum = field->GetSelection();
if (m_list) {

View File

@@ -290,6 +290,10 @@ static void add_config_substitutions(const ConfigSubstitutions& conf_substitutio
bool is_infill = def->opt_key == "top_surface_pattern" ||
def->opt_key == "bottom_surface_pattern" ||
def->opt_key == "internal_solid_infill_pattern" ||
def->opt_key == "support_base_pattern" ||
def->opt_key == "support_interface_pattern" ||
def->opt_key == "ironing_pattern" ||
def->opt_key == "support_ironing_pattern" ||
def->opt_key == "sparse_infill_pattern";
// Each infill doesn't use all list of infill declared in PrintConfig.hpp.

View File

@@ -1321,15 +1321,24 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
opt_key == "top_surface_pattern" ||
opt_key == "bottom_surface_pattern" ||
opt_key == "internal_solid_infill_pattern" ||
opt_key == "sparse_infill_pattern");
opt_key == "sparse_infill_pattern" ||
opt_key == "ironing_pattern" ||
opt_key == "support_ironing_pattern" ||
opt_key == "support_pattern" ||
opt_key == "support_interface_pattern")
;
}
case coEnums: {
return get_string_from_enum(opt_key, config,
opt_key == "top_surface_pattern" ||
opt_key == "bottom_surface_pattern" ||
opt_key == "internal_solid_infill_pattern" ||
opt_key == "sparse_infill_pattern",
opt_idx);
opt_key == "sparse_infill_pattern" ||
opt_key == "ironing_pattern" ||
opt_key == "support_ironing_pattern" ||
opt_key == "support_pattern" ||
opt_key == "support_interface_pattern"
, opt_idx);
}
case coPoint: {
Vec2d val = config.opt<ConfigOptionPoint>(opt_key)->value;