mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 05:27:50 +00:00
Fix usage of most of the multi-variant parameters
This commit is contained in:
+6
-6
@@ -3791,13 +3791,13 @@ int CLI::run(int argc, char **argv)
|
||||
}
|
||||
|
||||
//travel_acceleration
|
||||
ConfigOptionFloat *travel_acceleration_option = m_print_config.option<ConfigOptionFloat>("travel_acceleration", true);
|
||||
ConfigOptionFloat *default_acceleration_option = m_print_config.option<ConfigOptionFloat>("default_acceleration");
|
||||
travel_acceleration_option->value = default_acceleration_option->value;
|
||||
ConfigOptionFloatsNullable *travel_acceleration_option = m_print_config.option<ConfigOptionFloatsNullable>("travel_acceleration", true);
|
||||
ConfigOptionFloatsNullable *default_acceleration_option = m_print_config.option<ConfigOptionFloatsNullable>("default_acceleration");
|
||||
travel_acceleration_option->values = default_acceleration_option->values;
|
||||
|
||||
ConfigOptionFloat *initial_layer_travel_acceleration_option = m_print_config.option<ConfigOptionFloat>("initial_layer_travel_acceleration", true);
|
||||
ConfigOptionFloat *initial_layer_acceleration_option = m_print_config.option<ConfigOptionFloat>("initial_layer_acceleration");
|
||||
initial_layer_travel_acceleration_option->value = initial_layer_acceleration_option->value;
|
||||
ConfigOptionFloatsNullable *initial_layer_travel_acceleration_option = m_print_config.option<ConfigOptionFloatsNullable>("initial_layer_travel_acceleration", true);
|
||||
ConfigOptionFloatsNullable *initial_layer_acceleration_option = m_print_config.option<ConfigOptionFloatsNullable>("initial_layer_acceleration");
|
||||
initial_layer_travel_acceleration_option->values = initial_layer_acceleration_option->values;
|
||||
}
|
||||
|
||||
auto get_print_sequence = [](Slic3r::GUI::PartPlate* plate, DynamicPrintConfig& print_config, bool &is_seq_print) {
|
||||
|
||||
@@ -4573,12 +4573,12 @@ LayerResult GCode::process_layer(
|
||||
}
|
||||
case CalibMode::Calib_VFA_Tower: {
|
||||
auto _speed = print.calib_params().start + std::floor(print_z / 5.0) * print.calib_params().step;
|
||||
m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(std::round(_speed)));
|
||||
m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({std::round(_speed)}));
|
||||
break;
|
||||
}
|
||||
case CalibMode::Calib_Vol_speed_Tower: {
|
||||
auto _speed = print.calib_params().start + print_z * print.calib_params().step;
|
||||
m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(std::round(_speed)));
|
||||
m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({std::round(_speed)}));
|
||||
break;
|
||||
}
|
||||
case CalibMode::Calib_Retraction_tower: {
|
||||
|
||||
+11
-11
@@ -2971,26 +2971,26 @@ void Model::setPrintSpeedTable(const DynamicPrintConfig& config, const PrintConf
|
||||
printSpeedMap.maxSpeed = printSpeedMap.perimeterSpeed;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.infillSpeed;
|
||||
}
|
||||
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)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.solidInfillSpeed;
|
||||
}
|
||||
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)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.topSolidInfillSpeed;
|
||||
}
|
||||
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)
|
||||
printSpeedMap.maxSpeed = printSpeedMap.supportSpeed;
|
||||
@@ -3226,17 +3226,17 @@ double Model::findMaxSpeed(const ModelObject* object) {
|
||||
externalPerimeterSpeedObj = Model::printSpeedMap.externalPerimeterSpeed / Model::printSpeedMap.perimeterSpeed * perimeterSpeedObj;
|
||||
}
|
||||
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")
|
||||
solidInfillSpeedObj = object->config.opt_float(objectKey);
|
||||
solidInfillSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
|
||||
if (objectKey == "top_surface_speed")
|
||||
topSolidInfillSpeedObj = object->config.opt_float(objectKey);
|
||||
topSolidInfillSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
|
||||
if (objectKey == "support_speed")
|
||||
supportSpeedObj = object->config.opt_float(objectKey);
|
||||
supportSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
|
||||
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")
|
||||
smallPerimeterSpeedObj = object->config.opt_float(objectKey);
|
||||
smallPerimeterSpeedObj = object->config.get().opt_float_nullable(objectKey, 0);
|
||||
}
|
||||
objMaxSpeed = std::max(perimeterSpeedObj, std::max(externalPerimeterSpeedObj, std::max(infillSpeedObj, std::max(solidInfillSpeedObj, std::max(topSolidInfillSpeedObj, std::max(supportSpeedObj, std::max(smallPerimeterSpeedObj, objMaxSpeed)))))));
|
||||
if (objMaxSpeed <= 0) objMaxSpeed = 250.;
|
||||
|
||||
@@ -868,13 +868,15 @@ void PrintObject::generate_support_material()
|
||||
void PrintObject::estimate_curled_extrusions()
|
||||
{
|
||||
if (this->set_started(posEstimateCurledExtrusions)) {
|
||||
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(),
|
||||
[](const PrintRegion *region) { return region->config().enable_overhang_speed.getBool(); })) {
|
||||
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(), [](const PrintRegion* region) {
|
||||
const auto& cfg = region->config().enable_overhang_speed.values;
|
||||
return std::any_of(cfg.begin(), cfg.end(), [](const unsigned char v) { return (bool) v; });
|
||||
})) {
|
||||
|
||||
// Estimate curling of support material and add it to the malformaition lines of each layer
|
||||
float support_flow_width = support_material_flow(this, this->config().layer_height).width();
|
||||
SupportSpotsGenerator::Params params{this->print()->m_config.filament_type.values,
|
||||
float(this->print()->default_object_config().inner_wall_acceleration.getFloat()),
|
||||
/*float(this->print()->default_object_config().inner_wall_acceleration.getFloat()),*/
|
||||
this->config().raft_layers.getInt(), this->config().brim_type.value,
|
||||
float(this->config().brim_width.getFloat())};
|
||||
SupportSpotsGenerator::estimate_malformations(this->layers(), params);
|
||||
@@ -1121,11 +1123,11 @@ bool PrintObject::invalidate_state_by_config_options(
|
||||
// todo multi_extruders: Parameter migration between single and double extruder printers
|
||||
auto is_gap_fill_changed_state_due_to_speed = [&opt_key, &old_config, &new_config]() -> bool {
|
||||
if (opt_key == "gap_infill_speed") {
|
||||
const auto *old_gap_fill_speed = old_config.option<ConfigOptionFloat>(opt_key);
|
||||
const auto *new_gap_fill_speed = new_config.option<ConfigOptionFloat>(opt_key);
|
||||
const auto *old_gap_fill_speed = old_config.option<ConfigOptionFloatsNullable>(opt_key);
|
||||
const auto *new_gap_fill_speed = new_config.option<ConfigOptionFloatsNullable>(opt_key);
|
||||
assert(old_gap_fill_speed && new_gap_fill_speed);
|
||||
return (old_gap_fill_speed->value > 0.f && new_gap_fill_speed->value == 0.f) ||
|
||||
(old_gap_fill_speed->value == 0.f && new_gap_fill_speed->value > 0.f);
|
||||
return (old_gap_fill_speed->values.size() != new_gap_fill_speed->values.size())
|
||||
|| (old_gap_fill_speed->values != new_gap_fill_speed->values);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace SupportSpotsGenerator {
|
||||
struct Params
|
||||
{
|
||||
Params(
|
||||
const std::vector<std::string> &filament_types, float max_acceleration, int raft_layers_count, BrimType brim_type, float brim_width)
|
||||
: max_acceleration(max_acceleration), raft_layers_count(raft_layers_count), brim_type(brim_type), brim_width(brim_width)
|
||||
const std::vector<std::string> &filament_types/*, float max_acceleration*/, int raft_layers_count, BrimType brim_type, float brim_width)
|
||||
: /*max_acceleration(max_acceleration), */raft_layers_count(raft_layers_count), brim_type(brim_type), brim_width(brim_width)
|
||||
{
|
||||
if (filament_types.size() > 1) {
|
||||
BOOST_LOG_TRIVIAL(warning)
|
||||
@@ -36,8 +36,8 @@ struct Params
|
||||
|
||||
// the algorithm should use the following units for all computations: distance [mm], mass [g], time [s], force [g*mm/s^2]
|
||||
const float bridge_distance = 16.0f; // mm
|
||||
const float max_acceleration; // mm/s^2 ; max acceleration of object in XY -- should be applicable only to printers with bed slinger,
|
||||
// however we do not have such info yet. The force is usually small anyway, so not such a big deal to include it everytime
|
||||
// const float max_acceleration; // mm/s^2 ; max acceleration of object in XY -- should be applicable only to printers with bed slinger,
|
||||
// // however we do not have such info yet. The force is usually small anyway, so not such a big deal to include it everytime
|
||||
const int raft_layers_count;
|
||||
std::string filament_type;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ float CalibPressureAdvance::find_optimal_PA_speed(const DynamicPrintConfig &conf
|
||||
const float nozzle_diameter = config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(extruder_id);
|
||||
if (line_width <= 0.) line_width = Flow::auto_extrusion_width(frPerimeter, nozzle_diameter);
|
||||
Flow pattern_line = Flow(line_width, layer_height, nozzle_diameter);
|
||||
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(extruder_id)),
|
||||
filament_max_volumetric_speed / pattern_line.mm3_per_mm());
|
||||
|
||||
return std::floor(pa_speed);
|
||||
|
||||
@@ -280,7 +280,7 @@ private:
|
||||
|
||||
struct SuggestedConfigCalibPAPattern
|
||||
{
|
||||
const std::vector<std::pair<std::string, double>> float_pairs{{"initial_layer_speed", 30}};
|
||||
const std::vector<std::pair<std::string, std::vector<double>>> floats_pairs{{"initial_layer_speed", {30}}};
|
||||
|
||||
const std::vector<std::pair<std::string, double>> nozzle_ratio_pairs{{"line_width", 112.5}, {"initial_layer_line_width", 140}};
|
||||
|
||||
@@ -312,13 +312,13 @@ public:
|
||||
|
||||
protected:
|
||||
// todo multi_extruders:
|
||||
double speed_first_layer() const { return m_config.option<ConfigOptionFloat>("initial_layer_speed")->value; };
|
||||
double speed_perimeter() const { return m_config.option<ConfigOptionFloat>("outer_wall_speed")->value; };
|
||||
double accel_perimeter() const { return m_config.option<ConfigOptionFloat>("outer_wall_acceleration")->value; }
|
||||
double speed_first_layer() const { return m_config.get_abs_value_at("initial_layer_speed", m_params.extruder_id); };
|
||||
double speed_perimeter() const { return m_config.get_abs_value_at("outer_wall_speed", m_params.extruder_id); };
|
||||
double accel_perimeter() const { return m_config.get_abs_value_at("outer_wall_acceleration", m_params.extruder_id); }
|
||||
double line_width_first_layer() const
|
||||
{
|
||||
// TODO: FIXME: find out current filament/extruder?
|
||||
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", 0);
|
||||
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", m_params.extruder_id);
|
||||
return m_config.get_abs_value("initial_layer_line_width", nozzle_diameter);
|
||||
};
|
||||
double line_width() const;
|
||||
|
||||
@@ -587,9 +587,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
|
||||
|
||||
bool have_perimeters = config->opt_int("wall_loops") > 0;
|
||||
for (auto el : { "extra_perimeters_on_overhangs", "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
|
||||
"seam_position", "staggered_inner_seams", "wall_sequence", "outer_wall_line_width",
|
||||
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
|
||||
"seam_position", "staggered_inner_seams", "wall_sequence", "outer_wall_line_width" })
|
||||
toggle_field(el, have_perimeters);
|
||||
for (auto el : { "inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
|
||||
toggle_field(el, have_perimeters, variant_index);
|
||||
|
||||
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
|
||||
// sparse_infill_filament uses the same logic as in Print::extruders()
|
||||
@@ -655,25 +656,27 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
|
||||
toggle_field("bottom_surface_density", has_bottom_shell);
|
||||
|
||||
for (auto el : { "infill_direction", "sparse_infill_line_width", "gap_fill_target","filter_out_gap_fill","infill_wall_overlap",
|
||||
"sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle", "internal_bridge_angle",
|
||||
"bridge_angle", "internal_bridge_angle",
|
||||
"solid_infill_direction", "solid_infill_rotate_template", "internal_solid_infill_pattern", "solid_infill_filament",
|
||||
})
|
||||
toggle_field(el, have_infill || has_solid_infill);
|
||||
for (auto el : { "sparse_infill_speed", "bridge_speed", "internal_bridge_speed"})
|
||||
toggle_field(el, have_infill || has_solid_infill, variant_index);
|
||||
|
||||
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_shell);
|
||||
toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_shell);
|
||||
|
||||
// Gap fill is newly allowed in between perimeter lines even for empty infill (see GH #1476).
|
||||
toggle_field("gap_infill_speed", have_perimeters);
|
||||
toggle_field("gap_infill_speed", have_perimeters, variant_index);
|
||||
|
||||
for (auto el : { "top_surface_line_width", "top_surface_speed" })
|
||||
toggle_field(el, has_top_shell);
|
||||
toggle_field("top_surface_line_width", has_top_shell);
|
||||
toggle_field("top_surface_speed", has_top_shell, variant_index);
|
||||
|
||||
bool have_default_acceleration = config->opt_float_nullable("default_acceleration", variant_index) > 0;
|
||||
|
||||
for (auto el : {"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "initial_layer_travel_acceleration",
|
||||
"top_surface_acceleration", "travel_acceleration", "bridge_acceleration", "sparse_infill_acceleration", "internal_solid_infill_acceleration"})
|
||||
toggle_field(el, have_default_acceleration);
|
||||
toggle_field(el, have_default_acceleration, variant_index);
|
||||
|
||||
bool machine_supports_junction_deviation = false;
|
||||
if (gcflavor == gcfMarlinFirmware) {
|
||||
@@ -681,15 +684,15 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
|
||||
machine_supports_junction_deviation = !machine_jd->values.empty() && machine_jd->values.front() > 0.0;
|
||||
}
|
||||
}
|
||||
toggle_line("default_junction_deviation", gcflavor == gcfMarlinFirmware);
|
||||
toggle_line("default_junction_deviation", gcflavor == gcfMarlinFirmware, variant_index);
|
||||
if (machine_supports_junction_deviation) {
|
||||
toggle_field("default_junction_deviation", true, variant_index);
|
||||
toggle_field("default_jerk", false, variant_index);
|
||||
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "initial_layer_travel_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"})
|
||||
toggle_line(el, false, variant_index);
|
||||
} else {
|
||||
toggle_field("default_junction_deviation", false);
|
||||
toggle_field("default_jerk", true);
|
||||
toggle_field("default_junction_deviation", false, variant_index);
|
||||
toggle_field("default_jerk", true, variant_index);
|
||||
bool have_default_jerk = config->has("default_jerk") && config->opt_float_nullable("default_jerk", variant_index) > 0;
|
||||
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "initial_layer_travel_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"}) {
|
||||
toggle_line(el, true, variant_index);
|
||||
|
||||
@@ -1906,6 +1906,7 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid)
|
||||
col = new ObjectGridCol(coEnum, "brim_type_reset", L("Support"), true, true, false, false, wxALIGN_LEFT);
|
||||
m_col_data.push_back(col);
|
||||
|
||||
// todo mutli_extruders:
|
||||
//object/volume speed
|
||||
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;
|
||||
|
||||
+46
-49
@@ -12679,11 +12679,11 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
|
||||
printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false});
|
||||
|
||||
//Orca: find acceleration to use in the test
|
||||
auto accel = print_config.option<ConfigOptionFloat>("outer_wall_acceleration")->value; // get the outer wall acceleration
|
||||
auto accel = print_config.get_abs_value_at("outer_wall_acceleration", params.extruder_id); // get the outer wall acceleration
|
||||
if (accel == 0) // if outer wall accel isnt defined, fall back to inner wall accel
|
||||
accel = print_config.option<ConfigOptionFloat>("inner_wall_acceleration")->value;
|
||||
accel = print_config.get_abs_value_at("inner_wall_acceleration", params.extruder_id);
|
||||
if (accel == 0) // if inner wall accel is not defined fall back to default accel
|
||||
accel = print_config.option<ConfigOptionFloat>("default_acceleration")->value;
|
||||
accel = print_config.get_abs_value_at("default_acceleration", params.extruder_id);
|
||||
// Orca: Set all accelerations except first layer, as the first layer accel doesnt affect the PA test since accel
|
||||
// is set to the travel accel before printing the pattern.
|
||||
if (accels.empty()) {
|
||||
@@ -12695,36 +12695,33 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
|
||||
// set max acceleration in case of batch mode to get correct test pattern size
|
||||
accel = *std::max_element(accels.begin(), accels.end());
|
||||
}
|
||||
print_config.set_key_value( "outer_wall_acceleration", new ConfigOptionFloat(accel));
|
||||
print_config.set_key_value("outer_wall_acceleration", new ConfigOptionFloatsNullable({accel}));
|
||||
print_config.set_key_value( "print_sequence", new ConfigOptionEnum(PrintSequence::ByLayer));
|
||||
|
||||
//Orca: find jerk value to use in the test
|
||||
if(!has_junction_deviation(printer_config) && print_config.option<ConfigOptionFloat>("default_jerk")->value > 0){ // we have set a jerk value
|
||||
auto jerk = print_config.option<ConfigOptionFloat>("outer_wall_jerk")->value; // get outer wall jerk
|
||||
if(!has_junction_deviation(printer_config) && print_config.get_abs_value_at("default_jerk", params.extruder_id) > 0){ // we have set a jerk value
|
||||
auto jerk = print_config.get_abs_value_at("outer_wall_jerk", params.extruder_id); // get outer wall jerk
|
||||
if (jerk == 0) // if outer wall jerk is not defined, get inner wall jerk
|
||||
jerk = print_config.option<ConfigOptionFloat>("inner_wall_jerk")->value;
|
||||
jerk = print_config.get_abs_value_at("inner_wall_jerk", params.extruder_id);
|
||||
if (jerk == 0) // if inner wall jerk is not defined, get the default jerk
|
||||
jerk = print_config.option<ConfigOptionFloat>("default_jerk")->value;
|
||||
jerk = print_config.get_abs_value_at("default_jerk", params.extruder_id);
|
||||
|
||||
//Orca: Set jerk values. Again first layer jerk should not matter as it is reset to the travel jerk before the
|
||||
// first PA pattern is printed.
|
||||
print_config.set_key_value( "default_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "outer_wall_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "inner_wall_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "top_surface_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "infill_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "travel_jerk", new ConfigOptionFloat(jerk));
|
||||
print_config.set_key_value( "default_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
print_config.set_key_value( "outer_wall_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
print_config.set_key_value( "inner_wall_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
print_config.set_key_value( "top_surface_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
print_config.set_key_value( "infill_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
print_config.set_key_value( "travel_jerk", new ConfigOptionFloatsNullable({jerk}));
|
||||
}
|
||||
|
||||
if (has_junction_deviation(printer_config)){
|
||||
print_config.set_key_value("default_junction_deviation", new ConfigOptionFloat(0));
|
||||
print_config.set_key_value("default_junction_deviation", new ConfigOptionFloatsNullable({0}));
|
||||
}
|
||||
|
||||
for (const auto& opt : SuggestedConfigCalibPAPattern().float_pairs) {
|
||||
print_config.set_key_value(
|
||||
opt.first,
|
||||
new ConfigOptionFloat(opt.second)
|
||||
);
|
||||
for (const auto& opt : SuggestedConfigCalibPAPattern().floats_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloatsNullable(opt.second));
|
||||
}
|
||||
|
||||
for (const auto& opt : SuggestedConfigCalibPAPattern().nozzle_ratio_pairs) {
|
||||
@@ -12752,7 +12749,7 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
|
||||
wxGetApp().preset_bundle->full_config(),
|
||||
print_config.get_abs_value("line_width", nozzle_diameter),
|
||||
print_config.get_abs_value("layer_height"), 0, 0);
|
||||
print_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(speed));
|
||||
print_config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({speed}));
|
||||
|
||||
speeds.assign({speed});
|
||||
const auto msg{_L("INFO:") + "\n" +
|
||||
@@ -12761,7 +12758,7 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
|
||||
} else if (speeds.size() == 1) {
|
||||
// If we have single value provided, set speed using global configuration.
|
||||
// per-object config is not set in this case
|
||||
print_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(speeds.front()));
|
||||
print_config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({speeds.front()}));
|
||||
}
|
||||
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
@@ -12836,9 +12833,9 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
|
||||
|
||||
auto &obj_config = obj->config;
|
||||
if (speeds.size() > 1)
|
||||
obj_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(tspd));
|
||||
obj_config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({tspd}));
|
||||
if (accels.size() > 1)
|
||||
obj_config.set_key_value("outer_wall_acceleration", new ConfigOptionFloat(tacc));
|
||||
obj_config.set_key_value("outer_wall_acceleration", new ConfigOptionFloatsNullable({tacc}));
|
||||
|
||||
auto cur_plate = get_partplate_list().get_plate(plate_idx);
|
||||
if (!cur_plate) {
|
||||
@@ -12942,7 +12939,7 @@ void Plater::_calib_pa_tower(const Calib_Params& params) {
|
||||
auto wall_speed = CalibPressureAdvance::find_optimal_PA_speed(
|
||||
full_config, full_config.get_abs_value("line_width", nozzle_diameter),
|
||||
full_config.get_abs_value("layer_height"), 0, 0);
|
||||
obj_cfg.set_key_value("outer_wall_speed", new ConfigOptionFloat(wall_speed));
|
||||
obj_cfg.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({wall_speed}));
|
||||
obj_cfg.set_key_value("inner_wall_speed", new ConfigOptionFloatsNullable({wall_speed}));
|
||||
obj_cfg.set_key_value("seam_position", new ConfigOptionEnum<SeamPosition>(spRear));
|
||||
obj_cfg.set_key_value("wall_loops", new ConfigOptionInt(2));
|
||||
@@ -13034,8 +13031,8 @@ void adjust_settings_for_flowrate_calib(ModelObjectPtrs& objects, bool linear, i
|
||||
(infill_flow.mm3_per_mm() * (cur_flowrate + (pass == 2 ? 0.035 : 0.05)) / cur_flowrate);
|
||||
else
|
||||
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 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_nullable("internal_solid_infill_speed", 0), max_infill_speed));
|
||||
double top_surface_speed = std::floor(std::min(print_config->opt_float_nullable("top_surface_speed", 0), max_infill_speed));
|
||||
|
||||
// adjust parameters
|
||||
for (auto _obj : objects) {
|
||||
@@ -13063,8 +13060,8 @@ void adjust_settings_for_flowrate_calib(ModelObjectPtrs& objects, bool linear, i
|
||||
_obj->config.set_key_value("solid_infill_direction", new ConfigOptionFloat(135));
|
||||
_obj->config.set_key_value("align_infill_direction_to_model", new ConfigOptionBool(true));
|
||||
_obj->config.set_key_value("ironing_type", new ConfigOptionEnum<IroningType>(IroningType::NoIroning));
|
||||
_obj->config.set_key_value("internal_solid_infill_speed", new ConfigOptionFloat(internal_solid_speed));
|
||||
_obj->config.set_key_value("top_surface_speed", new ConfigOptionFloat(top_surface_speed));
|
||||
_obj->config.set_key_value("internal_solid_infill_speed", new ConfigOptionFloatsNullable({internal_solid_speed}));
|
||||
_obj->config.set_key_value("top_surface_speed", new ConfigOptionFloatsNullable({top_surface_speed}));
|
||||
_obj->config.set_key_value("seam_slope_type", new ConfigOptionEnum<SeamScarfType>(SeamScarfType::None));
|
||||
_obj->config.set_key_value("gap_fill_target", new ConfigOptionEnum<GapFillTarget>(GapFillTarget::gftNowhere));
|
||||
print_config->set_key_value("max_volumetric_extrusion_rate_slope", new ConfigOptionFloat(0));
|
||||
@@ -13267,7 +13264,7 @@ void Plater::calib_max_vol_speed(const Calib_Params& params)
|
||||
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats { 200 });
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats{0.0});
|
||||
printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false});
|
||||
obj_cfg.set_key_value("enable_overhang_speed", new ConfigOptionBool { false });
|
||||
obj_cfg.set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
obj_cfg.set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
obj_cfg.set_key_value("alternate_extra_wall", new ConfigOptionBool(false));
|
||||
obj_cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
@@ -13382,7 +13379,7 @@ void Plater::calib_VFA(const Calib_Params& params)
|
||||
printer_config->set_key_value("input_shaping_emit", new ConfigOptionBool{true});
|
||||
printer_config->set_key_value("input_shaping_type", new ConfigOptionEnum<InputShaperType>(InputShaperType::Disable));
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool { false });
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("alternate_extra_wall", new ConfigOptionBool(false));
|
||||
@@ -13429,12 +13426,12 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
|
||||
|
||||
if (has_junction_deviation(printer_config)) {
|
||||
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats {(std::max(printer_config->option<ConfigOptionFloats>("machine_max_junction_deviation")->values.front(), 0.25))});
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0));
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloatsNullable({0}));
|
||||
} else {
|
||||
const double jerk_value = (gcode_flavor_option && gcode_flavor_option->value == GCodeFlavor::gcfKlipper) ? 5.0 : 10.0;
|
||||
printer_config->set_key_value("machine_max_jerk_x", new ConfigOptionFloats{std::max(printer_config->option<ConfigOptionFloats>("machine_max_jerk_x")->values.front(), jerk_value)});
|
||||
printer_config->set_key_value("machine_max_jerk_y", new ConfigOptionFloats{std::max(printer_config->option<ConfigOptionFloats>("machine_max_jerk_y")->values.front(), jerk_value)});
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloat(0));
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloatsNullable({0}));
|
||||
}
|
||||
|
||||
if (!filament_config->option<ConfigOptionBools>("enable_pressure_advance")->get_at(0)) {
|
||||
@@ -13449,7 +13446,7 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
print_config->set_key_value("layer_height", new ConfigOptionFloat(0.2));
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
@@ -13459,9 +13456,9 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("bottom_surface_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(20000));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(20000));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({200}));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloatsNullable({20000}));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloatsNullable({20000}));
|
||||
print_config->set_key_value("precise_z_height", new ConfigOptionBool(false));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
@@ -13492,12 +13489,12 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
|
||||
|
||||
if (has_junction_deviation(printer_config)) {
|
||||
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats {(std::max(printer_config->option<ConfigOptionFloats>("machine_max_junction_deviation")->values.front(), 0.25))});
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0));
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloatsNullable({0}));
|
||||
} else {
|
||||
const double jerk_value = (gcode_flavor_option && gcode_flavor_option->value == GCodeFlavor::gcfKlipper) ? 5.0 : 10.0;
|
||||
printer_config->set_key_value("machine_max_jerk_x", new ConfigOptionFloats{std::max(printer_config->option<ConfigOptionFloats>("machine_max_jerk_x")->values.front(), jerk_value)});
|
||||
printer_config->set_key_value("machine_max_jerk_y", new ConfigOptionFloats{std::max(printer_config->option<ConfigOptionFloats>("machine_max_jerk_y")->values.front(), jerk_value)});
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloat(0));
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloatsNullable({0}));
|
||||
}
|
||||
|
||||
if (!filament_config->option<ConfigOptionBools>("enable_pressure_advance")->get_at(0)) {
|
||||
@@ -13511,7 +13508,7 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
@@ -13521,9 +13518,9 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("bottom_surface_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(20000));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(20000));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({200}));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloatsNullable({20000}));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloatsNullable({20000}));
|
||||
print_config->set_key_value("precise_z_height", new ConfigOptionBool(false));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
@@ -13556,11 +13553,11 @@ void Plater::Calib_Cornering(const Calib_Params& params)
|
||||
|
||||
if (has_junction_deviation(printer_config)) {
|
||||
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats{params.end});
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0.0));
|
||||
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloatsNullable({0.0}));
|
||||
} else {
|
||||
printer_config->set_key_value("machine_max_jerk_x", new ConfigOptionFloats{params.end});
|
||||
printer_config->set_key_value("machine_max_jerk_y", new ConfigOptionFloats{params.end});
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloat(0));
|
||||
print_config->set_key_value("default_jerk", new ConfigOptionFloatsNullable({0}));
|
||||
}
|
||||
|
||||
if (!filament_config->option<ConfigOptionBools>("enable_pressure_advance")->get_at(0)) {
|
||||
@@ -13576,7 +13573,7 @@ void Plater::Calib_Cornering(const Calib_Params& params)
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats{200});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
@@ -13586,9 +13583,9 @@ void Plater::Calib_Cornering(const Calib_Params& params)
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("bottom_surface_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(2000));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(2000));
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable({200}));
|
||||
print_config->set_key_value("default_acceleration", new ConfigOptionFloatsNullable({2000}));
|
||||
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloatsNullable({2000}));
|
||||
print_config->set_key_value("precise_z_height", new ConfigOptionBool(false));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
|
||||
@@ -646,8 +646,8 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString
|
||||
int index = get_index_for_extruder_parameter(filament_config, "filament_max_volumetric_speed", calib_info.extruder_id, calib_info.extruder_type, calib_info.nozzle_volume_type);
|
||||
double filament_max_volumetric_speed = filament_config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(index);
|
||||
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 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_nullable("internal_solid_infill_speed", 0), max_infill_speed));
|
||||
double top_surface_speed = std::floor(std::min(print_config.opt_float_nullable("top_surface_speed", 0), max_infill_speed));
|
||||
|
||||
// adjust parameters
|
||||
filament_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(calib_info.bed_type));
|
||||
@@ -668,8 +668,8 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString
|
||||
_obj->config.set_key_value("top_solid_infill_flow_ratio", new ConfigOptionFloat(1.0f));
|
||||
_obj->config.set_key_value("infill_direction", new ConfigOptionFloat(45));
|
||||
_obj->config.set_key_value("ironing_type", new ConfigOptionEnum<IroningType>(IroningType::NoIroning));
|
||||
_obj->config.set_key_value("internal_solid_infill_speed", new ConfigOptionFloat(internal_solid_speed));
|
||||
_obj->config.set_key_value("top_surface_speed", new ConfigOptionFloat(top_surface_speed));
|
||||
_obj->config.set_key_value("internal_solid_infill_speed", new ConfigOptionFloatsNullable({internal_solid_speed}));
|
||||
_obj->config.set_key_value("top_surface_speed", new ConfigOptionFloatsNullable({top_surface_speed}));
|
||||
|
||||
// extract flowrate from name, filename format: flowrate_xxx
|
||||
std::string obj_name = _obj->name;
|
||||
@@ -720,14 +720,14 @@ void CalibUtils::calib_pa_pattern(const CalibInfo &calib_info, Model& model)
|
||||
|
||||
float nozzle_diameter = printer_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0);
|
||||
|
||||
for (const auto& opt : config_pattern.float_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloat(opt.second));
|
||||
for (const auto& opt : config_pattern.floats_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloatsNullable(opt.second));
|
||||
}
|
||||
|
||||
print_config.set_key_value("outer_wall_speed",
|
||||
new ConfigOptionFloat(CalibPressureAdvance::find_optimal_PA_speed(
|
||||
full_config, print_config.get_abs_value("line_width"),
|
||||
print_config.get_abs_value("layer_height"), calib_info.extruder_id, 0)));
|
||||
int index = get_index_for_extruder_parameter(print_config, "outer_wall_speed", calib_info.extruder_id, calib_info.extruder_type, calib_info.nozzle_volume_type);
|
||||
float wall_speed = CalibPressureAdvance::find_optimal_PA_speed(full_config, print_config.get_abs_value("line_width"), print_config.get_abs_value("layer_height"), calib_info.extruder_id, 0);
|
||||
ConfigOptionFloatsNullable *wall_speed_speed_opt = print_config.option<ConfigOptionFloatsNullable>("outer_wall_speed");
|
||||
wall_speed_speed_opt->values[index] = wall_speed;
|
||||
|
||||
for (const auto& opt : config_pattern.nozzle_ratio_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloatOrPercent(nozzle_diameter * opt.second / 100, false));
|
||||
@@ -770,7 +770,7 @@ void CalibUtils::set_for_auto_pa_model_and_config(const std::vector<CalibInfo> &
|
||||
|
||||
const auto& config_pattern = SuggestedConfigCalibPAPattern();
|
||||
|
||||
for (const auto& opt : config_pattern.float_pairs) { print_config.set_key_value(opt.first, new ConfigOptionFloat(opt.second)); }
|
||||
for (const auto& opt : config_pattern.floats_pairs) { print_config.set_key_value(opt.first, new ConfigOptionFloatsNullable(opt.second)); }
|
||||
|
||||
std::vector<CalibInfo> sorted_calib_infos = calib_infos;
|
||||
std::sort(sorted_calib_infos.begin(), sorted_calib_infos.end(), [](const CalibInfo &left_item, const CalibInfo &right_item) {
|
||||
@@ -778,11 +778,15 @@ void CalibUtils::set_for_auto_pa_model_and_config(const std::vector<CalibInfo> &
|
||||
});
|
||||
|
||||
for (const CalibInfo &calib_info : calib_infos) {
|
||||
int index = get_index_for_extruder_parameter(print_config, "outer_wall_speed", calib_info.extruder_id, calib_info.extruder_type, calib_info.nozzle_volume_type);
|
||||
float wall_speed = CalibPressureAdvance::find_optimal_PA_speed(full_config, print_config.get_abs_value("line_width"), print_config.get_abs_value("layer_height"),
|
||||
calib_info.extruder_id, 0);
|
||||
|
||||
ConfigOptionFloatsNullable *wall_speed_speed_opt = print_config.option<ConfigOptionFloatsNullable>("outer_wall_speed");
|
||||
std::vector<double> new_speeds = wall_speed_speed_opt->values;
|
||||
new_speeds[index] = wall_speed;
|
||||
ModelObject* object = model.objects[calib_info.index];
|
||||
object->config.set_key_value("outer_wall_speed",
|
||||
new ConfigOptionFloat(CalibPressureAdvance::find_optimal_PA_speed(
|
||||
full_config, print_config.get_abs_value("line_width"),
|
||||
print_config.get_abs_value("layer_height"), calib_info.extruder_id, 0)));
|
||||
object->config.set_key_value("outer_wall_speed", new ConfigOptionFloatsNullable(new_speeds));
|
||||
}
|
||||
|
||||
for (const auto& opt : config_pattern.nozzle_ratio_pairs) {
|
||||
@@ -1123,7 +1127,7 @@ void CalibUtils::calib_max_vol_speed(const CalibInfo &calib_info, wxString &erro
|
||||
filament_config.set_key_value("slow_down_layer_time", new ConfigOptionInts{0});
|
||||
filament_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(calib_info.bed_type));
|
||||
|
||||
print_config.set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config.set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config.set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config.set_key_value("alternate_extra_wall", new ConfigOptionBool(false));
|
||||
@@ -1185,7 +1189,7 @@ void CalibUtils::calib_VFA(const CalibInfo &calib_info, wxString &error_message)
|
||||
filament_config.set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats{200});
|
||||
filament_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(calib_info.bed_type));
|
||||
|
||||
print_config.set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config.set_key_value("enable_overhang_speed", new ConfigOptionBoolsNullable({false}));
|
||||
print_config.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config.set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
|
||||
|
||||
Reference in New Issue
Block a user