fix(build): reconcile PresetBundle/Print::apply signatures with ImageMap headers, Line(Point3) conversions

This commit is contained in:
thysson2701
2026-07-21 22:15:10 +02:00
parent 9fc680569e
commit 868858eaa5
4 changed files with 7 additions and 9 deletions

View File

@@ -10984,7 +10984,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
for (size_t point_idx = 1; point_idx < path.polyline.points.size(); ++point_idx)
halftone_source_cumulative_mm[point_idx] =
halftone_source_cumulative_mm[point_idx - 1] +
Line(path.polyline.points[point_idx - 1], path.polyline.points[point_idx]).length() * SCALING_FACTOR;
Line(path.polyline.points[point_idx - 1].to_point(), path.polyline.points[point_idx].to_point()).length() * SCALING_FACTOR;
const double halftone_total_path_mm = halftone_source_cumulative_mm.empty() ? 0.0 : halftone_source_cumulative_mm.back();
double halftone_anchor_mm = 0.0;
if (halftone_path_closed && path.polyline.points.size() > 1 && halftone_total_path_mm > EPSILON) {
@@ -13561,7 +13561,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
size_t end_index = fitting_result[fitting_index].end_point_index;
for (size_t point_index = start_index + 1; point_index < end_index + 1; point_index++) {
tempDescription = description;
const Line line = Line(path.polyline.points[point_index - 1], path.polyline.points[point_index]);
const Line line = Line(path.polyline.points[point_index - 1].to_point(), path.polyline.points[point_index].to_point());
const double line_length = line.length() * SCALING_FACTOR;
if (line_length < EPSILON)
continue;

View File

@@ -1156,7 +1156,7 @@ bool PresetBundle::import_json_presets(PresetsConfigSubstitutions & s
}
//BBS save user preset to user_id preset folder
void PresetBundle::save_user_presets(AppConfig& config, std::vector<std::string>& need_to_delete_list)
void PresetBundle::save_user_presets(AppConfig& config, std::map<std::string, std::string>& need_to_delete_list)
{
std::string user_sub_folder = DEFAULT_USER_FOLDER_NAME;
if (!config.get("preset_folder").empty())
@@ -4645,7 +4645,7 @@ void PresetBundle::set_default_suppressed(bool default_suppressed)
printers.set_default_suppressed(default_suppressed);
}
bool PresetBundle::has_errors() const
bool PresetBundle::has_errors(bool check_duplicate_filament_subtypes) const
{
if (m_errors != 0 || printers.m_errors != 0 || filaments.m_errors != 0 || prints.m_errors != 0)
return true;

View File

@@ -202,16 +202,14 @@ public:
PresetsConfigSubstitutions import_presets(std::vector<std::string>& files,
std::function<int(std::string const&)> override_confirm,
ForwardCompatibilitySubstitutionRule rule,
AppConfig& config);
ForwardCompatibilitySubstitutionRule rule);
bool import_json_presets(PresetsConfigSubstitutions& substitutions,
std::string& file,
std::function<int(std::string const&)> override_confirm,
ForwardCompatibilitySubstitutionRule rule,
int& overwrite,
std::vector<std::string>& result,
const std::string& bundle_dir = "");
std::vector<std::string>& result);
void save_user_presets(AppConfig& config, std::map<std::string, std::string>& need_to_delete_list);
void check_and_fix_user_presets_syncinfo(const std::string& user_id);

View File

@@ -1363,7 +1363,7 @@ static void append_model_used_filaments_for_normalization(const Model
}
}
Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_config)
Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_config, bool extruder_applied)
{
#ifdef _DEBUG
check_model_ids_validity(model);