ENH: support skiping object when export gcode

Enable label object when does not print with multi
filament and object number is smaller than 65

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Id670c6a5258f266076bc0a52c50ab5a28386f242
(cherry picked from commit 40248347908788ce6303ed255826011127d8eaa3)
This commit is contained in:
salt.wei 2023-05-19 21:21:47 +08:00 committed by Lane.Wei
parent aec9317d65
commit 28d2227c7b
4 changed files with 163 additions and 34 deletions

View file

@ -73,7 +73,7 @@ public:
std::string retract(bool before_wipe = false);
std::string retract_for_toolchange(bool before_wipe = false);
std::string unretract();
std::string lift(LiftType lift_type = LiftType::NormalLift);
std::string lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false);
std::string unlift();
Vec3d get_position() const { return m_pos; }
void set_position(Vec3d& in) { m_pos = in; }
@ -88,6 +88,14 @@ public:
std::string set_fan(unsigned int speed) const;
//BBS: set additional fan speed for BBS machine only
static std::string set_additional_fan(unsigned int speed);
//BBS
void set_object_start_str(std::string start_string) { m_gcode_label_objects_start = start_string; }
bool empty_object_start_str() { return m_gcode_label_objects_start.empty(); }
void set_object_end_str(std::string end_string) { m_gcode_label_objects_end = end_string; }
bool empty_object_end_str() { return m_gcode_label_objects_end.empty(); }
void add_object_start_labels(std::string& gcode);
void add_object_end_labels(std::string& gcode);
void add_object_change_labels(std::string& gcode);
//BBS:
void set_current_position_clear(bool clear) { m_is_current_pos_clear = clear; };
@ -124,6 +132,9 @@ private:
double m_x_offset{ 0 };
double m_y_offset{ 0 };
std::string m_gcode_label_objects_start;
std::string m_gcode_label_objects_end;
std::string _travel_to_z(double z, const std::string &comment);
std::string _spiral_travel_to_z(double z, const Vec2d &ij_offset, const std::string &comment);
std::string _retract(double length, double restart_extra, const std::string &comment);