Skip to content

Commit

Permalink
Maybe this?
Browse files Browse the repository at this point in the history
  • Loading branch information
cochcoder committed Mar 12, 2024
1 parent 647e5c2 commit 915c731
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/slic3r/GUI/GCodeViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4319,40 +4319,40 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
if (filament_cost_all_plates > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(_u8L("Filament cost") + ":");
imgui.text(_u8L("Filament cost") + ":" + ps.currency);
ImGui::SameLine();
char buf[64];
::sprintf(buf, "%.2f", ps.currency + filament_cost_all_plates);
::sprintf(buf, "%.2f", filament_cost_all_plates);
imgui.text(buf);
}

if (electric_cost_all_plates > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(_u8L("Electric cost") + ":");
imgui.text(_u8L("Electric cost") + ":" + ps.currency);
ImGui::SameLine();
char buf[64];
::sprintf(buf, "%.2f", ps.currency + electric_cost_all_plates);
::sprintf(buf, "%.2f", electric_cost_all_plates);
imgui.text(buf);
}

if (other_costs_all_plates > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(_u8L("Other costs") + ":");
imgui.text(_u8L("Other costs") + ":" + ps.currency);
ImGui::SameLine();
char buf[64];
::sprintf(buf, "%.2f", ps.currency + other_costs_all_plates);
::sprintf(buf, "%.2f", other_costs_all_plates);
imgui.text(buf);
}

if (electric_cost_all_plates > 0 || filament_cost_all_plates > 0 || other_costs_all_plates > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(_u8L("Total cost") + ":");
imgui.text(_u8L("Total cost") + ":" + ps.currency);
ImGui::SameLine();
char buf[64];
::sprintf(buf, "%.2f", ps.currency + total_cost_all_plates);
::sprintf(buf, "%.2f", total_cost_all_plates);
imgui.text(buf);
}
}
Expand Down Expand Up @@ -5133,9 +5133,9 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
if (ps.total_filament_cost > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(_u8L("Filament cost")+":");
imgui.text(_u8L("Filament cost")+":"+ps.currency);
ImGui::SameLine();
::sprintf(buf, "%.2f", ps.currency + ps.total_filament_cost);
::sprintf(buf, "%.2f", ps.total_filament_cost);
imgui.text(buf);
}

Expand Down Expand Up @@ -5604,43 +5604,43 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
if (ps.total_filament_cost > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(cost_filament+":");
imgui.text(cost_filament+":"+ps.currency);
ImGui::SameLine(max_len);
char buf[64];
::sprintf(buf, "%.2f", ps.currency + ps.total_filament_cost);
::sprintf(buf, "%.2f", ps.total_filament_cost);
imgui.text(buf);
}

//BBS: display electric costs, if any costs are caculated
if (ps.electric_cost > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(cost_energy+":");
imgui.text(cost_energy+":"+ps.currency);
ImGui::SameLine(max_len);
char buf[64];
::sprintf(buf, "%.2f", ps.currency + ps.electric_cost);
::sprintf(buf, "%.2f", ps.electric_cost);
imgui.text(buf);
}

//BBS: display other costs, if any costs are caculated
if (ps.other_costs > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(other_costs+":");
imgui.text(other_costs+":"+ps.currency);
ImGui::SameLine(max_len);
char buf[64];
::sprintf(buf, "%.2f", ps.currency + ps.other_costs);
::sprintf(buf, "%.2f", ps.other_costs);
imgui.text(buf);
}

//BBS: display total costs, if any costs are caculated
if (ps.electric_cost > 0 || ps.total_filament_cost > 0 || ps.other_costs > 0) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.text(total_cost+":");
imgui.text(total_cost+":"+ps.currency);
ImGui::SameLine(max_len);
char buf[64];
::sprintf(buf, "%.2f", ps.currency + ps.total_cost);
::sprintf(buf, "%.2f", ps.total_cost);
imgui.text(buf);
}
}
Expand Down

0 comments on commit 915c731

Please sign in to comment.