mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 00:01:09 +00:00
Merge branch 'main' into belt/baseChanges
This commit is contained in:
@@ -1345,18 +1345,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
|
||||
@@ -1456,18 +1464,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();
|
||||
@@ -2807,7 +2803,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();
|
||||
@@ -3693,8 +3689,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)"));
|
||||
@@ -3715,7 +3711,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; }
|
||||
@@ -3863,7 +3859,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) {
|
||||
@@ -4560,7 +4556,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