Add Pressure Advance visualization support (#11673)

* Add Pressure Advance visualization support

Signed-off-by: minicx <minicx@disroot.org>

* Port Pressure Advance visualization to libvgcode architecture

Adapt PA visualization (originally in commit e3a77259) to work with
the new libvgcode library introduced by upstream PR #10735.

Changes across the libvgcode stack:
- PathVertex: add pressure_advance field
- Types.hpp: add PressureAdvance to EViewType enum
- ViewerImpl: add ColorRange, color mapping, range updates for PA
- LibVGCodeWrapper: pass pressure_advance from MoveVertex to PathVertex

GCodeViewer UI integration:
- Add "Pressure Advance" to view type dropdown
- Add PA color range in legend (3 decimal places)
- Add PA value display in sequential view marker tooltip
- Add PA row in position properties table

The GCodeProcessor PA parsing (M900, M572, SET_PRESSURE_ADVANCE)
is preserved from the original implementation.

* Tag Pressure Advance visualization changes with ORCA comments

Signed-off-by: minicx <minicx@disroot.org>

---------

Signed-off-by: minicx <minicx@disroot.org>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
minicx
2026-02-21 16:10:08 +03:00
committed by GitHub
parent 528e7c6780
commit 7e1b2d99d3
9 changed files with 111 additions and 4 deletions

View File

@@ -184,6 +184,8 @@ class Print;
float travel_dist{ 0.0f }; // mm
float fan_speed{ 0.0f }; // percentage
float temperature{ 0.0f }; // Celsius degrees
// ORCA: Add Pressure Advance visualization support
float pressure_advance{ 0.0f };
std::array<float, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> time{ 0.0f, 0.0f }; // s
float layer_duration{ 0.0f }; // s
unsigned int layer_id{ 0 };
@@ -777,6 +779,8 @@ class Print;
float m_travel_dist; // mm
float m_fan_speed; // percentage
float m_z_offset; // mm
// ORCA: Add Pressure Advance visualization support
float m_pressure_advance;
ExtrusionRole m_extrusion_role;
std::vector<int> m_filament_maps;
std::vector<unsigned char> m_last_filament_id;
@@ -981,6 +985,12 @@ class Print;
// Disable fan
void process_M107(const GCodeReader::GCodeLine& line);
// ORCA: Add Pressure Advance visualization support
// Set pressure advance
void process_M900(const GCodeReader::GCodeLine& line);
void process_M572(const GCodeReader::GCodeLine &line);
void process_SET_PRESSURE_ADVANCE(const GCodeReader::GCodeLine& line);
// Set tool (Sailfish)
void process_M108(const GCodeReader::GCodeLine& line);