From 0e785c05e507f632b0a17a9ce641fe68bafc938d Mon Sep 17 00:00:00 2001 From: niklasb <58566859+niklasb22@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:13:47 +0200 Subject: [PATCH] Added All Plates Stats Total Cost #1781 (#2238) Co-authored-by: SoftFever --- src/slic3r/GUI/GCodeViewer.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 6c0954a2684..3d0e4f2b9cd 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -4185,6 +4185,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector flushed_filaments_m_all_plates; std::vector flushed_filaments_g_all_plates; float total_time_all_plates = 0.0f; + float total_cost_all_plates = 0.0f; bool show_detailed_statistics_page = false; auto max_width = [](const std::vector& items, const std::string& title, float extra_size = 0.0f) { @@ -4278,8 +4279,12 @@ void GCodeViewer::render_all_plates_stats(const std::vector(m_time_estimate_mode)]; total_time_all_plates += plate_time_mode.time; + + Print *print; + plate->get_print((PrintBase **) &print, nullptr, nullptr); + total_cost_all_plates += print->print_statistics().total_cost; } - + for (auto it = volume_of_extruders_all_plates.begin(); it != volume_of_extruders_all_plates.end(); it++) { auto [model_used_filament_m, model_used_filament_g] = get_used_filament_from_volume(it->second, it->first); model_used_filaments_m_all_plates.push_back(model_used_filament_m); @@ -4342,13 +4347,21 @@ void GCodeViewer::render_all_plates_stats(const std::vector