mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 11:31:58 +08:00
Add empty lines to all print statistics
This commit is contained in:
parent
834930fbe6
commit
4ec68c219c
@ -1830,7 +1830,7 @@ void GLCanvas3D::update_volumes_colors_by_extruder()
|
||||
|
||||
using PerBedStatistics = std::vector<std::pair<
|
||||
std::size_t,
|
||||
std::reference_wrapper<const PrintStatistics>
|
||||
std::optional<std::reference_wrapper<const PrintStatistics>>
|
||||
>>;
|
||||
|
||||
PerBedStatistics get_statistics(){
|
||||
@ -1838,9 +1838,10 @@ PerBedStatistics get_statistics(){
|
||||
for (int bed_index=0; bed_index<s_multiple_beds.get_number_of_beds(); ++bed_index) {
|
||||
const Print* print = wxGetApp().plater()->get_fff_prints()[bed_index].get();
|
||||
if (print->empty() || !print->finished()) {
|
||||
continue;
|
||||
result.emplace_back(bed_index, std::nullopt);
|
||||
} else {
|
||||
result.emplace_back(bed_index, std::optional{std::ref(print->print_statistics())});
|
||||
}
|
||||
result.emplace_back(bed_index, std::ref(print->print_statistics()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1856,11 +1857,14 @@ struct StatisticsSum {
|
||||
StatisticsSum get_statistics_sum() {
|
||||
StatisticsSum result;
|
||||
for (const auto &[_, statistics] : get_statistics()) {
|
||||
result.cost += statistics.get().total_cost;
|
||||
result.filement_weight += statistics.get().total_weight;
|
||||
result.filament_length += statistics.get().total_used_filament;
|
||||
result.normal_print_time += statistics.get().normal_print_time_seconds;
|
||||
result.silent_print_time += statistics.get().silent_print_time_seconds;
|
||||
if (!statistics) {
|
||||
continue;
|
||||
}
|
||||
result.cost += statistics->get().total_cost;
|
||||
result.filement_weight += statistics->get().total_weight;
|
||||
result.filament_length += statistics->get().total_used_filament;
|
||||
result.normal_print_time += statistics->get().normal_print_time_seconds;
|
||||
result.silent_print_time += statistics->get().silent_print_time_seconds;
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -1900,20 +1904,37 @@ float project_overview_table(float scale) {
|
||||
);
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
for (const auto &[bed_index, statistics] : get_statistics()) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", (_u8L("Plate") + wxString::Format(" %d", bed_index + 1)).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_cost).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_weight).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_used_filament / 1000).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", statistics.get().estimated_silent_print_time.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", statistics.get().estimated_normal_print_time.c_str());
|
||||
for (const auto &[bed_index, optional_statistics] : get_statistics()) {
|
||||
if (optional_statistics) {
|
||||
const std::reference_wrapper<const PrintStatistics> statistics{*optional_statistics};
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", (_u8L("Bed") + wxString::Format(" %d", bed_index + 1)).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_cost).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_weight).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", wxString::Format("%.2f", statistics.get().total_used_filament / 1000).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", statistics.get().estimated_silent_print_time.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", statistics.get().estimated_normal_print_time.c_str());
|
||||
} else {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", (_u8L("Bed") + wxString::Format(" %d", bed_index + 1)).ToStdString().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("-");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("-");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("-");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("-");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("-");
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGuiPureWrap::COL_ORANGE_LIGHT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user