ENH: Add gcode check for multi_extruder

jira: none
Change-Id: Iebc43e608c4509eb62b280af2d401fa9e0e089ba
(cherry picked from commit c75c10e312b8d0bd5404d92db88c95a9e6186bc1)
This commit is contained in:
zhimin.zeng
2024-09-02 17:59:57 +08:00
committed by Noisyfox
parent 7bd16a3ca7
commit 135b39526e
12 changed files with 149 additions and 2 deletions

View File

@@ -133,9 +133,21 @@ class Print;
using ConflictResultOpt = std::optional<ConflictResult>;
struct GCodeCheckResult
{
int error_code = 0; // 0 means succeed
std::map<int, std::vector<int>> error_infos; // extruder_id to filament_ids
void reset() {
error_code = 0;
error_infos.clear();
}
};
struct GCodeProcessorResult
{
ConflictResultOpt conflict_result;
GCodeCheckResult gcode_check_result;
BedMatchResult bed_match_result;
struct SettingsIds
@@ -260,6 +272,7 @@ class Print;
spiral_vase_layers = other.spiral_vase_layers;
warnings = other.warnings;
bed_type = other.bed_type;
gcode_check_result = other.gcode_check_result;
bed_match_result = other.bed_match_result;
#if ENABLE_GCODE_VIEWER_STATISTICS
time = other.time;
@@ -776,6 +789,8 @@ class Print;
public:
GCodeProcessor();
// check whether the gcode path meets the filament_map grouping requirements
bool check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<int>& filament_map);
void apply_config(const PrintConfig& config);
void set_print(Print* print) { m_print = print; }
void enable_stealth_time_estimator(bool enabled);