forked from viewit/OrcaSlicer-KX
* 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>
130 lines
2.7 KiB
C++
130 lines
2.7 KiB
C++
///|/ Copyright (c) Prusa Research 2023 Enrico Turri @enricoturri1966, Pavel Mikuš @Godrak
|
|
///|/
|
|
///|/ libvgcode is released under the terms of the AGPLv3 or higher
|
|
///|/
|
|
#ifndef VGCODE_PATHVERTEX_HPP
|
|
#define VGCODE_PATHVERTEX_HPP
|
|
|
|
#include "Types.hpp"
|
|
|
|
#include <cfloat>
|
|
|
|
namespace libvgcode {
|
|
|
|
//
|
|
// Struct representating a gcode move (toolpath segment)
|
|
//
|
|
struct PathVertex
|
|
{
|
|
//
|
|
// Segment end position
|
|
//
|
|
Vec3 position{ FLT_MAX, FLT_MAX, FLT_MAX };
|
|
//
|
|
// Segment height
|
|
//
|
|
float height{ 0.0f };
|
|
//
|
|
// Segment width
|
|
//
|
|
float width{ 0.0f };
|
|
//
|
|
// Segment speed
|
|
//
|
|
float feedrate{ 0.0f };
|
|
//
|
|
// Segment actual speed
|
|
//
|
|
float actual_feedrate{ 0.0f };
|
|
//
|
|
// Segment mm3_per_mm
|
|
//
|
|
float mm3_per_mm{ 0.0f };
|
|
//
|
|
// Segment fan speed
|
|
//
|
|
float fan_speed{ 0.0f };
|
|
//
|
|
// Segment temperature
|
|
//
|
|
float temperature{ 0.0f };
|
|
#if VGCODE_ENABLE_COG_AND_TOOL_MARKERS
|
|
//
|
|
// Segment weight
|
|
//
|
|
float weight{ 0.0f };
|
|
#endif // VGCODE_ENABLE_COG_AND_TOOL_MARKERS
|
|
//
|
|
// Segment extrusion role
|
|
//
|
|
EGCodeExtrusionRole role{ EGCodeExtrusionRole::None };
|
|
//
|
|
// Segment move type
|
|
//
|
|
EMoveType type{ EMoveType::Noop };
|
|
//
|
|
// Segment gcode line id
|
|
//
|
|
uint32_t gcode_id{ 0 };
|
|
//
|
|
// Segment layer id
|
|
//
|
|
uint32_t layer_id{ 0 };
|
|
//
|
|
// Segment extruder id
|
|
//
|
|
uint8_t extruder_id{ 0 };
|
|
//
|
|
// Segment color id
|
|
//
|
|
uint8_t color_id{ 0 };
|
|
//
|
|
// Segment estimated times
|
|
//
|
|
std::array<float, TIME_MODES_COUNT> times{ 0.0f, 0.0f };
|
|
//
|
|
// Layer duration in seconds
|
|
//
|
|
float layer_duration{ 0.0f };
|
|
//
|
|
// ORCA: Add Pressure Advance visualization support
|
|
// Pressure advance value
|
|
//
|
|
float pressure_advance{ 0.0f };
|
|
|
|
//
|
|
// Return true if the segment is an extrusion move
|
|
//
|
|
bool is_extrusion() const;
|
|
//
|
|
// Return true if the segment is an travel move
|
|
//
|
|
bool is_travel() const;
|
|
//
|
|
// Return true if the segment is an option
|
|
// See: EOptionType
|
|
//
|
|
bool is_option() const;
|
|
//
|
|
// Return true if the segment is a wipe move
|
|
//
|
|
bool is_wipe() const;
|
|
//
|
|
// Return true if the segment was generated by custom gcode
|
|
//
|
|
bool is_custom_gcode() const;
|
|
//
|
|
// Return the volumetric flow rate of the segment
|
|
//
|
|
float volumetric_rate() const { return feedrate * mm3_per_mm; }
|
|
//
|
|
// Return the acutal volumetric flow rate of the segment
|
|
//
|
|
float actual_volumetric_rate() const { return actual_feedrate * mm3_per_mm; }
|
|
|
|
static const PathVertex DUMMY_PATH_VERTEX;
|
|
};
|
|
|
|
} // namespace libvgcode
|
|
|
|
#endif // VGCODE_PATHVERTEX_HPP
|