H2D X2D Multi Nozzle Size Printing Support (#14125)

This commit is contained in:
LixNix
2026-10-08 20:28:32 +08:00
committed by GitHub
parent 776ca6a3e4
commit 7d44b60ae4
13 changed files with 63 additions and 44 deletions
+8 -2
View File
@@ -1012,7 +1012,10 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
float machine_diameter = obj->GetExtderSystem()->GetNozzleDiameter(0);
if (machine_diameter == 0.0f && preset_bundle) {
const ConfigOption *opt = preset_bundle->printers.get_selected_preset().config.option("nozzle_diameter");
if (opt) machine_diameter = static_cast<const ConfigOptionFloats *>(opt)->values[0];
if (opt) {
const auto &nd = static_cast<const ConfigOptionFloats *>(opt)->values;
if (!nd.empty()) machine_diameter = nd.size() > 1 ? nd[1] : nd[0];
}
}
stream << std::fixed << std::setprecision(1) << machine_diameter;
std::string nozzle_diameter_str = stream.str();
@@ -1291,7 +1294,10 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
float machine_diameter = obj->GetExtderSystem()->GetNozzleDiameter(0);
if (machine_diameter == 0.0f) {
const ConfigOption *opt = preset_bundle->printers.get_selected_preset().config.option("nozzle_diameter");
if (opt) machine_diameter = static_cast<const ConfigOptionFloats *>(opt)->values[0];
if (opt) {
const auto &nd = static_cast<const ConfigOptionFloats *>(opt)->values;
if (!nd.empty()) machine_diameter = nd.size() > 1 ? nd[1] : nd[0];
}
}
stream << std::fixed << std::setprecision(1) << machine_diameter;
}