mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-11 01:41:03 +00:00
Merge upstream/main into iXex PR branch (#13086)
Catches the iXex/IDEX parallel-printing branch up to upstream main (102 commits). Two content conflicts resolved: - src/libslic3r/Preset.cpp: s_Preset_printer_options — kept upstream's new "use_3mf" key and our iMEX printer-capability/mode keys. - tests/fff_print/test_gcodewriter.cpp: upstream revived the disabled suite (#14196), dropping the obsolete [.]-tagged lift() test and its config_lift_unlift.ini; kept their set_speed + z_hop tests and appended our 10 per-firmware set_pressure_advance/set_temperature scenarios. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1351,18 +1351,26 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
|
||||
// load_toolpaths(gcode_result, build_volume, exclude_bounding_box);
|
||||
|
||||
// ORCA: Only show filament/color print preview if more than one tool/extruder is actually used in the toolpaths.
|
||||
// Only reset back to Toolpaths (FeatureType) if we are currently in ColorPrint and this load is single-tool.
|
||||
if (m_viewer.get_used_extruders_count() > 1) {
|
||||
auto it = std::find(view_type_items.begin(), view_type_items.end(), libvgcode::EViewType::ColorPrint);
|
||||
if (it != view_type_items.end())
|
||||
m_view_type_sel = std::distance(view_type_items.begin(), it);
|
||||
set_view_type(libvgcode::EViewType::ColorPrint);
|
||||
} else if (get_view_type() == libvgcode::EViewType::ColorPrint) {
|
||||
auto it = std::find(view_type_items.begin(), view_type_items.end(), libvgcode::EViewType::FeatureType);
|
||||
if (it != view_type_items.end())
|
||||
m_view_type_sel = std::distance(view_type_items.begin(), it);
|
||||
set_view_type(libvgcode::EViewType::FeatureType);
|
||||
// ORCA: Apply smart default view type when extruder count changes.
|
||||
// Multi-color: ColorPrint (Filament), Single-color: FeatureType (Line Type).
|
||||
// User selections persist within same extruder count, defaults reapply on count change.
|
||||
int current_count = m_viewer.get_used_extruders_count();
|
||||
if (current_count > 1) {
|
||||
if (m_last_extruder_count_default_applied != 2) {
|
||||
auto it = std::find(view_type_items.begin(), view_type_items.end(), libvgcode::EViewType::ColorPrint);
|
||||
if (it != view_type_items.end())
|
||||
m_view_type_sel = std::distance(view_type_items.begin(), it);
|
||||
set_view_type(libvgcode::EViewType::ColorPrint);
|
||||
m_last_extruder_count_default_applied = 2;
|
||||
}
|
||||
} else {
|
||||
if (m_last_extruder_count_default_applied != 1) {
|
||||
auto it = std::find(view_type_items.begin(), view_type_items.end(), libvgcode::EViewType::FeatureType);
|
||||
if (it != view_type_items.end())
|
||||
m_view_type_sel = std::distance(view_type_items.begin(), it);
|
||||
set_view_type(libvgcode::EViewType::FeatureType);
|
||||
m_last_extruder_count_default_applied = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// BBS: data for rendering color arrangement recommendation
|
||||
@@ -1462,18 +1470,6 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
m_viewer.set_time_mode(libvgcode::convert(PrintEstimatedStatistics::ETimeMode::Normal));
|
||||
}
|
||||
|
||||
// set to color print by default if use multi extruders
|
||||
if (m_viewer.get_used_extruders_count() > 1) {
|
||||
for (int i = 0; i < view_type_items.size(); i++) {
|
||||
if (view_type_items[i] == libvgcode::EViewType::ColorPrint) {
|
||||
m_view_type_sel = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
set_view_type(libvgcode::EViewType::ColorPrint);
|
||||
}
|
||||
|
||||
bool only_gcode_3mf = false;
|
||||
PartPlate* current_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||
bool current_has_print_instances = current_plate->has_printable_instances();
|
||||
@@ -2973,8 +2969,14 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
|
||||
{
|
||||
auto plate_print_statistics = plate->get_slice_result()->print_statistics;
|
||||
auto plate_extruders = plate->get_extruders(true);
|
||||
auto max_extruders_colors = wxGetApp().plater()->get_extruders_colors().size();
|
||||
for (size_t extruder_id : plate_extruders) {
|
||||
extruder_id -= 1;
|
||||
// Skip stale/overflow extruder indices (e.g. from object assignments that outlived a
|
||||
// filament-count change) so downstream per-extruder lookups stay in range. Ported
|
||||
// from BambuStudio (STUDIO-15763).
|
||||
if (extruder_id >= max_extruders_colors)
|
||||
continue;
|
||||
if (plate_print_statistics.model_volumes_per_extruder.find(extruder_id) == plate_print_statistics.model_volumes_per_extruder.end())
|
||||
model_volume_of_extruders_all_plates[extruder_id] += 0;
|
||||
else {
|
||||
@@ -3127,7 +3129,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
|
||||
ImGui::Dummy(ImVec2(0.0f, ImGui::GetFontSize() * 0.1));
|
||||
ImGui::Dummy({ window_padding, window_padding });
|
||||
ImGui::SameLine();
|
||||
imgui.title(_u8L("Total Estimation"));
|
||||
imgui.title(_u8L("Total estimation"));
|
||||
|
||||
ImGui::Dummy({ window_padding, window_padding });
|
||||
ImGui::SameLine();
|
||||
@@ -4014,8 +4016,8 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
append_headers({{_u8L("Line Type"), offsets[0]}, {_u8L("Time"), offsets[1]}, {"%", offsets[2]}, {_u8L("Usage"), offsets[3]}, {_u8L("Display"), offsets[5]}});
|
||||
break;
|
||||
}
|
||||
case libvgcode::EViewType::Height: { imgui.title(_u8L("Layer Height (mm)")); break; }
|
||||
case libvgcode::EViewType::Width: { imgui.title(_u8L("Line Width (mm)")); break; }
|
||||
case libvgcode::EViewType::Height: { imgui.title(_u8L("Layer height (mm)")); break; }
|
||||
case libvgcode::EViewType::Width: { imgui.title(_u8L("Line width (mm)")); break; }
|
||||
case libvgcode::EViewType::Speed:
|
||||
{
|
||||
imgui.title(_u8L("Speed (mm/s)"));
|
||||
@@ -4036,7 +4038,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
imgui.title(_u8L("Jerk (mm/s)"));
|
||||
break;
|
||||
}
|
||||
case libvgcode::EViewType::FanSpeed: { imgui.title(_u8L("Fan Speed (%)")); break; }
|
||||
case libvgcode::EViewType::FanSpeed: { imgui.title(_u8L("Fan speed (%)")); break; }
|
||||
case libvgcode::EViewType::Temperature: { imgui.title(_u8L("Temperature (°C)")); break; }
|
||||
// ORCA: Add Pressure Advance visualization support
|
||||
case libvgcode::EViewType::PressureAdvance:{ imgui.title(_u8L("Pressure Advance")); break; }
|
||||
@@ -4184,7 +4186,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
}
|
||||
else if (type == libvgcode::EOptionType::ToolChanges) {
|
||||
const auto option_values = option_stats(type);
|
||||
append_option_item_with_type(type, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::ToolChanges)), _u8L("Filament Changes"), visible,
|
||||
append_option_item_with_type(type, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::ToolChanges)), _u8L("Filament changes"), visible,
|
||||
option_values[0], option_values[1], option_values[2], option_values[3]);
|
||||
}
|
||||
else if (type == libvgcode::EOptionType::Wipes) {
|
||||
@@ -4881,7 +4883,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
|
||||
// total estimated printing time section
|
||||
ImGui::Spacing();
|
||||
std::string time_title = m_viewer.get_view_type() == libvgcode::EViewType::FeatureType ? _u8L("Total Estimation") : _u8L("Time Estimation");
|
||||
std::string time_title = m_viewer.get_view_type() == libvgcode::EViewType::FeatureType ? _u8L("Total estimation") : _u8L("Time Estimation");
|
||||
auto can_show_mode_button = [this](libvgcode::ETimeMode mode) {
|
||||
std::vector<std::string> time_strs;
|
||||
for (size_t i = 0; i < m_print_statistics.modes.size(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user