New config value "gcode_resolution" replaces the hard coded RESOLUTION

value, which was set to 0.0125mm.
This commit is contained in:
Vojtech Bubnik 2021-11-30 17:51:53 +01:00
parent efaf4e47c1
commit 4158f9ec8e
15 changed files with 56 additions and 27 deletions

View file

@ -2414,6 +2414,7 @@ void GCode::apply_print_config(const PrintConfig &print_config)
{
m_writer.apply_print_config(print_config);
m_config.apply(print_config);
m_scaled_resolution = scaled<double>(print_config.gcode_resolution.value);
}
void GCode::append_full_config(const Print &print, std::string &str)
@ -2565,7 +2566,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) {
// description += ExtrusionLoop::role_to_string(loop.loop_role());
// description += ExtrusionEntity::role_to_string(path->role);
path->simplify(SCALED_RESOLUTION);
path->simplify(m_scaled_resolution);
gcode += this->_extrude(*path, description, speed);
}
@ -2619,7 +2620,7 @@ std::string GCode::extrude_multi_path(ExtrusionMultiPath multipath, std::string
for (ExtrusionPath path : multipath.paths) {
// description += ExtrusionLoop::role_to_string(loop.loop_role());
// description += ExtrusionEntity::role_to_string(path->role);
path.simplify(SCALED_RESOLUTION);
path.simplify(m_scaled_resolution);
gcode += this->_extrude(path, description, speed);
}
if (m_wipe.enable) {
@ -2647,7 +2648,7 @@ std::string GCode::extrude_entity(const ExtrusionEntity &entity, std::string des
std::string GCode::extrude_path(ExtrusionPath path, std::string description, double speed)
{
// description += ExtrusionEntity::role_to_string(path.role());
path.simplify(SCALED_RESOLUTION);
path.simplify(m_scaled_resolution);
std::string gcode = this->_extrude(path, description, speed);
if (m_wipe.enable) {
m_wipe.path = std::move(path.polyline);