Merge branch 'SoftFever' into feature/wall_order

This commit is contained in:
SoftFever 2022-11-19 23:05:15 +08:00
commit 88c0fea06f
7 changed files with 47 additions and 12 deletions

View file

@ -1150,7 +1150,7 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
bool end_found = false;
std::string line;
while (std::getline(ifs, line))
if (line == "; CONFIG_BLOCK_START") {
if (line.rfind("; CONFIG_BLOCK_START",0)==0) {
begin_found = true;
break;
}
@ -1160,7 +1160,7 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
}
std::string key, value;
while (std::getline(ifs, line)) {
if (line == "; CONFIG_BLOCK_END") {
if (line.rfind("; CONFIG_BLOCK_END",0)==0) {
end_found = true;
break;
}

View file

@ -1306,6 +1306,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
m_last_mm3_per_mm = 0.;
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
m_writer.set_is_bbl_machine(is_bbl_printers);
// How many times will be change_layer() called?
// change_layer() in turn increments the progress bar status.

View file

@ -214,12 +214,16 @@ std::string GCodeWriter::set_pressure_advance(double pa) const
std::ostringstream gcode;
if (pa < 0)
return gcode.str();
if (FLAVOR_IS(gcfKlipper))
gcode << "SET_PRESSURE_ADVANCE ADVANCE=" << std::setprecision(4) << pa << "; Override pressure advance value\n";
else
gcode << "M900 K" <<std::setprecision(4)<< pa << "; Override pressure advance value\n";
if(m_is_bbl_printers){
//SoftFever: set L1000 to use linear model
gcode << "M900 K" <<std::setprecision(4)<< pa << " L1000 M10 ; Override pressure advance value\n";
}
else{
if (FLAVOR_IS(gcfKlipper))
gcode << "SET_PRESSURE_ADVANCE ADVANCE=" << std::setprecision(4) << pa << "; Override pressure advance value\n";
else
gcode << "M900 K" <<std::setprecision(4)<< pa << "; Override pressure advance value\n";
}
return gcode.str();
}

View file

@ -91,6 +91,10 @@ public:
bool is_current_position_clear() const { return m_is_current_pos_clear; };
//BBS:
static const bool full_gcode_comment;
//SoftFever
void set_is_bbl_machine(bool bval) {m_is_bbl_printers = bval;}
const bool is_bbl_printers() const {return m_is_bbl_printers;}
private:
// Extruders are sorted by their ID, so that binary search is possible.
@ -129,7 +133,10 @@ private:
//Radian threshold of slope for lazy lift and spiral lift;
static const double slope_threshold;
//SoftFever
bool m_is_bbl_printers = false;
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);