SPE-2359: Added speed and volumetric flow rate to imgui vertex properties dialog (#12840)

(cherry picked from commit 0602723695664eb77570c1ea04971f55a8779d6c)
This commit is contained in:
enricoturri1966
2024-06-20 02:46:15 -04:00
committed by Andrew Sun
parent 6e9fbc90e7
commit e0cdae0cb4

View File

@@ -340,9 +340,14 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
char buff[1024]; char buff[1024];
append_table_row(_u8L("Type"), [&vertex]() { append_table_row(_u8L("Type"), [&vertex]() {
std::string text = _u8L(to_string(vertex.type)); ImGuiWrapper::text(_u8L(to_string(vertex.type)));
});
append_table_row(_u8L("Feature type"), [&vertex]() {
std::string text;
if (vertex.is_extrusion()) if (vertex.is_extrusion())
text += " (" + _u8L(to_string(vertex.role)) + ")"; text = _u8L(to_string(vertex.role));
else
text = _u8L("N/A");
ImGuiWrapper::text(text); ImGuiWrapper::text(text);
}); });
append_table_row(_u8L("Width") + " (" + _u8L("mm") + ")", [&vertex, &buff]() { append_table_row(_u8L("Width") + " (" + _u8L("mm") + ")", [&vertex, &buff]() {
@@ -370,7 +375,6 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
const std::string text = std::string(buff); const std::string text = std::string(buff);
ImGuiWrapper::text(text); ImGuiWrapper::text(text);
}); });
#if !ENABLE_ACTUAL_SPEED_DEBUG
append_table_row(_u8L("Speed") + " (" + _u8L("mm/s") + ")", [&vertex, &buff]() { append_table_row(_u8L("Speed") + " (" + _u8L("mm/s") + ")", [&vertex, &buff]() {
std::string text; std::string text;
if (vertex.is_extrusion()) { if (vertex.is_extrusion()) {
@@ -381,17 +385,16 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
text = _u8L("N/A"); text = _u8L("N/A");
ImGuiWrapper::text(text); ImGuiWrapper::text(text);
}); });
append_table_row(_u8L("Actual speed") + " (" + _u8L("mm/s") + ")", [&vertex, &buff]() { append_table_row(_u8L("Volumetric flow rate") + " (" + _u8L("mm³/s") + ")", [&vertex, &buff]() {
std::string text; std::string text;
if (vertex.is_extrusion()) { if (vertex.is_extrusion()) {
sprintf(buff, "%.1f", vertex.actual_feedrate); sprintf(buff, "%.3f", vertex.volumetric_rate());
text = std::string(buff); text = std::string(buff);
} }
else else
text = _u8L("N/A"); text = _u8L("N/A");
ImGuiWrapper::text(text); ImGuiWrapper::text(text);
}); });
#endif // !ENABLE_ACTUAL_SPEED_DEBUG
append_table_row(_u8L("Fan speed") + " (" + _u8L("%") + ")", [&vertex, &buff]() { append_table_row(_u8L("Fan speed") + " (" + _u8L("%") + ")", [&vertex, &buff]() {
std::string text; std::string text;
if (vertex.is_extrusion()) { if (vertex.is_extrusion()) {