FIX: Printable area check results in gcode_check_result

Added a check for Gcode traces outside the printable area after the backend slicer, allowing command-line slicers to detect abnormal results. The GCodeProcessor's m_result.gcode_check_result.error_code now includes not only dual-head print range checks, but also checks for the machine's plate print range, wrapping detection area, and height violations.

jira: none
Change-Id: I44072ece3b4b525c77328cec2f76e205eb559cc4
(cherry picked from commit 054f936243968687f536170374a233ec912e8e42)
This commit is contained in:
songwei.li
2025-08-06 20:37:53 +08:00
committed by Noisyfox
parent c0c12fcb1f
commit aa9fb1fd34
4 changed files with 108 additions and 42 deletions

View File

@@ -125,7 +125,8 @@ class Print;
struct GCodeCheckResult
{
int error_code = 0; // 0 means succeed, 0001 printable area error, 0010 printable height error
int error_code = 0; // 0 means succeed, 0b 0001 multi extruder printable area error, 0b 0010 multi extruder printable height error,
// 0b 0100 plate printable area error, 0b 1000 plate printable height error, 0b 10000 wrapping detection area error
std::map<int, std::vector<std::pair<int, int>>> print_area_error_infos; // printable_area extruder_id to <filament_id - object_label_id> which cannot printed in this extruder
std::map<int, std::vector<std::pair<int, int>>> print_height_error_infos; // printable_height extruder_id to <filament_id - object_label_id> which cannot printed in this extruder
void reset() {
@@ -841,7 +842,11 @@ class Print;
GCodeProcessor();
void init_filament_maps_and_nozzle_type_when_import_only_gcode();
// check whether the gcode path meets the filament_map grouping requirements
bool check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas,
bool check_multi_extruder_gcode_valid(const int extruder_size,
const Pointfs plate_printable_area,
const double plate_printable_height,
const Pointfs wrapping_exclude_area,
const std::vector<Polygons> &unprintable_areas,
const std::vector<double> &printable_heights,
const std::vector<int> &filament_map,
const std::vector<std::set<int>>& unprintable_filament_types );