FIX: modify parameter type of process preset

jira: none
Change-Id: I5c973a29e5b983e3f480d55aeeb2b14d13e950ee
This commit is contained in:
zhimin.zeng 2024-06-06 15:16:00 +08:00 committed by lane.wei
parent 3b93bd2dd3
commit 6b09cfee71
22 changed files with 387 additions and 243 deletions

View File

@ -11,7 +11,7 @@ float CalibPressureAdvance::find_optimal_PA_speed(const DynamicPrintConfig &conf
const double general_suggested_min_speed = 100.0; const double general_suggested_min_speed = 100.0;
double filament_max_volumetric_speed = config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0); double filament_max_volumetric_speed = config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
Flow pattern_line = Flow(line_width, layer_height, config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0)); Flow pattern_line = Flow(line_width, layer_height, config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0));
auto pa_speed = std::min(std::max(general_suggested_min_speed, config.option<ConfigOptionFloat>("outer_wall_speed")->value), auto pa_speed = std::min(std::max(general_suggested_min_speed, config.option<ConfigOptionFloatsNullable>("outer_wall_speed")->get_at(get_extruder_index(filament_idx))),
filament_max_volumetric_speed / pattern_line.mm3_per_mm()); filament_max_volumetric_speed / pattern_line.mm3_per_mm());
return std::floor(pa_speed); return std::floor(pa_speed);

View File

@ -251,8 +251,8 @@ public:
Vec3d get_start_offset(); Vec3d get_start_offset();
protected: protected:
double speed_first_layer() const { return m_config.option<ConfigOptionFloat>("initial_layer_speed")->value; }; double speed_first_layer() const { return m_config.option<ConfigOptionFloatsNullable>("initial_layer_speed")->get_at(get_extruder_index(m_writer.extruder()->id())); };
double speed_perimeter() const { return m_config.option<ConfigOptionFloat>("outer_wall_speed")->value; }; double speed_perimeter() const { return m_config.option<ConfigOptionFloatsNullable>("outer_wall_speed")->get_at(get_extruder_index(m_writer.extruder()->id())); };
double line_width_first_layer() const { return m_config.get_abs_value("initial_layer_line_width"); }; double line_width_first_layer() const { return m_config.get_abs_value("initial_layer_line_width"); };
double line_width() const { return m_config.get_abs_value("line_width"); }; double line_width() const { return m_config.get_abs_value("line_width"); };
int wall_count() const { return m_config.option<ConfigOptionInt>("wall_loops")->value; }; int wall_count() const { return m_config.option<ConfigOptionInt>("wall_loops")->value; };

View File

@ -650,6 +650,32 @@ bool ConfigBase::set_deserialize_raw(const t_config_option_key &opt_key_src, con
return success; return success;
} }
double ConfigBase::get_abs_value_at(const t_config_option_key &opt_key, size_t index) const
{
const ConfigOption *raw_opt = this->option(opt_key);
assert(raw_opt != nullptr);
if (raw_opt->type() == coFloats) {
return static_cast<const ConfigOptionFloats*>(raw_opt)->get_at(index);
}
if (raw_opt->type() == coFloatsOrPercents) {
const ConfigDef *def = this->def();
if (def == nullptr) throw NoDefinitionException(opt_key);
const ConfigOptionDef *opt_def = def->get(opt_key);
assert(opt_def != nullptr);
if (opt_def->ratio_over.empty()) {
return 0;
} else {
const ConfigOption *ratio_opt = this->option(opt_def->ratio_over);
assert(ratio_opt->type() == coFloats);
const ConfigOptionFloats *ratio_values = static_cast<const ConfigOptionFloats *>(raw_opt);
return static_cast<const ConfigOptionFloatsOrPercents *>(raw_opt)->get_at(index).get_abs_value(ratio_values->get_at(index));
}
}
throw ConfigurationError("ConfigBase::get_abs_value_at(): Not a valid option type for get_abs_value_at()");
}
// Return an absolute value of a possibly relative config variable. // Return an absolute value of a possibly relative config variable.
// For example, return absolute infill extrusion width, either from an absolute value, or relative to the layer height. // For example, return absolute infill extrusion width, either from an absolute value, or relative to the layer height.
double ConfigBase::get_abs_value(const t_config_option_key &opt_key) const double ConfigBase::get_abs_value(const t_config_option_key &opt_key) const
@ -1704,6 +1730,39 @@ t_config_option_keys DynamicConfig::equal(const DynamicConfig &other) const
return equal; return equal;
} }
double& DynamicConfig::opt_float(const t_config_option_key &opt_key, unsigned int idx)
{
if (ConfigOptionFloats *opt_floats = dynamic_cast<ConfigOptionFloats *>(this->option(opt_key))) {
return opt_floats->get_at(idx);
} else {
ConfigOptionFloatsNullable *opt_floats_nullable = dynamic_cast<ConfigOptionFloatsNullable *>(this->option(opt_key));
assert(opt_floats_nullable != nullptr);
return opt_floats_nullable->get_at(idx);
}
}
const double& DynamicConfig::opt_float(const t_config_option_key &opt_key, unsigned int idx) const
{
if (const ConfigOptionFloats *opt_floats = dynamic_cast<const ConfigOptionFloats *>(this->option(opt_key))) {
return opt_floats->get_at(idx);
} else if (const ConfigOptionFloatsNullable *opt_floats_nullable = dynamic_cast<const ConfigOptionFloatsNullable *>(this->option(opt_key))) {
return opt_floats_nullable->get_at(idx);
} else {
assert(false);
return 0;
}
}
bool DynamicConfig::opt_bool(const t_config_option_key &opt_key, unsigned int idx) const {
if (const ConfigOptionBools *opts = dynamic_cast<const ConfigOptionBools *>(this->option(opt_key))) {
return opts->get_at(idx) != 0;
}
else {
const ConfigOptionBoolsNullable *opt_s = dynamic_cast<const ConfigOptionBoolsNullable *>(this->option(opt_key));
assert(opt_s != nullptr);
return opt_s->get_at(idx) != 0;
}
}
} }
#include <cereal/types/polymorphic.hpp> #include <cereal/types/polymorphic.hpp>

View File

@ -28,8 +28,13 @@
namespace Slic3r { namespace Slic3r {
struct FloatOrPercent struct FloatOrPercent
{ {
double value; double value = 0;
bool percent; bool percent = false;
FloatOrPercent() {}
FloatOrPercent(double value_, bool percent_) : value(value_), percent(percent_) { }
double get_abs_value(double ratio_over) const { return this->percent ? (ratio_over * this->value / 100) : this->value; }
FloatOrPercent() {} FloatOrPercent() {}
FloatOrPercent(double value_, bool percent_) : value(value_), percent(percent_) {} FloatOrPercent(double value_, bool percent_) : value(value_), percent(percent_) {}
@ -2151,6 +2156,7 @@ public:
void set_deserialize_strict(std::initializer_list<SetDeserializeItem> items) void set_deserialize_strict(std::initializer_list<SetDeserializeItem> items)
{ ConfigSubstitutionContext ctxt{ ForwardCompatibilitySubstitutionRule::Disable }; this->set_deserialize(items, ctxt); } { ConfigSubstitutionContext ctxt{ ForwardCompatibilitySubstitutionRule::Disable }; this->set_deserialize(items, ctxt); }
double get_abs_value_at(const t_config_option_key &opt_key, size_t index) const;
double get_abs_value(const t_config_option_key &opt_key) const; double get_abs_value(const t_config_option_key &opt_key) const;
double get_abs_value(const t_config_option_key &opt_key, double ratio_over) const; double get_abs_value(const t_config_option_key &opt_key, double ratio_over) const;
void setenv_() const; void setenv_() const;
@ -2325,8 +2331,10 @@ public:
double& opt_float(const t_config_option_key &opt_key) { return this->option<ConfigOptionFloat>(opt_key)->value; } double& opt_float(const t_config_option_key &opt_key) { return this->option<ConfigOptionFloat>(opt_key)->value; }
const double& opt_float(const t_config_option_key &opt_key) const { return dynamic_cast<const ConfigOptionFloat*>(this->option(opt_key))->value; } const double& opt_float(const t_config_option_key &opt_key) const { return dynamic_cast<const ConfigOptionFloat*>(this->option(opt_key))->value; }
double& opt_float(const t_config_option_key &opt_key, unsigned int idx) { return this->option<ConfigOptionFloats>(opt_key)->get_at(idx); } double & opt_float(const t_config_option_key &opt_key, unsigned int idx);
const double& opt_float(const t_config_option_key &opt_key, unsigned int idx) const { return dynamic_cast<const ConfigOptionFloats*>(this->option(opt_key))->get_at(idx); } const double & opt_float(const t_config_option_key &opt_key, unsigned int idx) const;
double & opt_float_nullable(const t_config_option_key &opt_key, unsigned int idx) { return this->option<ConfigOptionFloatsNullable>(opt_key)->get_at(idx); }
const double & opt_float_nullable(const t_config_option_key &opt_key, unsigned int idx) const { return dynamic_cast<const ConfigOptionFloatsNullable *>(this->option(opt_key))->get_at(idx); }
int& opt_int(const t_config_option_key &opt_key) { return this->option<ConfigOptionInt>(opt_key)->value; } int& opt_int(const t_config_option_key &opt_key) { return this->option<ConfigOptionInt>(opt_key)->value; }
int opt_int(const t_config_option_key &opt_key) const { return dynamic_cast<const ConfigOptionInt*>(this->option(opt_key))->value; } int opt_int(const t_config_option_key &opt_key) const { return dynamic_cast<const ConfigOptionInt*>(this->option(opt_key))->value; }
@ -2341,7 +2349,7 @@ public:
int opt_enum(const t_config_option_key &opt_key, unsigned int idx) const { return dynamic_cast<const ConfigOptionEnumsGeneric*>(this->option(opt_key))->get_at(idx); } int opt_enum(const t_config_option_key &opt_key, unsigned int idx) const { return dynamic_cast<const ConfigOptionEnumsGeneric*>(this->option(opt_key))->get_at(idx); }
bool opt_bool(const t_config_option_key &opt_key) const { return this->option<ConfigOptionBool>(opt_key)->value != 0; } bool opt_bool(const t_config_option_key &opt_key) const { return this->option<ConfigOptionBool>(opt_key)->value != 0; }
bool opt_bool(const t_config_option_key &opt_key, unsigned int idx) const { return this->option<ConfigOptionBools>(opt_key)->get_at(idx) != 0; } bool opt_bool(const t_config_option_key &opt_key, unsigned int idx) const;
// Command line processing // Command line processing
bool read_cli(int argc, const char* const argv[], t_config_option_keys* extra, t_config_option_keys* keys = nullptr); bool read_cli(int argc, const char* const argv[], t_config_option_keys* extra, t_config_option_keys* keys = nullptr);

View File

@ -189,11 +189,11 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
//BBS: record speed params //BBS: record speed params
if (!params.bridge) { if (!params.bridge) {
if (params.extrusion_role == erInternalInfill) if (params.extrusion_role == erInternalInfill)
params.sparse_infill_speed = region_config.sparse_infill_speed; params.sparse_infill_speed = region_config.sparse_infill_speed.get_at(get_extruder_index(params.extruder));
else if (params.extrusion_role == erTopSolidInfill) else if (params.extrusion_role == erTopSolidInfill)
params.top_surface_speed = region_config.top_surface_speed; params.top_surface_speed = region_config.top_surface_speed.get_at(get_extruder_index(params.extruder));
else if (params.extrusion_role == erSolidInfill) else if (params.extrusion_role == erSolidInfill)
params.solid_infill_speed = region_config.internal_solid_infill_speed; params.solid_infill_speed = region_config.internal_solid_infill_speed.get_at(get_extruder_index(params.extruder));
} }
// Calculate flow spacing for infill pattern generation. // Calculate flow spacing for infill pattern generation.
if (surface.is_solid() || is_bridge) { if (surface.is_solid() || is_bridge) {

View File

@ -297,7 +297,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
//OrcaSlicer //OrcaSlicer
double cur_speed = gcodegen.writer().get_current_speed(); double cur_speed = gcodegen.writer().get_current_speed();
double wipe_speed = gcodegen.config().role_base_wipe_speed && cur_speed > EPSILON ? cur_speed / 60 : double wipe_speed = gcodegen.config().role_base_wipe_speed && cur_speed > EPSILON ? cur_speed / 60 :
gcodegen.writer().config.travel_speed.value * gcodegen.config().wipe_speed.value / 100; gcodegen.writer().config.travel_speed.get_at(get_extruder_index(gcodegen.writer().config, gcodegen.writer().filament()->id())) * gcodegen.config().wipe_speed.value / 100;
// get the retraction length // get the retraction length
@ -1291,7 +1291,7 @@ namespace DoExport {
// BBS: remove small small_perimeter_speed config, and will absolutely // BBS: remove small small_perimeter_speed config, and will absolutely
// remove related code if no other issue in the coming release. // remove related code if no other issue in the coming release.
//region.config().get_abs_value("small_perimeter_speed") == 0 || //region.config().get_abs_value("small_perimeter_speed") == 0 ||
region.config().outer_wall_speed.value == 0 || region.config().outer_wall_speed.get_at(cur_extruder_index()) == 0 ||
region.config().get_abs_value("bridge_speed") == 0) region.config().get_abs_value("bridge_speed") == 0)
mm3_per_mm.push_back(layerm->perimeters.min_mm3_per_mm()); mm3_per_mm.push_back(layerm->perimeters.min_mm3_per_mm());
if (region.config().get_abs_value("sparse_infill_speed") == 0 || if (region.config().get_abs_value("sparse_infill_speed") == 0 ||
@ -1999,7 +1999,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
outer_wall_line_width = default_line_width == 0.0 ? m_config.nozzle_diameter.get_at(initial_non_support_extruder_id) : default_line_width; outer_wall_line_width = default_line_width == 0.0 ? m_config.nozzle_diameter.get_at(initial_non_support_extruder_id) : default_line_width;
} }
Flow outer_wall_flow = Flow(outer_wall_line_width, m_config.layer_height, m_config.nozzle_diameter.get_at(initial_non_support_extruder_id)); Flow outer_wall_flow = Flow(outer_wall_line_width, m_config.layer_height, m_config.nozzle_diameter.get_at(initial_non_support_extruder_id));
float outer_wall_speed = print.default_region_config().outer_wall_speed.value; float outer_wall_speed = print.default_region_config().outer_wall_speed.get_at(get_extruder_index(initial_extruder_id));
float outer_wall_volumetric_speed = outer_wall_speed * outer_wall_flow.mm3_per_mm(); float outer_wall_volumetric_speed = outer_wall_speed * outer_wall_flow.mm3_per_mm();
if (outer_wall_volumetric_speed > filament_max_volumetric_speed) if (outer_wall_volumetric_speed > filament_max_volumetric_speed)
outer_wall_volumetric_speed = filament_max_volumetric_speed; outer_wall_volumetric_speed = filament_max_volumetric_speed;
@ -2092,8 +2092,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// OrcaSlicer: calib // OrcaSlicer: calib
if (print.calib_params().mode == CalibMode::Calib_PA_Line) { if (print.calib_params().mode == CalibMode::Calib_PA_Line) {
std::string gcode; std::string gcode;
if ((m_config.default_acceleration.value > 0 && m_config.outer_wall_acceleration.value > 0)) { if ((m_config.default_acceleration.get_at(cur_extruder_index()) > 0 && m_config.outer_wall_acceleration.get_at(cur_extruder_index()) > 0)) {
gcode += m_writer.set_acceleration((unsigned int) floor(m_config.outer_wall_acceleration.value + 0.5)); gcode += m_writer.set_acceleration((unsigned int) floor(m_config.outer_wall_acceleration.get_at(cur_extruder_index()) + 0.5));
} }
if (m_config.default_jerk.value > 0 && !this->is_BBL_Printer()) { if (m_config.default_jerk.value > 0 && !this->is_BBL_Printer()) {
@ -2104,7 +2104,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
CalibPressureAdvanceLine pa_test(this); CalibPressureAdvanceLine pa_test(this);
double filament_max_volumetric_speed = m_config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(initial_extruder_id); double filament_max_volumetric_speed = m_config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(initial_extruder_id);
Flow pattern_line = Flow(pa_test.line_width(), 0.2, m_config.nozzle_diameter.get_at(0)); Flow pattern_line = Flow(pa_test.line_width(), 0.2, m_config.nozzle_diameter.get_at(0));
auto fast_speed = std::min(print.default_region_config().outer_wall_speed.value, filament_max_volumetric_speed / pattern_line.mm3_per_mm()); auto fast_speed = std::min(print.default_region_config().outer_wall_speed.get_at(cur_extruder_index()), filament_max_volumetric_speed / pattern_line.mm3_per_mm());
auto slow_speed = fast_speed / 4; /*std::max(20.0, fast_speed / 10.0);*/ auto slow_speed = fast_speed / 4; /*std::max(20.0, fast_speed / 10.0);*/
pa_test.set_speed(fast_speed, slow_speed); pa_test.set_speed(fast_speed, slow_speed);
pa_test.draw_numbers() = print.calib_params().print_numbers; pa_test.draw_numbers() = print.calib_params().print_numbers;
@ -2375,6 +2375,11 @@ void GCode::check_placeholder_parser_failed()
} }
} }
size_t GCode::cur_extruder_index() const
{
return get_extruder_index(m_writer.extruder()->id());
}
// Process all layers of all objects (non-sequential mode) with a parallel pipeline: // Process all layers of all objects (non-sequential mode) with a parallel pipeline:
// Generate G-code, run the filters (vase mode, cooling buffer), run the G-code analyser // Generate G-code, run the filters (vase mode, cooling buffer), run the G-code analyser
// and export G-code into file. // and export G-code into file.
@ -3116,8 +3121,8 @@ GCode::LayerResult GCode::process_layer(
//BBS //BBS
if (first_layer) { if (first_layer) {
//BBS: set first layer global acceleration //BBS: set first layer global acceleration
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { if (m_config.default_acceleration.get_at(cur_extruder_index()) > 0 && m_config.initial_layer_acceleration.get_at(cur_extruder_index()) > 0) {
double acceleration = m_config.initial_layer_acceleration.value; double acceleration = m_config.initial_layer_acceleration.get_at(cur_extruder_index());
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5)); gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
} }
@ -3143,8 +3148,8 @@ GCode::LayerResult GCode::process_layer(
} }
//BBS: reset acceleration at sencond layer //BBS: reset acceleration at sencond layer
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { if (m_config.default_acceleration.get_at(cur_extruder_index()) > 0 && m_config.initial_layer_acceleration.get_at(cur_extruder_index()) > 0) {
double acceleration = m_config.default_acceleration.value; double acceleration = m_config.default_acceleration.get_at(cur_extruder_index());
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5)); gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
} }
@ -3455,7 +3460,7 @@ GCode::LayerResult GCode::process_layer(
path.mm3_per_mm = mm3_per_mm; path.mm3_per_mm = mm3_per_mm;
} }
//FIXME using the support_speed of the 1st object printed. //FIXME using the support_speed of the 1st object printed.
gcode += this->extrude_loop(loop, "skirt", m_config.support_speed.value); gcode += this->extrude_loop(loop, "skirt", m_config.support_speed.get_at(cur_extruder_index()));
} }
m_avoid_crossing_perimeters.use_external_mp(false); m_avoid_crossing_perimeters.use_external_mp(false);
// Allow a straight travel move to the first object point if this is the first layer (but don't in next layers). // Allow a straight travel move to the first object point if this is the first layer (but don't in next layers).
@ -3510,7 +3515,7 @@ GCode::LayerResult GCode::process_layer(
set_origin(unscaled(offset)); set_origin(unscaled(offset));
for (ExtrusionEntity* ee : layer.object()->object_skirt().entities) for (ExtrusionEntity* ee : layer.object()->object_skirt().entities)
//FIXME using the support_speed of the 1st object printed. //FIXME using the support_speed of the 1st object printed.
gcode += this->extrude_entity(*ee, "skirt", m_config.support_speed.value); gcode += this->extrude_entity(*ee, "skirt", m_config.support_speed.get_at(cur_extruder_index()));
} }
} }
@ -3570,7 +3575,7 @@ GCode::LayerResult GCode::process_layer(
this->set_origin(0., 0.); this->set_origin(0., 0.);
m_avoid_crossing_perimeters.use_external_mp(); m_avoid_crossing_perimeters.use_external_mp();
for (const ExtrusionEntity* ee : print.m_supportBrimMap.at(instance_to_print.print_object.id()).entities) { for (const ExtrusionEntity* ee : print.m_supportBrimMap.at(instance_to_print.print_object.id()).entities) {
gcode += this->extrude_entity(*ee, "brim", m_config.support_speed.value); gcode += this->extrude_entity(*ee, "brim", m_config.support_speed.get_at(cur_extruder_index()));
} }
m_avoid_crossing_perimeters.use_external_mp(false); m_avoid_crossing_perimeters.use_external_mp(false);
// Allow a straight travel move to the first object point. // Allow a straight travel move to the first object point.
@ -3611,7 +3616,7 @@ GCode::LayerResult GCode::process_layer(
this->set_origin(0., 0.); this->set_origin(0., 0.);
m_avoid_crossing_perimeters.use_external_mp(); m_avoid_crossing_perimeters.use_external_mp();
for (const ExtrusionEntity* ee : print.m_brimMap.at(instance_to_print.print_object.id()).entities) { for (const ExtrusionEntity* ee : print.m_brimMap.at(instance_to_print.print_object.id()).entities) {
gcode += this->extrude_entity(*ee, "brim", m_config.support_speed.value); gcode += this->extrude_entity(*ee, "brim", m_config.support_speed.get_at(cur_extruder_index()));
} }
m_avoid_crossing_perimeters.use_external_mp(false); m_avoid_crossing_perimeters.use_external_mp(false);
// Allow a straight travel move to the first object point. // Allow a straight travel move to the first object point.
@ -3943,23 +3948,24 @@ double GCode::get_path_speed(const ExtrusionPath &path)
// set speed // set speed
double speed = 0; double speed = 0;
if (path.role() == erPerimeter) { if (path.role() == erPerimeter) {
speed = m_config.get_abs_value("inner_wall_speed"); speed = m_config.inner_wall_speed.get_at(cur_extruder_index());
if (m_config.enable_overhang_speed.value) { if (m_config.enable_overhang_speed.get_at(cur_extruder_index())) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erExternalPerimeter) { } else if (path.role() == erExternalPerimeter) {
speed = m_config.get_abs_value("outer_wall_speed"); speed = m_config.outer_wall_speed.get_at(cur_extruder_index());
if (m_config.enable_overhang_speed.value) { if (m_config.enable_overhang_speed.get_at(cur_extruder_index())) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5) }
speed = m_config.get_abs_value("overhang_totally_speed"); else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5)
speed = m_config.overhang_totally_speed.get_at(cur_extruder_index());
else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) { else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) {
speed = m_config.get_abs_value("bridge_speed"); speed = m_config.bridge_speed.get_at(cur_extruder_index());
} }
auto _mm3_per_mm = path.mm3_per_mm * double(m_curr_print->calib_mode() == CalibMode::Calib_Flow_Rate ? this->config().print_flow_ratio.value : 1); auto _mm3_per_mm = path.mm3_per_mm * double(m_curr_print->calib_mode() == CalibMode::Calib_Flow_Rate ? this->config().print_flow_ratio.value : 1);
@ -3973,7 +3979,7 @@ double GCode::get_path_speed(const ExtrusionPath &path)
if (this->on_first_layer()) { if (this->on_first_layer()) {
// BBS: for solid infill of initial layer, speed can be higher as long as // BBS: for solid infill of initial layer, speed can be higher as long as
// wall lines have be attached // wall lines have be attached
if (path.role() != erBottomSurface) speed = m_config.get_abs_value("initial_layer_speed"); if (path.role() != erBottomSurface) speed = m_config.initial_layer_speed.get_at(cur_extruder_index());
} }
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) { if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
@ -4032,8 +4038,8 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
double small_peri_speed=-1; double small_peri_speed=-1;
// apply the small perimeter speed // apply the small perimeter speed
if (speed==-1 && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.value)) if (speed==-1 && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.get_at(cur_extruder_index())))
small_peri_speed = m_config.small_perimeter_speed.get_abs_value(m_config.outer_wall_speed); small_peri_speed = m_config.small_perimeter_speed.get_at(cur_extruder_index()).get_abs_value(m_config.outer_wall_speed.get_at(cur_extruder_index()));
// extrude along the path // extrude along the path
std::string gcode; std::string gcode;
@ -4121,7 +4127,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
//BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value. //BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value.
if (!this->on_first_layer()) { if (!this->on_first_layer()) {
// reset acceleration // reset acceleration
gcode += m_writer.set_acceleration((unsigned int) (m_config.default_acceleration.value + 0.5)); gcode += m_writer.set_acceleration((unsigned int) (m_config.default_acceleration.get_at(cur_extruder_index()) + 0.5));
if (!this->is_BBL_Printer()) if (!this->is_BBL_Printer())
gcode += m_writer.set_jerk_xy(m_config.default_jerk.value); gcode += m_writer.set_jerk_xy(m_config.default_jerk.value);
} }
@ -4206,7 +4212,7 @@ std::string GCode::extrude_multi_path(ExtrusionMultiPath multipath, std::string
//BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value. //BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value.
if (!this->on_first_layer()) { if (!this->on_first_layer()) {
// reset acceleration // reset acceleration
gcode += m_writer.set_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); gcode += m_writer.set_acceleration((unsigned int) floor(m_config.default_acceleration.get_at(cur_extruder_index()) + 0.5));
if (!this->is_BBL_Printer()) if (!this->is_BBL_Printer())
gcode += m_writer.set_jerk_xy(m_config.default_jerk.value); gcode += m_writer.set_jerk_xy(m_config.default_jerk.value);
} }
@ -4237,7 +4243,7 @@ std::string GCode::extrude_path(ExtrusionPath path, std::string description, dou
//BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value. //BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value.
if (!this->on_first_layer()) { if (!this->on_first_layer()) {
// reset acceleration // reset acceleration
gcode += m_writer.set_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); gcode += m_writer.set_acceleration((unsigned int) floor(m_config.default_acceleration.get_at(cur_extruder_index()) + 0.5));
if (!this->is_BBL_Printer()) if (!this->is_BBL_Printer())
gcode += m_writer.set_jerk_xy(m_config.default_jerk.value); gcode += m_writer.set_jerk_xy(m_config.default_jerk.value);
} }
@ -4295,8 +4301,8 @@ std::string GCode::extrude_support(const ExtrusionEntityCollection &support_fill
std::string gcode; std::string gcode;
if (! support_fills.entities.empty()) { if (! support_fills.entities.empty()) {
const double support_speed = m_config.support_speed.value; const double support_speed = m_config.support_speed.get_at(cur_extruder_index());
const double support_interface_speed = m_config.get_abs_value("support_interface_speed"); const double support_interface_speed = m_config.support_interface_speed.get_at(cur_extruder_index());
for (const ExtrusionEntity *ee : support_fills.entities) { for (const ExtrusionEntity *ee : support_fills.entities) {
ExtrusionRole role = ee->role(); ExtrusionRole role = ee->role();
assert(role == erSupportMaterial || role == erSupportMaterialInterface || role == erSupportTransition); assert(role == erSupportMaterial || role == erSupportMaterialInterface || role == erSupportTransition);
@ -4418,12 +4424,12 @@ double GCode::get_overhang_degree_corr_speed(float normal_speed, double path_deg
int lower_degree_bound = int(path_degree); int lower_degree_bound = int(path_degree);
// BBS: use lower speed of 75%-100% for better cooling // BBS: use lower speed of 75%-100% for better cooling
if (path_degree >= 4 || path_degree == lower_degree_bound) if (path_degree >= 4 || path_degree == lower_degree_bound)
return m_config.get_abs_value(overhang_speed_key_map[lower_degree_bound].c_str()); return m_config.get_abs_value_at(overhang_speed_key_map[lower_degree_bound].c_str(), cur_extruder_index());
int upper_degree_bound = lower_degree_bound + 1; int upper_degree_bound = lower_degree_bound + 1;
double lower_speed_bound = lower_degree_bound == 0 ? normal_speed : m_config.get_abs_value(overhang_speed_key_map[lower_degree_bound].c_str()); double lower_speed_bound = lower_degree_bound == 0 ? normal_speed : m_config.get_abs_value_at(overhang_speed_key_map[lower_degree_bound].c_str(), cur_extruder_index());
double upper_speed_bound = upper_degree_bound == 0 ? normal_speed : m_config.get_abs_value(overhang_speed_key_map[upper_degree_bound].c_str()); double upper_speed_bound = upper_degree_bound == 0 ? normal_speed : m_config.get_abs_value_at(overhang_speed_key_map[upper_degree_bound].c_str(), cur_extruder_index());
lower_speed_bound = lower_speed_bound == 0 ? normal_speed : lower_speed_bound; lower_speed_bound = lower_speed_bound == 0 ? normal_speed : lower_speed_bound;
upper_speed_bound = upper_speed_bound == 0 ? normal_speed : upper_speed_bound; upper_speed_bound = upper_speed_bound == 0 ? normal_speed : upper_speed_bound;
@ -4670,29 +4676,29 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
m_config.apply(m_calib_config); m_config.apply(m_calib_config);
// adjust acceleration // adjust acceleration
if (m_config.default_acceleration.value > 0) { if (m_config.default_acceleration.get_at(cur_extruder_index()) > 0) {
double acceleration; double acceleration;
if (this->on_first_layer() && m_config.initial_layer_acceleration.value > 0) { if (this->on_first_layer() && m_config.initial_layer_acceleration.get_at(cur_extruder_index()) > 0) {
acceleration = m_config.initial_layer_acceleration.value; acceleration = m_config.initial_layer_acceleration.get_at(cur_extruder_index());
#if 0 #if 0
} else if (this->object_layer_over_raft() && m_config.first_layer_acceleration_over_raft.value > 0) { } else if (this->object_layer_over_raft() && m_config.first_layer_acceleration_over_raft.value > 0) {
acceleration = m_config.first_layer_acceleration_over_raft.value; acceleration = m_config.first_layer_acceleration_over_raft.value;
} else if (m_config.bridge_acceleration.value > 0 && is_bridge(path.role())) { } else if (m_config.bridge_acceleration.value > 0 && is_bridge(path.role())) {
acceleration = m_config.bridge_acceleration.value; acceleration = m_config.bridge_acceleration.value;
#endif #endif
} else if (m_config.outer_wall_acceleration.value > 0 } else if (m_config.outer_wall_acceleration.get_at(cur_extruder_index()) > 0
//BBS: FIXME, in fact,we only need to set acceleration for outer wall. But we don't know //BBS: FIXME, in fact,we only need to set acceleration for outer wall. But we don't know
//whether the overhang perimeter is outer or not. So using specific acceleration together. //whether the overhang perimeter is outer or not. So using specific acceleration together.
&& (path.role() == erExternalPerimeter || path.role() == erOverhangPerimeter)) { && (path.role() == erExternalPerimeter || path.role() == erOverhangPerimeter)) {
acceleration = m_config.outer_wall_acceleration.value; acceleration = m_config.outer_wall_acceleration.get_at(cur_extruder_index());
} else if (m_config.top_surface_acceleration.value > 0 && is_top_surface(path.role())) { } else if (m_config.top_surface_acceleration.get_at(cur_extruder_index()) > 0 && is_top_surface(path.role())) {
acceleration = m_config.top_surface_acceleration.value; acceleration = m_config.top_surface_acceleration.get_at(cur_extruder_index());
} else if (m_config.inner_wall_acceleration.value > 0 && path.role() == erPerimeter) { } else if (m_config.inner_wall_acceleration.get_at(cur_extruder_index()) > 0 && path.role() == erPerimeter) {
acceleration = m_config.inner_wall_acceleration.value; acceleration = m_config.inner_wall_acceleration.get_at(cur_extruder_index());
} else if (m_config.get_abs_value("sparse_infill_acceleration") > 0 && (path.role() == erInternalInfill)) { } else if (m_config.get_abs_value_at("sparse_infill_acceleration", cur_extruder_index()) > 0 && (path.role() == erInternalInfill)) {
acceleration = m_config.get_abs_value("sparse_infill_acceleration"); acceleration = m_config.get_abs_value_at("sparse_infill_acceleration", cur_extruder_index());
} else { } else {
acceleration = m_config.default_acceleration.value; acceleration = m_config.default_acceleration.get_at(cur_extruder_index());
} }
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5)); gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
} }
@ -4727,19 +4733,19 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
// set speed // set speed
if (speed == -1) { if (speed == -1) {
if (path.role() == erPerimeter) { if (path.role() == erPerimeter) {
speed = m_config.get_abs_value("inner_wall_speed"); speed = m_config.inner_wall_speed.get_at(cur_extruder_index());
if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0) if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0)
speed = path.smooth_speed; speed = path.smooth_speed;
else if (m_config.enable_overhang_speed.value) { else if (m_config.enable_overhang_speed.get_at(cur_extruder_index())) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erExternalPerimeter) { } else if (path.role() == erExternalPerimeter) {
speed = m_config.get_abs_value("outer_wall_speed"); speed = m_config.outer_wall_speed.get_at(cur_extruder_index());
if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0) if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0)
speed = path.smooth_speed; speed = path.smooth_speed;
else if (m_config.enable_overhang_speed.value) { else if (m_config.enable_overhang_speed.get_at(cur_extruder_index())) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
@ -4748,24 +4754,24 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
} else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5) { } else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5) {
speed = m_config.get_abs_value("overhang_totally_speed"); speed = m_config.get_abs_value("overhang_totally_speed");
} else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) { } else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) {
speed = m_config.get_abs_value("bridge_speed"); speed = m_config.bridge_speed.get_at(cur_extruder_index());
} else if (path.role() == erInternalInfill) { } else if (path.role() == erInternalInfill) {
speed = m_config.get_abs_value("sparse_infill_speed"); speed = m_config.sparse_infill_speed.get_at(cur_extruder_index());
} else if (path.role() == erSolidInfill) { } else if (path.role() == erSolidInfill) {
speed = m_config.get_abs_value("internal_solid_infill_speed"); speed = m_config.internal_solid_infill_speed.get_at(cur_extruder_index());
} else if (path.role() == erTopSolidInfill) { } else if (path.role() == erTopSolidInfill) {
speed = m_config.get_abs_value("top_surface_speed"); speed = m_config.top_surface_speed.get_at(cur_extruder_index());
} else if (path.role() == erIroning) { } else if (path.role() == erIroning) {
speed = m_config.get_abs_value("ironing_speed"); speed = m_config.get_abs_value("ironing_speed");
} else if (path.role() == erBottomSurface) { } else if (path.role() == erBottomSurface) {
speed = m_config.get_abs_value("initial_layer_infill_speed"); speed = m_config.initial_layer_infill_speed.get_at(cur_extruder_index());
} else if (path.role() == erGapFill) { } else if (path.role() == erGapFill) {
speed = m_config.get_abs_value("gap_infill_speed"); speed = m_config.gap_infill_speed.get_at(cur_extruder_index());
} }
else if (path.role() == erSupportMaterial || else if (path.role() == erSupportMaterial ||
path.role() == erSupportMaterialInterface) { path.role() == erSupportMaterialInterface) {
const double support_speed = m_config.support_speed.value; const double support_speed = m_config.support_speed.get_at(cur_extruder_index());
const double support_interface_speed = m_config.get_abs_value("support_interface_speed"); const double support_interface_speed = m_config.support_interface_speed.get_at(cur_extruder_index());
speed = (path.role() == erSupportMaterial) ? support_speed : support_interface_speed; speed = (path.role() == erSupportMaterial) ? support_speed : support_interface_speed;
} else { } else {
throw Slic3r::InvalidArgument("Invalid speed"); throw Slic3r::InvalidArgument("Invalid speed");
@ -4783,7 +4789,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
//BBS: for solid infill of initial layer, speed can be higher as long as //BBS: for solid infill of initial layer, speed can be higher as long as
//wall lines have be attached //wall lines have be attached
if (path.role() != erBottomSurface) if (path.role() != erBottomSurface)
speed = m_config.get_abs_value("initial_layer_speed"); speed = m_config.initial_layer_speed.get_at(cur_extruder_index());
} }
//BBS: remove this config //BBS: remove this config
//else if (this->object_layer_over_raft()) //else if (this->object_layer_over_raft())

View File

@ -332,6 +332,7 @@ private:
//BBS //BBS
void check_placeholder_parser_failed(); void check_placeholder_parser_failed();
size_t cur_extruder_index() const;
void set_last_pos(const Point &pos) { m_last_pos = pos; m_last_pos_defined = true; } void set_last_pos(const Point &pos) { m_last_pos = pos; m_last_pos_defined = true; }
void set_last_scarf_seam_flag(bool flag) { m_last_scarf_seam_flag = flag; } void set_last_scarf_seam_flag(bool flag) { m_last_scarf_seam_flag = flag; }

View File

@ -35,7 +35,7 @@ void CoolingBuffer::reset(const Vec3d &position)
m_current_pos[0] = float(position.x()); m_current_pos[0] = float(position.x());
m_current_pos[1] = float(position.y()); m_current_pos[1] = float(position.y());
m_current_pos[2] = float(position.z()); m_current_pos[2] = float(position.z());
m_current_pos[4] = float(m_config.travel_speed.value); m_current_pos[4] = float(m_config.travel_speed.get_at(get_extruder_index(m_current_extruder)));
m_fan_speed = -1; m_fan_speed = -1;
m_additional_fan_speed = -1; m_additional_fan_speed = -1;
m_current_fan_speed = -1; m_current_fan_speed = -1;

View File

@ -610,7 +610,7 @@ WipeTower::WipeTower(const PrintConfig& config, int plate_idx, Vec3d plate_origi
m_bridging(10.f), m_bridging(10.f),
m_no_sparse_layers(config.wipe_tower_no_sparse_layers), m_no_sparse_layers(config.wipe_tower_no_sparse_layers),
m_gcode_flavor(config.gcode_flavor), m_gcode_flavor(config.gcode_flavor),
m_travel_speed(config.travel_speed), m_travel_speed(config.travel_speed.get_at(get_extruder_index(initial_tool))),
m_current_tool(initial_tool), m_current_tool(initial_tool),
//wipe_volumes(flush_matrix) //wipe_volumes(flush_matrix)
m_wipe_volume(prime_volume), m_wipe_volume(prime_volume),
@ -620,7 +620,7 @@ WipeTower::WipeTower(const PrintConfig& config, int plate_idx, Vec3d plate_origi
// it is taken over following default. Speeds from config are not // it is taken over following default. Speeds from config are not
// easily accessible here. // easily accessible here.
const float default_speed = 60.f; const float default_speed = 60.f;
m_first_layer_speed = config.get_abs_value("initial_layer_speed"); m_first_layer_speed = config.initial_layer_speed.get_at(get_extruder_index(initial_tool));
if (m_first_layer_speed == 0.f) // just to make sure autospeed doesn't break it. if (m_first_layer_speed == 0.f) // just to make sure autospeed doesn't break it.
m_first_layer_speed = default_speed / 2.f; m_first_layer_speed = default_speed / 2.f;

View File

@ -343,7 +343,7 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com
GCodeG1Formatter w; GCodeG1Formatter w;
w.emit_xy(point_on_plate); w.emit_xy(point_on_plate);
w.emit_f(this->config.travel_speed.value * 60.0); w.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
//BBS //BBS
w.emit_comment(GCodeWriter::full_gcode_comment, comment); w.emit_comment(GCodeWriter::full_gcode_comment, comment);
return w.string(); return w.string();
@ -403,7 +403,7 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source;
GCodeG1Formatter w0; GCodeG1Formatter w0;
w0.emit_xyz(slope_top_point); w0.emit_xyz(slope_top_point);
w0.emit_f(this->config.travel_speed.value * 60.0); w0.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
//BBS //BBS
w0.emit_comment(GCodeWriter::full_gcode_comment, "slope lift Z"); w0.emit_comment(GCodeWriter::full_gcode_comment, "slope lift Z");
slop_move = w0.string(); slop_move = w0.string();
@ -418,13 +418,13 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
GCodeG1Formatter w0; GCodeG1Formatter w0;
if (this->is_current_position_clear()) { if (this->is_current_position_clear()) {
w0.emit_xyz(target); w0.emit_xyz(target);
w0.emit_f(this->config.travel_speed.value * 60.0); w0.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
w0.emit_comment(GCodeWriter::full_gcode_comment, comment); w0.emit_comment(GCodeWriter::full_gcode_comment, comment);
xy_z_move = w0.string(); xy_z_move = w0.string();
} }
else { else {
w0.emit_xy(Vec2d(target.x(), target.y())); w0.emit_xy(Vec2d(target.x(), target.y()));
w0.emit_f(this->config.travel_speed.value * 60.0); w0.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
w0.emit_comment(GCodeWriter::full_gcode_comment, comment); w0.emit_comment(GCodeWriter::full_gcode_comment, comment);
xy_z_move = w0.string() + _travel_to_z(target.z(), comment); xy_z_move = w0.string() + _travel_to_z(target.z(), comment);
} }
@ -458,13 +458,13 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
{ {
//force to move xy first then z after filament change //force to move xy first then z after filament change
w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y()));
w.emit_f(this->config.travel_speed.value * 60.0); w.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
w.emit_comment(GCodeWriter::full_gcode_comment, comment); w.emit_comment(GCodeWriter::full_gcode_comment, comment);
out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); out_string = w.string() + _travel_to_z(point_on_plate.z(), comment);
} else { } else {
GCodeG1Formatter w; GCodeG1Formatter w;
w.emit_xyz(point_on_plate); w.emit_xyz(point_on_plate);
w.emit_f(this->config.travel_speed.value * 60.0); w.emit_f(this->config.travel_speed.get_at(get_extruder_index(extruder()->id())) * 60.0);
w.emit_comment(GCodeWriter::full_gcode_comment, comment); w.emit_comment(GCodeWriter::full_gcode_comment, comment);
out_string = w.string(); out_string = w.string();
} }
@ -497,9 +497,9 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment)
{ {
m_pos(2) = z; m_pos(2) = z;
double speed = this->config.travel_speed_z.value; double speed = this->config.travel_speed_z.get_at(get_extruder_index(extruder()->id()));
if (speed == 0.) if (speed == 0.)
speed = this->config.travel_speed.value; speed = this->config.travel_speed.get_at(get_extruder_index(extruder()->id()));
GCodeG1Formatter w; GCodeG1Formatter w;
w.emit_z(z); w.emit_z(z);
@ -513,9 +513,9 @@ std::string GCodeWriter::_spiral_travel_to_z(double z, const Vec2d &ij_offset, c
{ {
m_pos(2) = z; m_pos(2) = z;
double speed = this->config.travel_speed_z.value; double speed = this->config.travel_speed_z.get_at(get_extruder_index(extruder()->id()));
if (speed == 0.) if (speed == 0.)
speed = this->config.travel_speed.value; speed = this->config.travel_speed.get_at(get_extruder_index(extruder()->id()));
std::string output = "G17\n"; std::string output = "G17\n";
GCodeG2G3Formatter w(true); GCodeG2G3Formatter w(true);

View File

@ -168,9 +168,9 @@ void Layer::make_perimeters()
const PrintRegionConfig &other_config = other_layerm->region().config(); const PrintRegionConfig &other_config = other_layerm->region().config();
if (config.wall_filament == other_config.wall_filament if (config.wall_filament == other_config.wall_filament
&& config.wall_loops == other_config.wall_loops && config.wall_loops == other_config.wall_loops
&& config.inner_wall_speed == other_config.inner_wall_speed && config.inner_wall_speed.get_at(get_extruder_index(config.wall_filament)) == other_config.inner_wall_speed.get_at(get_extruder_index(config.wall_filament))
&& config.outer_wall_speed == other_config.outer_wall_speed && config.outer_wall_speed.get_at(get_extruder_index(config.wall_filament)) == other_config.outer_wall_speed.get_at(get_extruder_index(config.wall_filament))
&& config.gap_infill_speed.value == other_config.gap_infill_speed.value && config.gap_infill_speed.get_at(get_extruder_index(config.wall_filament)) == other_config.gap_infill_speed.get_at(get_extruder_index(config.wall_filament))
&& config.detect_overhang_wall == other_config.detect_overhang_wall && config.detect_overhang_wall == other_config.detect_overhang_wall
&& config.filter_out_gap_fill.value == other_config.filter_out_gap_fill.value && config.filter_out_gap_fill.value == other_config.filter_out_gap_fill.value
&& config.opt_serialize("inner_wall_line_width") == other_config.opt_serialize("inner_wall_line_width") && config.opt_serialize("inner_wall_line_width") == other_config.opt_serialize("inner_wall_line_width")

View File

@ -3511,32 +3511,34 @@ const Transform3d &ModelInstance::get_matrix(bool dont_translate, bool dont_rota
void Model::setPrintSpeedTable(const DynamicPrintConfig& config, const PrintConfig& print_config) { void Model::setPrintSpeedTable(const DynamicPrintConfig& config, const PrintConfig& print_config) {
//Slic3r::DynamicPrintConfig config = wxGetApp().preset_bundle->full_config(); //Slic3r::DynamicPrintConfig config = wxGetApp().preset_bundle->full_config();
printSpeedMap.maxSpeed = 0; printSpeedMap.maxSpeed = 0;
// todo multi_extruders: the following parameters need get exact filament id
if (config.has("inner_wall_speed")) { if (config.has("inner_wall_speed")) {
printSpeedMap.perimeterSpeed = config.opt_float("inner_wall_speed"); printSpeedMap.perimeterSpeed = config.opt_float_nullable("inner_wall_speed", 0);
if (printSpeedMap.perimeterSpeed > printSpeedMap.maxSpeed) if (printSpeedMap.perimeterSpeed > printSpeedMap.maxSpeed)
printSpeedMap.maxSpeed = printSpeedMap.perimeterSpeed; printSpeedMap.maxSpeed = printSpeedMap.perimeterSpeed;
} }
if (config.has("outer_wall_speed")) { if (config.has("outer_wall_speed")) {
printSpeedMap.externalPerimeterSpeed = config.opt_float("outer_wall_speed"); printSpeedMap.externalPerimeterSpeed = config.opt_float_nullable("outer_wall_speed", 0);
printSpeedMap.maxSpeed = std::max(printSpeedMap.maxSpeed, printSpeedMap.externalPerimeterSpeed); printSpeedMap.maxSpeed = std::max(printSpeedMap.maxSpeed, printSpeedMap.externalPerimeterSpeed);
} }
if (config.has("sparse_infill_speed")) { if (config.has("sparse_infill_speed")) {
printSpeedMap.infillSpeed = config.opt_float("sparse_infill_speed"); printSpeedMap.infillSpeed = config.opt_float_nullable("sparse_infill_speed", 0);
if (printSpeedMap.infillSpeed > printSpeedMap.maxSpeed) if (printSpeedMap.infillSpeed > printSpeedMap.maxSpeed)
printSpeedMap.maxSpeed = printSpeedMap.infillSpeed; printSpeedMap.maxSpeed = printSpeedMap.infillSpeed;
} }
if (config.has("internal_solid_infill_speed")) { if (config.has("internal_solid_infill_speed")) {
printSpeedMap.solidInfillSpeed = config.opt_float("internal_solid_infill_speed"); printSpeedMap.solidInfillSpeed = config.opt_float_nullable("internal_solid_infill_speed", 0);
if (printSpeedMap.solidInfillSpeed > printSpeedMap.maxSpeed) if (printSpeedMap.solidInfillSpeed > printSpeedMap.maxSpeed)
printSpeedMap.maxSpeed = printSpeedMap.solidInfillSpeed; printSpeedMap.maxSpeed = printSpeedMap.solidInfillSpeed;
} }
if (config.has("top_surface_speed")) { if (config.has("top_surface_speed")) {
printSpeedMap.topSolidInfillSpeed = config.opt_float("top_surface_speed"); printSpeedMap.topSolidInfillSpeed = config.opt_float_nullable("top_surface_speed", 0);
if (printSpeedMap.topSolidInfillSpeed > printSpeedMap.maxSpeed) if (printSpeedMap.topSolidInfillSpeed > printSpeedMap.maxSpeed)
printSpeedMap.maxSpeed = printSpeedMap.topSolidInfillSpeed; printSpeedMap.maxSpeed = printSpeedMap.topSolidInfillSpeed;
} }
if (config.has("support_speed")) { if (config.has("support_speed")) {
printSpeedMap.supportSpeed = config.opt_float("support_speed"); printSpeedMap.supportSpeed = config.opt_float_nullable("support_speed", 0);
if (printSpeedMap.supportSpeed > printSpeedMap.maxSpeed) if (printSpeedMap.supportSpeed > printSpeedMap.maxSpeed)
printSpeedMap.maxSpeed = printSpeedMap.supportSpeed; printSpeedMap.maxSpeed = printSpeedMap.supportSpeed;
@ -3763,20 +3765,21 @@ double Model::findMaxSpeed(const ModelObject* object) {
double supportSpeedObj = Model::printSpeedMap.supportSpeed; double supportSpeedObj = Model::printSpeedMap.supportSpeed;
double smallPerimeterSpeedObj = Model::printSpeedMap.smallPerimeterSpeed; double smallPerimeterSpeedObj = Model::printSpeedMap.smallPerimeterSpeed;
for (std::string objectKey : objectKeys) { for (std::string objectKey : objectKeys) {
// todo multi_extruders:
if (objectKey == "inner_wall_speed"){ if (objectKey == "inner_wall_speed"){
perimeterSpeedObj = object->config.opt_float(objectKey); perimeterSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
externalPerimeterSpeedObj = Model::printSpeedMap.externalPerimeterSpeed / Model::printSpeedMap.perimeterSpeed * perimeterSpeedObj; externalPerimeterSpeedObj = Model::printSpeedMap.externalPerimeterSpeed / Model::printSpeedMap.perimeterSpeed * perimeterSpeedObj;
} }
if (objectKey == "sparse_infill_speed") if (objectKey == "sparse_infill_speed")
infillSpeedObj = object->config.opt_float(objectKey); infillSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
if (objectKey == "internal_solid_infill_speed") if (objectKey == "internal_solid_infill_speed")
solidInfillSpeedObj = object->config.opt_float(objectKey); solidInfillSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
if (objectKey == "top_surface_speed") if (objectKey == "top_surface_speed")
topSolidInfillSpeedObj = object->config.opt_float(objectKey); topSolidInfillSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
if (objectKey == "support_speed") if (objectKey == "support_speed")
supportSpeedObj = object->config.opt_float(objectKey); supportSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
if (objectKey == "outer_wall_speed") if (objectKey == "outer_wall_speed")
externalPerimeterSpeedObj = object->config.opt_float(objectKey); externalPerimeterSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
if (objectKey == "small_perimeter_speed") if (objectKey == "small_perimeter_speed")
smallPerimeterSpeedObj = object->config.opt_float(objectKey); smallPerimeterSpeedObj = object->config.opt_float(objectKey);
} }

View File

@ -1495,7 +1495,7 @@ static inline std::vector<std::vector<ExPolygons>> mmu_segmentation_top_and_bott
out.extrusion_width = std::max<float>(out.extrusion_width, outer_wall_line_width); out.extrusion_width = std::max<float>(out.extrusion_width, outer_wall_line_width);
out.top_shell_layers = std::max<int>(out.top_shell_layers, config.top_shell_layers); out.top_shell_layers = std::max<int>(out.top_shell_layers, config.top_shell_layers);
out.bottom_shell_layers = std::max<int>(out.bottom_shell_layers, config.bottom_shell_layers); out.bottom_shell_layers = std::max<int>(out.bottom_shell_layers, config.bottom_shell_layers);
out.small_region_threshold = config.gap_infill_speed.value > 0 ? out.small_region_threshold = config.gap_infill_speed.get_at(get_extruder_index(config.wall_filament - 1)) > 0 ?
// Gap fill enabled. Enable a single line of 1/2 extrusion width. // Gap fill enabled. Enable a single line of 1/2 extrusion width.
0.5f * outer_wall_line_width : 0.5f * outer_wall_line_width :
// Gap fill disabled. Enable two lines slightly overlapping. // Gap fill disabled. Enable two lines slightly overlapping.

View File

@ -523,7 +523,8 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
remain_polines = diff_pl_2({to_polyline(polygon)}, lower_polygons_series_clipped); remain_polines = diff_pl_2({to_polyline(polygon)}, lower_polygons_series_clipped);
bool detect_overhang_degree = perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None; bool detect_overhang_degree = perimeter_generator.config->enable_overhang_speed.get_at(get_extruder_index(perimeter_generator.config->wall_filament - 1))
&& perimeter_generator.config->fuzzy_skin == FuzzySkinType::None;
//BBS: fuzziy skin may generate a line that approximates a point, which can cause the clipper to get empty results //BBS: fuzziy skin may generate a line that approximates a point, which can cause the clipper to get empty results
if (loop.fuzzify && remain_polines.empty() && inside_polines.empty()) { if (loop.fuzzify && remain_polines.empty() && inside_polines.empty()) {
@ -931,7 +932,8 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
extrusion_paths_append(temp_paths, clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctIntersection), role, extrusion_paths_append(temp_paths, clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctIntersection), role,
is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow); is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
if (perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) { if (perimeter_generator.config->enable_overhang_speed.get_at(get_extruder_index(perimeter_generator.config->wall_filament - 1))
&& perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) {
Flow flow = is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow; Flow flow = is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow;
std::map<double, std::vector<Polygons>> clipper_serise; std::map<double, std::vector<Polygons>> clipper_serise;
@ -1030,7 +1032,8 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
chain_and_reorder_extrusion_paths(paths, &start_point); chain_and_reorder_extrusion_paths(paths, &start_point);
if (perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) { if (perimeter_generator.config->enable_overhang_speed.get_at(get_extruder_index(perimeter_generator.config->wall_filament - 1))
&& perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) {
// BBS: filter the speed // BBS: filter the speed
smooth_overhang_level(paths); smooth_overhang_level(paths);
} }
@ -1119,7 +1122,7 @@ void PerimeterGenerator::process_classic()
// internal flow which is unrelated. // internal flow which is unrelated.
coord_t min_spacing = coord_t(perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE)); coord_t min_spacing = coord_t(perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE));
coord_t ext_min_spacing = coord_t(ext_perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE)); coord_t ext_min_spacing = coord_t(ext_perimeter_spacing * (1 - INSET_OVERLAP_TOLERANCE));
bool has_gap_fill = this->config->gap_infill_speed.value > 0; bool has_gap_fill = this->config->gap_infill_speed.get_at(get_extruder_index(this->config->wall_filament - 1)) > 0;
// BBS: this flow is for smaller external perimeter for small area // BBS: this flow is for smaller external perimeter for small area
coord_t ext_min_spacing_smaller = coord_t(ext_perimeter_spacing * (1 - SMALLER_EXT_INSET_OVERLAP_TOLERANCE)); coord_t ext_min_spacing_smaller = coord_t(ext_perimeter_spacing * (1 - SMALLER_EXT_INSET_OVERLAP_TOLERANCE));

View File

@ -808,8 +808,58 @@ namespace client
OptWithPos<Iterator> &opt, OptWithPos<Iterator> &opt,
expr<Iterator> &output) expr<Iterator> &output)
{ {
if (opt.opt->is_vector()) if (opt.opt->is_vector()) {
ctx->throw_exception("Referencing a vector variable when scalar is expected", opt.it_range); switch (opt.opt->type()) {
case coFloats: {
const ConfigOptionFloatsNullable* opt_floats = static_cast<const ConfigOptionFloatsNullable *>(opt.opt);
if (opt_floats->size() == 1) { // old version
output.set_d(static_cast<const ConfigOptionFloatsNullable *>(opt.opt)->get_at(0));
}
else {
output.set_d(static_cast<const ConfigOptionFloatsNullable *>(opt.opt)->get_at(get_extruder_index(ctx->current_extruder_id)));
}
break;
}
case coFloatsOrPercents: {
const ConfigOptionFloatsOrPercentsNullable * opt_floats = static_cast<const ConfigOptionFloatsOrPercentsNullable *>(opt.opt);
size_t index = 0; // old version only one value
if (opt_floats->size() > 1) {
index = get_extruder_index(ctx->current_extruder_id);
}
std::string opt_key(opt.it_range.begin(), opt.it_range.end());
if (!opt_floats->get_at(index).percent) {
// Not a percent, just return the value.
output.set_d(opt_floats->get_at(index).value);
} else {
// Resolve dependencies using the "ratio_over" link to a parent value.
const ConfigOptionDef *opt_def = print_config_def.get(opt_key);
assert(opt_def != nullptr);
assert(opt_def->type() == coFloatsOrPercents);
FloatOrPercent opt_value = opt_floats->get_at(index);
double v = opt_value.value;
if (opt_value.percent) {
v *= 0.01;
while (true) {
const ConfigOption *opt_parent = opt_def->ratio_over.empty() ? nullptr : ctx->resolve_symbol(opt_def->ratio_over);
if (opt_parent == nullptr) {
ctx->throw_exception("FloatOrPercentNullable variable failed to resolve the \"ratio_over\" dependencies", opt.it_range);
}
if (opt_parent->type() == coFloat || opt_parent->type() == coFloatOrPercent) {
v *= opt_parent->getFloat();
if (opt_parent->type() == coFloat || !static_cast<const ConfigOptionFloatOrPercent *>(opt_parent)->percent) break;
v *= 0.01; // percent to ratio
}
}
}
output.set_d(v);
}
break;
}
default: ctx->throw_exception("Unknown scalar variable type", opt.it_range);
}
}
else {
switch (opt.opt->type()) { switch (opt.opt->type()) {
case coFloat: output.set_d(opt.opt->getFloat()); break; case coFloat: output.set_d(opt.opt->getFloat()); break;
case coInt: output.set_i(opt.opt->getInt()); break; case coInt: output.set_i(opt.opt->getInt()); break;
@ -860,6 +910,8 @@ namespace client
default: default:
ctx->throw_exception("Unknown scalar variable type", opt.it_range); ctx->throw_exception("Unknown scalar variable type", opt.it_range);
} }
}
output.it_range = opt.it_range; output.it_range = opt.it_range;
} }

View File

@ -898,14 +898,14 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Use only one wall on the first layer of model"); def->tooltip = L("Use only one wall on the first layer of model");
def->set_default_value(new ConfigOptionBool(false)); def->set_default_value(new ConfigOptionBool(false));
def = this->add("enable_overhang_speed", coBool); def = this->add("enable_overhang_speed", coBools);
def->label = L("Slow down for overhang"); def->label = L("Slow down for overhang");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Enable this option to slow printing down for different overhang degree"); def->tooltip = L("Enable this option to slow printing down for different overhang degree");
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool{ true }); def->set_default_value(new ConfigOptionBoolsNullable{ true });
def = this->add("overhang_1_4_speed", coFloat); def = this->add("overhang_1_4_speed", coFloats);
def->label = "(10%, 25%)"; def->label = "(10%, 25%)";
def->category = L("Speed"); def->category = L("Speed");
def->full_label = "(10%, 25%)"; def->full_label = "(10%, 25%)";
@ -914,9 +914,9 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloatsNullable{0});
def = this->add("overhang_2_4_speed", coFloat); def = this->add("overhang_2_4_speed", coFloats);
def->label = "[25%, 50%)"; def->label = "[25%, 50%)";
def->category = L("Speed"); def->category = L("Speed");
def->full_label = "[25%, 50%)"; def->full_label = "[25%, 50%)";
@ -925,9 +925,9 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloatsNullable{0});
def = this->add("overhang_3_4_speed", coFloat); def = this->add("overhang_3_4_speed", coFloats);
def->label = "[50%, 75%)"; def->label = "[50%, 75%)";
def->category = L("Speed"); def->category = L("Speed");
def->full_label = "[50%, 75%)"; def->full_label = "[50%, 75%)";
@ -935,9 +935,9 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloatsNullable{0});
def = this->add("overhang_4_4_speed", coFloat); def = this->add("overhang_4_4_speed", coFloats);
def->label = "[75%, 100%)"; def->label = "[75%, 100%)";
def->category = L("Speed"); def->category = L("Speed");
def->full_label = "[75%, 100%)"; def->full_label = "[75%, 100%)";
@ -945,25 +945,26 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloatsNullable{0});
def = this->add("overhang_totally_speed", coFloat); def = this->add("overhang_totally_speed", coFloats);
def->label = L("over 100% wall (not bridge)"); def->label = L("over 100% wall (not bridge)");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed for line of wall which has degree of overhang over 100% line width, but the wall is not a bridge wall."); def->tooltip = L("Speed for line of wall which has degree of overhang over 100% line width, but the wall is not a bridge wall.");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat{24}); def->nullable = true;
def->set_default_value(new ConfigOptionFloatsNullable{ 24 });
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloats);
def->label = L("Bridge"); def->label = L("Bridge");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of bridge and completely overhang wall"); def->tooltip = L("Speed of bridge and completely overhang wall");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(25)); def->set_default_value(new ConfigOptionFloatsNullable{25});
def = this->add("brim_width", coFloat); def = this->add("brim_width", coFloat);
def->label = L("Brim width"); def->label = L("Brim width");
@ -1088,13 +1089,13 @@ void PrintConfigDef::init_fff_params()
"This can improve the cooling quality for needle and small details"); "This can improve the cooling quality for needle and small details");
def->set_default_value(new ConfigOptionBools { true }); def->set_default_value(new ConfigOptionBools { true });
def = this->add("default_acceleration", coFloat); def = this->add("default_acceleration", coFloats);
def->label = L("Normal printing"); def->label = L("Normal printing");
def->tooltip = L("The default acceleration of both normal printing and travel except initial layer"); def->tooltip = L("The default acceleration of both normal printing and travel except initial layer");
def->sidetext = "mm/s²"; def->sidetext = "mm/s²";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(500.0)); def->set_default_value(new ConfigOptionFloatsNullable{500.0});
def = this->add("default_filament_profile", coStrings); def = this->add("default_filament_profile", coStrings);
def->label = L("Default filament profile"); def->label = L("Default filament profile");
@ -1265,7 +1266,7 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloat(0));
def = this->add("outer_wall_speed", coFloat); def = this->add("outer_wall_speed", coFloats);
def->label = L("Outer wall"); def->label = L("Outer wall");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of outer wall which is outermost and visible. " def->tooltip = L("Speed of outer wall which is outermost and visible. "
@ -1273,10 +1274,10 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(60)); def->set_default_value(new ConfigOptionFloatsNullable{60});
def = this->add("small_perimeter_speed", coFloatOrPercent); def = this->add("small_perimeter_speed", coFloatsOrPercents);
def->label = L("Small perimeters"); def->label = L("Small perimeters");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("This setting will affect the speed of perimeters having radius <= small perimeter threshold" def->tooltip = L("This setting will affect the speed of perimeters having radius <= small perimeter threshold"
@ -1286,16 +1287,16 @@ void PrintConfigDef::init_fff_params()
def->ratio_over = "outer_wall_speed"; def->ratio_over = "outer_wall_speed";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); def->set_default_value(new ConfigOptionFloatsOrPercentsNullable{FloatOrPercent(50, true)});
def = this->add("small_perimeter_threshold", coFloat); def = this->add("small_perimeter_threshold", coFloats);
def->label = L("Small perimter threshold"); def->label = L("Small perimter threshold");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("This sets the threshold for small perimeter length. Default threshold is 0mm"); def->tooltip = L("This sets the threshold for small perimeter length. Default threshold is 0mm");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloatsNullable{0});
def = this->add("wall_sequence", coEnum); def = this->add("wall_sequence", coEnum);
def->label = L("Order of walls"); def->label = L("Order of walls");
@ -1755,46 +1756,46 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back(L("Cross Hatch")); def->enum_labels.push_back(L("Cross Hatch"));
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipCubic)); def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipCubic));
def = this->add("top_surface_acceleration", coFloat); def = this->add("top_surface_acceleration", coFloats);
def->label = L("Top surface"); def->label = L("Top surface");
def->tooltip = L("Acceleration of top surface infill. Using a lower value may improve top surface quality"); def->tooltip = L("Acceleration of top surface infill. Using a lower value may improve top surface quality");
def->sidetext = "mm/s²"; def->sidetext = "mm/s²";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(500)); def->set_default_value(new ConfigOptionFloats{500});
def = this->add("outer_wall_acceleration", coFloat); def = this->add("outer_wall_acceleration", coFloats);
def->label = L("Outer wall"); def->label = L("Outer wall");
def->tooltip = L("Acceleration of outer wall. Using a lower value can improve quality"); def->tooltip = L("Acceleration of outer wall. Using a lower value can improve quality");
def->sidetext = "mm/s²"; def->sidetext = "mm/s²";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(500)); def->set_default_value(new ConfigOptionFloatsNullable{500});
def = this->add("inner_wall_acceleration", coFloat); def = this->add("inner_wall_acceleration", coFloats);
def->label = L("Inner wall"); def->label = L("Inner wall");
def->tooltip = L("Acceleration of inner walls. 0 means using normal printing acceleration"); def->tooltip = L("Acceleration of inner walls. 0 means using normal printing acceleration");
def->sidetext = "mm/s²"; def->sidetext = "mm/s²";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloats{0});
def = this->add("sparse_infill_acceleration", coFloatOrPercent); def = this->add("sparse_infill_acceleration", coFloatsOrPercents);
def->label = L("Sparse infill"); def->label = L("Sparse infill");
def->tooltip = L("Acceleration of sparse infill. If the value is expressed as a percentage (e.g. 100%), it will be calculated based on the default acceleration."); def->tooltip = L("Acceleration of sparse infill. If the value is expressed as a percentage (e.g. 100%), it will be calculated based on the default acceleration.");
def->sidetext = L("mm/s² or %"); def->sidetext = L("mm/s² or %");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->ratio_over = "default_acceleration"; def->ratio_over = "default_acceleration";
def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def->set_default_value(new ConfigOptionFloatsOrPercents{FloatOrPercent(100, true)});
def = this->add("initial_layer_acceleration", coFloat); def = this->add("initial_layer_acceleration", coFloats);
def->label = L("Initial layer"); def->label = L("Initial layer");
def->tooltip = L("Acceleration of initial layer. Using a lower value can improve build plate adhensive"); def->tooltip = L("Acceleration of initial layer. Using a lower value can improve build plate adhensive");
def->sidetext = "mm/s²"; def->sidetext = "mm/s²";
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(300)); def->set_default_value(new ConfigOptionFloatsNullable{300});
def = this->add("accel_to_decel_enable", coBool); def = this->add("accel_to_decel_enable", coBool);
def->label = L("Enable accel_to_decel"); def->label = L("Enable accel_to_decel");
@ -1892,21 +1893,21 @@ void PrintConfigDef::init_fff_params()
// "Note that this option only takes effect if no prime tower is generated in current plate."); // "Note that this option only takes effect if no prime tower is generated in current plate.");
//def->set_default_value(new ConfigOptionBool(0)); //def->set_default_value(new ConfigOptionBool(0));
def = this->add("initial_layer_speed", coFloat); def = this->add("initial_layer_speed", coFloats);
def->label = L("Initial layer"); def->label = L("Initial layer");
def->tooltip = L("Speed of initial layer except the solid infill part"); def->tooltip = L("Speed of initial layer except the solid infill part");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(30)); def->set_default_value(new ConfigOptionFloatsNullable{30});
def = this->add("initial_layer_infill_speed", coFloat); def = this->add("initial_layer_infill_speed", coFloats);
def->label = L("Initial layer infill"); def->label = L("Initial layer infill");
def->tooltip = L("Speed of solid infill part of initial layer"); def->tooltip = L("Speed of solid infill part of initial layer");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 1; def->min = 1;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(60.0)); def->set_default_value(new ConfigOptionFloatsNullable{60.0});
def = this->add("nozzle_temperature_initial_layer", coInts); def = this->add("nozzle_temperature_initial_layer", coInts);
def->label = L("Initial layer"); def->label = L("Initial layer");
@ -1971,14 +1972,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comDevelop; def->mode = comDevelop;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloat(0));
def = this->add("gap_infill_speed", coFloat); def = this->add("gap_infill_speed", coFloats);
def->label = L("Gap infill"); def->label = L("Gap infill");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of gap infill. Gap usually has irregular line width and should be printed more slowly"); def->tooltip = L("Speed of gap infill. Gap usually has irregular line width and should be printed more slowly");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(30)); def->set_default_value(new ConfigOptionFloatsNullable{30});
// BBS // BBS
def = this->add("precise_z_height", coBool); def = this->add("precise_z_height", coBool);
@ -2215,14 +2216,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercent(15)); def->set_default_value(new ConfigOptionPercent(15));
def = this->add("sparse_infill_speed", coFloat); def = this->add("sparse_infill_speed", coFloats);
def->label = L("Sparse infill"); def->label = L("Sparse infill");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of internal sparse infill"); def->tooltip = L("Speed of internal sparse infill");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(100)); def->set_default_value(new ConfigOptionFloatsNullable{100});
def = this->add("inherits", coString); def = this->add("inherits", coString);
//def->label = L("Inherits profile"); //def->label = L("Inherits profile");
@ -2716,7 +2717,7 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.4)); def->set_default_value(new ConfigOptionFloat(0.4));
def = this->add("inner_wall_speed", coFloat); def = this->add("inner_wall_speed", coFloats);
def->label = L("Inner wall"); def->label = L("Inner wall");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of inner wall"); def->tooltip = L("Speed of inner wall");
@ -2724,7 +2725,7 @@ void PrintConfigDef::init_fff_params()
def->aliases = { "perimeter_feed_rate" }; def->aliases = { "perimeter_feed_rate" };
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(60)); def->set_default_value(new ConfigOptionFloatsNullable{60});
def = this->add("wall_loops", coInt); def = this->add("wall_loops", coInt);
def->label = L("Wall loops"); def->label = L("Wall loops");
@ -3132,14 +3133,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.4)); def->set_default_value(new ConfigOptionFloat(0.4));
def = this->add("internal_solid_infill_speed", coFloat); def = this->add("internal_solid_infill_speed", coFloats);
def->label = L("Internal solid infill"); def->label = L("Internal solid infill");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of internal solid infill, not the top and bottom surface"); def->tooltip = L("Speed of internal solid infill, not the top and bottom surface");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(100)); def->set_default_value(new ConfigOptionFloatsNullable{100});
def = this->add("spiral_mode", coBool); def = this->add("spiral_mode", coBool);
def->label = L("Spiral vase"); def->label = L("Spiral vase");
@ -3466,14 +3467,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comDevelop; def->mode = comDevelop;
def->set_default_value(new ConfigOptionFloat(0.5)); def->set_default_value(new ConfigOptionFloat(0.5));
def = this->add("support_interface_speed", coFloat); def = this->add("support_interface_speed", coFloats);
def->label = L("Support interface"); def->label = L("Support interface");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of support interface"); def->tooltip = L("Speed of support interface");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 1; def->min = 1;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(80)); def->set_default_value(new ConfigOptionFloatsNullable{80});
def = this->add("support_base_pattern", coEnum); def = this->add("support_base_pattern", coEnum);
def->label = L("Base pattern"); def->label = L("Base pattern");
@ -3532,14 +3533,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloat(0));
def = this->add("support_speed", coFloat); def = this->add("support_speed", coFloats);
def->label = L("Support"); def->label = L("Support");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of support"); def->tooltip = L("Speed of support");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(80)); def->set_default_value(new ConfigOptionFloatsNullable{ 80 });
def = this->add("support_style", coEnum); def = this->add("support_style", coEnum);
def->label = L("Style"); def->label = L("Style");
@ -3707,14 +3708,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.4)); def->set_default_value(new ConfigOptionFloat(0.4));
def = this->add("top_surface_speed", coFloat); def = this->add("top_surface_speed", coFloats);
def->label = L("Top surface"); def->label = L("Top surface");
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Speed of top surface infill which is solid"); def->tooltip = L("Speed of top surface infill which is solid");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(100)); def->set_default_value(new ConfigOptionFloatsNullable{100});
def = this->add("top_shell_layers", coInt); def = this->add("top_shell_layers", coInt);
def->label = L("Top shell layers"); def->label = L("Top shell layers");
@ -3737,15 +3738,15 @@ void PrintConfigDef::init_fff_params()
def->min = 0; def->min = 0;
def->set_default_value(new ConfigOptionFloat(0.6)); def->set_default_value(new ConfigOptionFloat(0.6));
def = this->add("travel_speed", coFloat); def = this->add("travel_speed", coFloats);
def->label = L("Travel"); def->label = L("Travel");
def->tooltip = L("Speed of travel which is faster and without extrusion"); def->tooltip = L("Speed of travel which is faster and without extrusion");
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 1; def->min = 1;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(120)); def->set_default_value(new ConfigOptionFloatsNullable{120});
def = this->add("travel_speed_z", coFloat); def = this->add("travel_speed_z", coFloats);
//def->label = L("Z travel"); //def->label = L("Z travel");
//def->tooltip = L("Speed of vertical travel along z axis. " //def->tooltip = L("Speed of vertical travel along z axis. "
// "This is typically lower because build plate or gantry is hard to be moved. " // "This is typically lower because build plate or gantry is hard to be moved. "
@ -3753,7 +3754,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm/s"); def->sidetext = L("mm/s");
def->min = 0; def->min = 0;
def->mode = comDevelop; def->mode = comDevelop;
def->set_default_value(new ConfigOptionFloat(0.)); def->set_default_value(new ConfigOptionFloatsNullable{0.});
def = this->add("use_relative_e_distances", coBool); def = this->add("use_relative_e_distances", coBool);
def->label = L("Use relative E distances"); def->label = L("Use relative E distances");

View File

@ -355,6 +355,12 @@ static std::string get_bed_temp_1st_layer_key(const BedType type)
return ""; return "";
} }
static size_t get_extruder_index(unsigned int filament_id)
{
// todo:
return 0;
}
#define CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NAME) \ #define CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NAME) \
template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names(); \ template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names(); \
template<> const t_config_enum_values& ConfigOptionEnum<NAME>::get_enum_values(); template<> const t_config_enum_values& ConfigOptionEnum<NAME>::get_enum_values();
@ -749,13 +755,13 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionInt, support_interface_bottom_layers)) ((ConfigOptionInt, support_interface_bottom_layers))
// Spacing between interface lines (the hatching distance). Set zero to get a solid interface. // Spacing between interface lines (the hatching distance). Set zero to get a solid interface.
((ConfigOptionFloat, support_interface_spacing)) ((ConfigOptionFloat, support_interface_spacing))
((ConfigOptionFloat, support_interface_speed)) ((ConfigOptionFloatsNullable, support_interface_speed))
((ConfigOptionEnum<SupportMaterialPattern>, support_base_pattern)) ((ConfigOptionEnum<SupportMaterialPattern>, support_base_pattern))
((ConfigOptionEnum<SupportMaterialInterfacePattern>, support_interface_pattern)) ((ConfigOptionEnum<SupportMaterialInterfacePattern>, support_interface_pattern))
// Spacing between support material lines (the hatching distance). // Spacing between support material lines (the hatching distance).
((ConfigOptionFloat, support_base_pattern_spacing)) ((ConfigOptionFloat, support_base_pattern_spacing))
((ConfigOptionFloat, support_expansion)) ((ConfigOptionFloat, support_expansion))
((ConfigOptionFloat, support_speed)) ((ConfigOptionFloatsNullable, support_speed))
((ConfigOptionEnum<SupportMaterialStyle>, support_style)) ((ConfigOptionEnum<SupportMaterialStyle>, support_style))
// BBS // BBS
//((ConfigOptionBool, independent_support_layer_height)) //((ConfigOptionBool, independent_support_layer_height))
@ -806,25 +812,25 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, bottom_shell_thickness)) ((ConfigOptionFloat, bottom_shell_thickness))
((ConfigOptionFloat, bridge_angle)) ((ConfigOptionFloat, bridge_angle))
((ConfigOptionFloat, bridge_flow)) ((ConfigOptionFloat, bridge_flow))
((ConfigOptionFloat, overhang_totally_speed)) ((ConfigOptionFloatsNullable, overhang_totally_speed))
((ConfigOptionFloat, bridge_speed)) ((ConfigOptionFloatsNullable, bridge_speed))
((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionBool, ensure_vertical_shell_thickness))
((ConfigOptionEnum<InfillPattern>, top_surface_pattern)) ((ConfigOptionEnum<InfillPattern>, top_surface_pattern))
((ConfigOptionEnum<InfillPattern>, bottom_surface_pattern)) ((ConfigOptionEnum<InfillPattern>, bottom_surface_pattern))
((ConfigOptionEnum<InfillPattern>, internal_solid_infill_pattern)) ((ConfigOptionEnum<InfillPattern>, internal_solid_infill_pattern))
((ConfigOptionFloat, outer_wall_line_width)) ((ConfigOptionFloat, outer_wall_line_width))
((ConfigOptionFloat, outer_wall_speed)) ((ConfigOptionFloatsNullable, outer_wall_speed))
((ConfigOptionFloat, infill_direction)) ((ConfigOptionFloat, infill_direction))
((ConfigOptionPercent, sparse_infill_density)) ((ConfigOptionPercent, sparse_infill_density))
((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern)) ((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern))
((ConfigOptionEnum<FuzzySkinType>, fuzzy_skin)) ((ConfigOptionEnum<FuzzySkinType>, fuzzy_skin))
((ConfigOptionFloat, fuzzy_skin_thickness)) ((ConfigOptionFloat, fuzzy_skin_thickness))
((ConfigOptionFloat, fuzzy_skin_point_distance)) ((ConfigOptionFloat, fuzzy_skin_point_distance))
((ConfigOptionFloat, gap_infill_speed)) ((ConfigOptionFloatsNullable, gap_infill_speed))
((ConfigOptionInt, sparse_infill_filament)) ((ConfigOptionInt, sparse_infill_filament))
((ConfigOptionFloat, sparse_infill_line_width)) ((ConfigOptionFloat, sparse_infill_line_width))
((ConfigOptionPercent, infill_wall_overlap)) ((ConfigOptionPercent, infill_wall_overlap))
((ConfigOptionFloat, sparse_infill_speed)) ((ConfigOptionFloatsNullable, sparse_infill_speed))
//BBS //BBS
((ConfigOptionBool, infill_combination)) ((ConfigOptionBool, infill_combination))
// Ironing options // Ironing options
@ -841,27 +847,27 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, smooth_coefficient)) ((ConfigOptionFloat, smooth_coefficient))
((ConfigOptionInt, wall_filament)) ((ConfigOptionInt, wall_filament))
((ConfigOptionFloat, inner_wall_line_width)) ((ConfigOptionFloat, inner_wall_line_width))
((ConfigOptionFloat, inner_wall_speed)) ((ConfigOptionFloatsNullable, inner_wall_speed))
// Total number of perimeters. // Total number of perimeters.
((ConfigOptionInt, wall_loops)) ((ConfigOptionInt, wall_loops))
((ConfigOptionFloat, minimum_sparse_infill_area)) ((ConfigOptionFloat, minimum_sparse_infill_area))
((ConfigOptionInt, solid_infill_filament)) ((ConfigOptionInt, solid_infill_filament))
((ConfigOptionFloat, internal_solid_infill_line_width)) ((ConfigOptionFloat, internal_solid_infill_line_width))
((ConfigOptionFloat, internal_solid_infill_speed)) ((ConfigOptionFloatsNullable, internal_solid_infill_speed))
// Detect thin walls. // Detect thin walls.
((ConfigOptionBool, detect_thin_wall)) ((ConfigOptionBool, detect_thin_wall))
((ConfigOptionFloat, top_surface_line_width)) ((ConfigOptionFloat, top_surface_line_width))
((ConfigOptionInt, top_shell_layers)) ((ConfigOptionInt, top_shell_layers))
((ConfigOptionFloat, top_shell_thickness)) ((ConfigOptionFloat, top_shell_thickness))
((ConfigOptionFloat, top_surface_speed)) ((ConfigOptionFloatsNullable, top_surface_speed))
((ConfigOptionFloatOrPercent, small_perimeter_speed)) ((ConfigOptionFloatsOrPercentsNullable, small_perimeter_speed))
((ConfigOptionFloat, small_perimeter_threshold)) ((ConfigOptionFloatsNullable, small_perimeter_threshold))
//BBS //BBS
((ConfigOptionBool, enable_overhang_speed)) ((ConfigOptionBoolsNullable, enable_overhang_speed))
((ConfigOptionFloat, overhang_1_4_speed)) ((ConfigOptionFloatsNullable, overhang_1_4_speed))
((ConfigOptionFloat, overhang_2_4_speed)) ((ConfigOptionFloatsNullable, overhang_2_4_speed))
((ConfigOptionFloat, overhang_3_4_speed)) ((ConfigOptionFloatsNullable, overhang_3_4_speed))
((ConfigOptionFloat, overhang_4_4_speed)) ((ConfigOptionFloatsNullable, overhang_4_4_speed))
((ConfigOptionFloatOrPercent, sparse_infill_anchor)) ((ConfigOptionFloatOrPercent, sparse_infill_anchor))
((ConfigOptionFloatOrPercent, sparse_infill_anchor_max)) ((ConfigOptionFloatOrPercent, sparse_infill_anchor_max))
//OrcaSlicer //OrcaSlicer
@ -976,8 +982,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, single_extruder_multi_material)) ((ConfigOptionBool, single_extruder_multi_material))
((ConfigOptionBool, wipe_tower_no_sparse_layers)) ((ConfigOptionBool, wipe_tower_no_sparse_layers))
((ConfigOptionString, change_filament_gcode)) ((ConfigOptionString, change_filament_gcode))
((ConfigOptionFloat, travel_speed)) ((ConfigOptionFloatsNullable, travel_speed))
((ConfigOptionFloat, travel_speed_z)) ((ConfigOptionFloatsNullable, travel_speed_z))
((ConfigOptionBool, use_relative_e_distances)) ((ConfigOptionBool, use_relative_e_distances))
((ConfigOptionBool, use_firmware_retraction)) ((ConfigOptionBool, use_firmware_retraction))
((ConfigOptionBool, silent_mode)) ((ConfigOptionBool, silent_mode))
@ -1032,9 +1038,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionInts, other_layers_print_sequence)) ((ConfigOptionInts, other_layers_print_sequence))
((ConfigOptionInt, other_layers_print_sequence_nums)) ((ConfigOptionInt, other_layers_print_sequence_nums))
((ConfigOptionBools, slow_down_for_layer_cooling)) ((ConfigOptionBools, slow_down_for_layer_cooling))
((ConfigOptionFloat, default_acceleration)) ((ConfigOptionFloatsNullable, default_acceleration))
((ConfigOptionFloat, inner_wall_acceleration)) ((ConfigOptionFloats, inner_wall_acceleration))
((ConfigOptionFloatOrPercent, sparse_infill_acceleration)) ((ConfigOptionFloatsOrPercents, sparse_infill_acceleration))
((ConfigOptionBools, activate_air_filtration)) ((ConfigOptionBools, activate_air_filtration))
((ConfigOptionInts, during_print_exhaust_fan_speed)) ((ConfigOptionInts, during_print_exhaust_fan_speed))
((ConfigOptionInts, complete_print_exhaust_fan_speed)) ((ConfigOptionInts, complete_print_exhaust_fan_speed))
@ -1050,14 +1056,14 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBools, reduce_fan_stop_start_freq)) ((ConfigOptionBools, reduce_fan_stop_start_freq))
((ConfigOptionInts, fan_cooling_layer_time)) ((ConfigOptionInts, fan_cooling_layer_time))
((ConfigOptionStrings, filament_colour)) ((ConfigOptionStrings, filament_colour))
((ConfigOptionFloat, top_surface_acceleration)) ((ConfigOptionFloats, top_surface_acceleration))
((ConfigOptionFloat, outer_wall_acceleration)) ((ConfigOptionFloatsNullable, outer_wall_acceleration))
((ConfigOptionFloat, initial_layer_acceleration)) ((ConfigOptionFloatsNullable, initial_layer_acceleration))
((ConfigOptionFloat, initial_layer_line_width)) ((ConfigOptionFloat, initial_layer_line_width))
((ConfigOptionFloat, initial_layer_print_height)) ((ConfigOptionFloat, initial_layer_print_height))
((ConfigOptionFloat, initial_layer_speed)) ((ConfigOptionFloatsNullable, initial_layer_speed))
//BBS //BBS
((ConfigOptionFloat, initial_layer_infill_speed)) ((ConfigOptionFloatsNullable, initial_layer_infill_speed))
((ConfigOptionInts, nozzle_temperature_initial_layer)) ((ConfigOptionInts, nozzle_temperature_initial_layer))
((ConfigOptionInts, full_fan_speed_layer)) ((ConfigOptionInts, full_fan_speed_layer))
((ConfigOptionInts, fan_max_speed)) ((ConfigOptionInts, fan_max_speed))

View File

@ -575,7 +575,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : { "top_surface_line_width", "top_surface_speed" }) for (auto el : { "top_surface_line_width", "top_surface_speed" })
toggle_field(el, has_top_solid_infill || (has_spiral_vase && has_bottom_solid_infill)); toggle_field(el, has_top_solid_infill || (has_spiral_vase && has_bottom_solid_infill));
bool have_default_acceleration = config->opt_float("default_acceleration") > 0; // todo multi_extruders: the exact filament id
bool have_default_acceleration = config->opt_float("default_acceleration", 0) > 0;
//BBS //BBS
for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration" }) for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration" })
toggle_field(el, have_default_acceleration); toggle_field(el, have_default_acceleration);
@ -674,7 +675,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall"); bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall");
toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters); toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters);
bool has_overhang_speed = config->opt_bool("enable_overhang_speed"); // todo multi_extruders:
bool has_overhang_speed = config->opt_bool("enable_overhang_speed", 0);
for (auto el : { "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"}) for (auto el : { "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
toggle_line(el, has_overhang_speed); toggle_line(el, has_overhang_speed);

View File

@ -96,6 +96,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
}} }}
}; };
// todo multi_extruders: Does the following need to be modified?
std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CATEGORY_SETTINGS= std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CATEGORY_SETTINGS=
{{L("Quality"), {{"ironing_type", "", 8}, {"ironing_flow", "", 9}, {"ironing_spacing", "", 10}, {"ironing_inset", "", 11}, {"ironing_speed", "", 12}, {"ironing_direction", "",13} {{L("Quality"), {{"ironing_type", "", 8}, {"ironing_flow", "", 9}, {"ironing_spacing", "", 10}, {"ironing_inset", "", 11}, {"ironing_speed", "", 12}, {"ironing_direction", "",13}
}}, }},

View File

@ -1901,6 +1901,7 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid)
col = new ObjectGridCol(coEnum, "brim_type_reset", L("Support"), true, true, false, false, wxALIGN_LEFT); col = new ObjectGridCol(coEnum, "brim_type_reset", L("Support"), true, true, false, false, wxALIGN_LEFT);
m_col_data.push_back(col); m_col_data.push_back(col);
// todo mutli_extruders:
//object/volume speed //object/volume speed
col = new ObjectGridCol(coFloat, "outer_wall_speed", L("Speed"), false, false, true, true, wxALIGN_LEFT); col = new ObjectGridCol(coFloat, "outer_wall_speed", L("Speed"), false, false, true, true, wxALIGN_LEFT);
col->size = object_grid->GetTextExtent(L("Outer wall speed")).x; col->size = object_grid->GetTextExtent(L("Outer wall speed")).x;

View File

@ -9789,8 +9789,9 @@ void Plater::calib_flowrate(int pass)
Flow infill_flow = Flow(nozzle_diameter * 1.2f, layer_height, nozzle_diameter); Flow infill_flow = Flow(nozzle_diameter * 1.2f, layer_height, nozzle_diameter);
double filament_max_volumetric_speed = filament_config->option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0); double filament_max_volumetric_speed = filament_config->option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
double max_infill_speed = filament_max_volumetric_speed / (infill_flow.mm3_per_mm() * (pass == 1 ? 1.2 : 1)); double max_infill_speed = filament_max_volumetric_speed / (infill_flow.mm3_per_mm() * (pass == 1 ? 1.2 : 1));
double internal_solid_speed = std::floor(std::min(print_config->opt_float("internal_solid_infill_speed"), max_infill_speed)); // todo multi_extruder:
double top_surface_speed = std::floor(std::min(print_config->opt_float("top_surface_speed"), max_infill_speed)); double internal_solid_speed = std::floor(std::min(print_config->opt_float("internal_solid_infill_speed", 0), max_infill_speed));
double top_surface_speed = std::floor(std::min(print_config->opt_float("top_surface_speed", 0), max_infill_speed));
// adjust parameters // adjust parameters
for (auto _obj : model().objects) { for (auto _obj : model().objects) {

View File

@ -557,8 +557,8 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString
Flow infill_flow = Flow(nozzle_diameter * 1.2f, layer_height, nozzle_diameter); Flow infill_flow = Flow(nozzle_diameter * 1.2f, layer_height, nozzle_diameter);
double filament_max_volumetric_speed = filament_config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0); double filament_max_volumetric_speed = filament_config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
double max_infill_speed = filament_max_volumetric_speed / (infill_flow.mm3_per_mm() * (pass == 1 ? 1.2 : 1)); double max_infill_speed = filament_max_volumetric_speed / (infill_flow.mm3_per_mm() * (pass == 1 ? 1.2 : 1));
double internal_solid_speed = std::floor(std::min(print_config.opt_float("internal_solid_infill_speed"), max_infill_speed)); double internal_solid_speed = std::floor(std::min(print_config.opt_float("internal_solid_infill_speed", get_extruder_index(stoi(calib_info.filament_prest->filament_id))), max_infill_speed));
double top_surface_speed = std::floor(std::min(print_config.opt_float("top_surface_speed"), max_infill_speed)); double top_surface_speed = std::floor(std::min(print_config.opt_float("top_surface_speed", get_extruder_index(stoi(calib_info.filament_prest->filament_id))), max_infill_speed));
// adjust parameters // adjust parameters
filament_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(calib_info.bed_type)); filament_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(calib_info.bed_type));