Merge branch 'main' into main

This commit is contained in:
Rodrigo Faselli authored and GitHub committed 2026-07-25 19:19:07 -03:00
commit fccd9d52ce
164 files changed
+22716 -9447

No files matched your search

+70 -19
View File
@@ -1847,9 +1847,9 @@ bool Sidebar::priv::is_fila_switch_ready()
void Sidebar::priv::show_fila_switch_msg(bool ready)
{
wxString msg = ready ? _L("Filament switcher detected. All AMS filaments are now available for both extruders. "
"The slicer will auto-assign for optimal printing. ") :
"The slicer will auto-assign for optimal printing.") :
_L("A filament switcher is detected but not calibrated and thus currently unavailable. "
"Please calibrate it on the printer and synchronize before use. ");
"Please calibrate it on the printer and synchronize before use.");
long style = ready ? (wxICON_INFORMATION | wxOK) : (wxICON_WARNING | wxOK);
// Orca: drop the vendor "Learn more" tracking link; there is no Orca help page for the switch yet.
@@ -12205,12 +12205,53 @@ bool Plater::priv::check_ams_status_impl(bool is_slice_all)
auto nozzle_volumes_values = preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values;
assert(obj->GetExtderSystem()->GetTotalExtderCount() == 2 && nozzle_volumes_values.size() == 2);
if (obj->GetExtderSystem()->GetTotalExtderCount() == 2 && nozzle_volumes_values.size() == 2) {
// Map device flow->volume via the table, not `flowtype - 1` (which mis-maps U_FLOW to nvtHybrid).
NozzleVolumeType right_nozzle_type = DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(0));
NozzleVolumeType left_nozzle_type = DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(1));
NozzleVolumeType preset_left_type = NozzleVolumeType(nozzle_volumes_values[0]);
NozzleVolumeType preset_right_type = NozzleVolumeType(nozzle_volumes_values[1]);
is_same_as_printer = (left_nozzle_type == preset_left_type && right_nozzle_type == preset_right_type);
// [Vortek] H2C: Use BBS-style NozzleGroupInfo comparison instead of direct nozzle type match.
// This correctly handles Hybrid presets (which expand into per-type counts) and detects
// never-synced state (nozzle_count==0) so the first sync dialog appears.
// After device sync, extruder_nozzle_stats matches printer → dialog suppressed.
// Reference to BBS: BambuStudio/src/slic3r/GUI/Plater.cpp is_extruder_stat_synced()
using namespace MultiNozzleUtils;
auto nozzle_diameter_values = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionFloatsNullable>("nozzle_diameter")->values;
// Build preset nozzle groups from extruder_nozzle_stats config
std::vector<std::vector<NozzleGroupInfo>> preset_nozzle_infos(nozzle_diameter_values.size());
for (size_t extruder_id = 0; extruder_id < nozzle_diameter_values.size(); ++extruder_id) {
NozzleVolumeType preset_volume_type = NozzleVolumeType(nozzle_volumes_values[extruder_id]);
std::string preset_diameter = format_diameter_to_str(nozzle_diameter_values[extruder_id]);
if (preset_volume_type == nvtHybrid) {
// Hybrid: expand into separate groups for each nozzle type from stats
int std_count = getExtruderNozzleCount(preset_bundle, extruder_id, nvtStandard);
int hf_count = getExtruderNozzleCount(preset_bundle, extruder_id, nvtHighFlow);
if (std_count > 0)
preset_nozzle_infos[extruder_id].emplace_back(preset_diameter, nvtStandard, extruder_id, std_count);
if (hf_count > 0)
preset_nozzle_infos[extruder_id].emplace_back(preset_diameter, nvtHighFlow, extruder_id, hf_count);
// If both are 0 → never synced → empty group → will mismatch
} else {
int count = getExtruderNozzleCount(preset_bundle, extruder_id, preset_volume_type);
preset_nozzle_infos[extruder_id].emplace_back(preset_diameter, preset_volume_type, extruder_id, count);
}
}
// Compare with printer nozzle groups
auto printer_groups = obj->GetNozzleSystem()->GetNozzleGroups();
for (const auto& preset_groups : preset_nozzle_infos) {
for (const auto& preset_group : preset_groups) {
if (preset_group.nozzle_count == 0) {
// Never synced: if printer has nozzles of this type → needs sync
if (std::find_if(printer_groups.begin(), printer_groups.end(),
[&preset_group](const NozzleGroupInfo& elem) { return preset_group.is_same_type(elem); })
!= printer_groups.end()) {
is_same_as_printer = false;
break;
}
} else if (std::find(printer_groups.begin(), printer_groups.end(), preset_group) == printer_groups.end()) {
is_same_as_printer = false;
break;
}
}
}
}
std::vector<std::map<int, int>> ams_count_info;
@@ -13730,7 +13771,7 @@ bool Plater::up_to_date(bool saved, bool backup)
!Slic3r::has_other_changes(backup));
}
void Plater::add_model(bool imperial_units, std::string fname)
bool Plater::add_model(bool imperial_units, std::string fname)
{
wxArrayString input_files;
@@ -13738,7 +13779,7 @@ void Plater::add_model(bool imperial_units, std::string fname)
if (fname.empty()) {
wxGetApp().import_model(this, input_files);
if (input_files.empty())
return;
return false;
for (const auto& file : input_files)
paths.emplace_back(into_path(file));
@@ -13782,7 +13823,8 @@ void Plater::add_model(bool imperial_units, std::string fname)
auto strategy = LoadStrategy::LoadModel;
if (imperial_units) strategy = strategy | LoadStrategy::ImperialUnits;
if (!load_files(paths, strategy, ask_multi).empty()) {
const bool loaded = !load_files(paths, strategy, ask_multi).empty();
if (loaded) {
if (get_project_name() == _L("Untitled") && paths.size() > 0) {
boost::filesystem::path full_path(paths[0].string());
@@ -13791,6 +13833,7 @@ void Plater::add_model(bool imperial_units, std::string fname)
wxGetApp().mainframe->update_title();
}
return loaded;
}
void Plater::calib_pa(const Calib_Params& params)
@@ -14077,7 +14120,8 @@ void Plater::cut_horizontal(size_t obj_idx, size_t instance_idx, double z, Model
}
void Plater::_calib_pa_tower(const Calib_Params& params) {
add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/tower_with_seam.drc");
if (!add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/tower_with_seam.drc"))
return;
auto& print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
@@ -14317,7 +14361,8 @@ void Plater::calib_temp(const Calib_Params& params) {
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
if (params.mode != CalibMode::Calib_Temp_Tower) return;
add_model(false, Slic3r::resources_dir() + "/calib/temperature_tower/temperature_tower.drc");
if (!add_model(false, Slic3r::resources_dir() + "/calib/temperature_tower/temperature_tower.drc"))
return;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto start_temp = lround(params.start);
@@ -14393,7 +14438,8 @@ void Plater::calib_max_vol_speed(const Calib_Params& params)
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
if (params.mode != CalibMode::Calib_Vol_speed_Tower)
return;
add_model(false, Slic3r::resources_dir() + "/calib/volumetric_speed/SpeedTestStructure.drc");
if (!add_model(false, Slic3r::resources_dir() + "/calib/volumetric_speed/SpeedTestStructure.drc"))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
@@ -14472,7 +14518,8 @@ void Plater::calib_retraction(const Calib_Params& params)
if (params.mode != CalibMode::Calib_Retraction_tower)
return;
add_model(false, Slic3r::resources_dir() + "/calib/retraction/retraction_tower.drc");
if (!add_model(false, Slic3r::resources_dir() + "/calib/retraction/retraction_tower.drc"))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
@@ -14531,7 +14578,8 @@ void Plater::calib_VFA(const Calib_Params& params)
if (params.mode != CalibMode::Calib_VFA_Tower)
return;
add_model(false, Slic3r::resources_dir() + "/calib/vfa/vfa.drc");
if (!add_model(false, Slic3r::resources_dir() + "/calib/vfa/vfa.drc"))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
@@ -14576,7 +14624,8 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
if (params.mode != CalibMode::Calib_Input_shaping_freq)
return;
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc"));
if (!add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc")))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
@@ -14641,7 +14690,8 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
if (params.mode != CalibMode::Calib_Input_shaping_damp)
return;
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc"));
if (!add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc")))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
@@ -14708,7 +14758,8 @@ void Plater::Calib_Cornering(const Calib_Params& params)
const std::string cornering_model_path = params.test_model == 0
? "/calib/input_shaping/ringing_tower.drc"
: (params.test_model == 1 ? "/calib/input_shaping/fast_tower_test.drc" : "/calib/cornering/SCV-V2.drc");
add_model(false, Slic3r::resources_dir() + cornering_model_path);
if (!add_model(false, Slic3r::resources_dir() + cornering_model_path))
return;
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;