Merge branch 'SoftFever' into feature/small_perimeter

This commit is contained in:
SoftFever 2022-10-24 14:53:58 +08:00
commit 397e0f0a29
151 changed files with 7256 additions and 357 deletions

View file

@ -65,19 +65,19 @@ std::string AppConfig::get_hms_host()
{
std::string sel = get("iot_environment");
std::string host = "";
#if !BBL_RELEASE_TO_PUBLIC
if (sel == ENV_DEV_HOST)
host = "e-dev.bambu-lab.com";
else if (sel == ENV_QAT_HOST)
host = "e-qa.bambu-lab.com";
else if (sel == ENV_PRE_HOST)
host = "e-pre.bambu-lab.com";
else if (sel == ENV_PRODUCT_HOST)
host = "e.bambulab.com";
return host;
#else
// #if !BBL_RELEASE_TO_PUBLIC
// if (sel == ENV_DEV_HOST)
// host = "e-dev.bambu-lab.com";
// else if (sel == ENV_QAT_HOST)
// host = "e-qa.bambu-lab.com";
// else if (sel == ENV_PRE_HOST)
// host = "e-pre.bambu-lab.com";
// else if (sel == ENV_PRODUCT_HOST)
// host = "e.bambulab.com";
// return host;
// #else
return "e.bambulab.com";
#endif
// #endif
}
void AppConfig::reset()
@ -293,15 +293,15 @@ void AppConfig::set_defaults()
set("curr_bed_type", "0");
}
#if BBL_RELEASE_TO_PUBLIC
// #if BBL_RELEASE_TO_PUBLIC
if (get("iot_environment").empty()) {
set("iot_environment", "3");
}
#else
if (get("iot_environment").empty()) {
set("iot_environment", "1");
}
#endif
// #else
// if (get("iot_environment").empty()) {
// set("iot_environment", "1");
// }
// #endif
// Remove legacy window positions/sizes
erase("app", "main_frame_maximized");
@ -1030,29 +1030,29 @@ void AppConfig::update_last_backup_dir(const std::string& dir)
std::string AppConfig::get_region()
{
#if BBL_RELEASE_TO_PUBLIC
// #if BBL_RELEASE_TO_PUBLIC
return this->get("region");
#else
std::string sel = get("iot_environment");
std::string region;
if (sel == ENV_DEV_HOST)
region = "ENV_CN_DEV";
else if (sel == ENV_QAT_HOST)
region = "ENV_CN_QA";
else if (sel == ENV_PRE_HOST)
region = "ENV_CN_PRE";
if (region.empty())
return this->get("region");
return region;
#endif
// #else
// std::string sel = get("iot_environment");
// std::string region;
// if (sel == ENV_DEV_HOST)
// region = "ENV_CN_DEV";
// else if (sel == ENV_QAT_HOST)
// region = "ENV_CN_QA";
// else if (sel == ENV_PRE_HOST)
// region = "ENV_CN_PRE";
// if (region.empty())
// return this->get("region");
// return region;
// #endif
}
std::string AppConfig::get_country_code()
{
std::string region = get_region();
#if !BBL_RELEASE_TO_PUBLIC
if (is_engineering_region()) { return region; }
#endif
// #if !BBL_RELEASE_TO_PUBLIC
// if (is_engineering_region()) { return region; }
// #endif
if (region == "CHN" || region == "China")
return "CN";
else if (region == "USA")

View file

@ -55,6 +55,16 @@ inline bool is_perimeter(ExtrusionRole role)
|| role == erOverhangPerimeter;
}
inline bool is_internal_perimeter(ExtrusionRole role)
{
return role == erPerimeter;
}
inline bool is_external_perimeter(ExtrusionRole role)
{
return role == erExternalPerimeter;
}
inline bool is_infill(ExtrusionRole role)
{
return role == erBridgeInfill

View file

@ -92,7 +92,7 @@ struct SurfaceFillParams
this->overlap == rhs.overlap &&
this->angle == rhs.angle &&
this->bridge == rhs.bridge &&
// this->bridge_angle == rhs.bridge_angle &&
this->bridge_angle == rhs.bridge_angle &&
this->density == rhs.density &&
// this->dont_adjust == rhs.dont_adjust &&
this->anchor_length == rhs.anchor_length &&

View file

@ -14,7 +14,7 @@
#include "libslic3r.h"
#include "LocalesUtils.hpp"
#include "libslic3r/format.hpp"
#include "Time.hpp"
#include <algorithm>
#include <cstdlib>
#include <chrono>
@ -79,7 +79,7 @@ static const float g_min_purge_volume = 100.f;
static const float g_purge_volume_one_time = 135.f;
static const int g_max_flush_count = 4;
bool GCode::gcode_label_objects = false;
bool GCode::gcode_label_objects = true;
// Only add a newline in case the current G-code does not end with a newline.
static inline void check_add_eol(std::string& gcode)
@ -908,6 +908,11 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
BOOST_LOG_TRIVIAL(info) << boost::format("Will export G-code to %1% soon")%path;
print->set_started(psGCodeExport);
if (print->is_BBL_printer())
gcode_label_objects = false;
else
gcode_label_objects = true;
// check if any custom gcode contains keywords used by the gcode processor to
// produce time estimation and gcode toolpaths
std::vector<std::pair<std::string, std::string>> validation_res = DoExport::validate_custom_gcode(*print);
@ -1164,10 +1169,10 @@ namespace DoExport {
print_statistics.clear();
print_statistics.total_toolchanges = std::max(0, wipe_tower_data.number_of_toolchanges);
if (! extruders.empty()) {
//std::pair<std::string, unsigned int> out_filament_used_mm ("; filament used [mm] = ", 0);
//std::pair<std::string, unsigned int> out_filament_used_cm3("; filament used [cm3] = ", 0);
//std::pair<std::string, unsigned int> out_filament_used_g ("; filament used [g] = ", 0);
//std::pair<std::string, unsigned int> out_filament_cost ("; filament cost = ", 0);
std::pair<std::string, unsigned int> out_filament_used_mm ("; filament used [mm] = ", 0);
std::pair<std::string, unsigned int> out_filament_used_cm3("; filament used [cm3] = ", 0);
std::pair<std::string, unsigned int> out_filament_used_g ("; filament used [g] = ", 0);
std::pair<std::string, unsigned int> out_filament_cost ("; filament cost = ", 0);
for (const Extruder &extruder : extruders) {
double used_filament = extruder.used_filament() + (has_wipe_tower ? wipe_tower_data.used_filament[extruder.id()] : 0.f);
double extruded_volume = extruder.extruded_volume() + (has_wipe_tower ? wipe_tower_data.used_filament[extruder.id()] * 2.4052f : 0.f); // assumes 1.75mm filament diameter
@ -1187,14 +1192,14 @@ namespace DoExport {
dst.first += buf;
++ dst.second;
};
//append(out_filament_used_mm, "%.2lf", used_filament);
//append(out_filament_used_cm3, "%.2lf", extruded_volume * 0.001);
append(out_filament_used_mm, "%.2lf", used_filament);
append(out_filament_used_cm3, "%.2lf", extruded_volume * 0.001);
if (filament_weight > 0.) {
print_statistics.total_weight = print_statistics.total_weight + filament_weight;
//append(out_filament_used_g, "%.2lf", filament_weight);
append(out_filament_used_g, "%.2lf", filament_weight);
if (filament_cost > 0.) {
print_statistics.total_cost = print_statistics.total_cost + filament_cost;
//append(out_filament_cost, "%.2lf", filament_cost);
append(out_filament_cost, "%.2lf", filament_cost);
}
}
print_statistics.total_used_filament += used_filament;
@ -1202,12 +1207,12 @@ namespace DoExport {
print_statistics.total_wipe_tower_filament += has_wipe_tower ? used_filament - extruder.used_filament() : 0.;
print_statistics.total_wipe_tower_cost += has_wipe_tower ? (extruded_volume - extruder.extruded_volume())* extruder.filament_density() * 0.001 * extruder.filament_cost() * 0.001 : 0.;
}
//filament_stats_string_out += out_filament_used_mm.first;
//filament_stats_string_out += "\n" + out_filament_used_cm3.first;
//if (out_filament_used_g.second)
//filament_stats_string_out += "\n" + out_filament_used_g.first;
//if (out_filament_cost.second)
// filament_stats_string_out += "\n" + out_filament_cost.first;
filament_stats_string_out += out_filament_used_mm.first;
filament_stats_string_out += "\n" + out_filament_used_cm3.first;
if (out_filament_used_g.second)
filament_stats_string_out += "\n" + out_filament_used_g.first;
if (out_filament_cost.second)
filament_stats_string_out += "\n" + out_filament_cost.first;
}
return filament_stats_string_out;
}
@ -1285,7 +1290,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// modifies m_silent_time_estimator_enabled
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);
const bool is_bbl_printers = print.is_BBL_printer();
// resets analyzer's tracking data
m_last_height = 0.f;
m_last_layer_z = 0.f;
@ -1349,30 +1354,65 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
file.write_format("; HEADER_BLOCK_END\n\n");
//BBS: write global config at the beginning of gcode file because printer need these config information
// Append full config, delimited by two 'phony' configuration keys CONFIG_BLOCK_START and CONFIG_BLOCK_END.
// The delimiters are structured as configuration key / value pairs to be parsable by older versions of PrusaSlicer G-code viewer.
// BBS: write global config at the beginning of gcode file because printer
// need these config information
// Append full config, delimited by two 'phony' configuration keys
// CONFIG_BLOCK_START and CONFIG_BLOCK_END. The delimiters are structured
// as configuration key / value pairs to be parsable by older versions of
// PrusaSlicer G-code viewer.
{
if (is_bbl_printers) {
file.write("; CONFIG_BLOCK_START\n");
std::string full_config;
append_full_config(print, full_config);
if (!full_config.empty())
file.write(full_config);
file.write(full_config);
// SoftFever: write compatiple image
std::vector<int> temps_per_bed;
int first_layer_bed_temperature = 0;
get_bed_temperature(0, true, temps_per_bed,
first_layer_bed_temperature);
file.write_format("; first_layer_bed_temperature = %d\n",
first_layer_bed_temperature);
file.write_format(
"; first_layer_temperature = %d\n",
print.config().nozzle_temperature_initial_layer.get_at(0));
file.write("; CONFIG_BLOCK_END\n\n");
} else {
file.write_format("; hack-fix: write fake slicer info here so that "
"Moonraker will extract thumbs.\n");
file.write_format(
"; %s\n\n",
std::string(
std::string("generated by SuperSlicer " SLIC3R_VERSION " on ") +
Slic3r::Utils::utc_timestamp())
.c_str());
// BBS: add plate id into thumbnail render logic
// if (const auto [thumbnails, thumbnails_format] = std::make_pair(
// print.full_print_config().option<ConfigOptionPoints>("thumbnails"),
// print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format"));
// thumbnails)
// GCodeThumbnails::export_thumbnails_to_file(
// thumbnail_cb, thumbnails->values, thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
// [&file](const char* sz) { file.write(sz); },
// [&print]() { print.throw_if_canceled(); });
DoExport::export_thumbnails_to_file(
thumbnail_cb, print.get_plate_index(), print.full_print_config().option<ConfigOptionPoints>("thumbnails")->values,
[&file](const char *sz) { file.write(sz); },
[&print]() { print.throw_if_canceled(); });
}
}
//BBS: add plate id into thumbnail render logic
//DoExport::export_thumbnails_to_file(thumbnail_cb, print.get_plate_index(), THUMBNAIL_SIZE,
// [&file](const char* sz) { file.write(sz); },
// [&print]() { print.throw_if_canceled(); });
// Write some terse information on the slicing parameters.
const PrintObject *first_object = print.objects().front();
const double layer_height = first_object->config().layer_height.value;
const double initial_layer_print_height = print.config().initial_layer_print_height.value;
//BBS: remove useless information in gcode file
#if 0
for (size_t region_id = 0; region_id < print.num_print_regions(); ++ region_id) {
const PrintRegion &region = print.get_print_region(region_id);
file.write_format("; external perimeters extrusion width = %.2fmm\n", region.flow(*first_object, frExternalPerimeter, layer_height).width());
@ -1386,8 +1426,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write_format("; first layer extrusion width = %.2fmm\n", region.flow(*first_object, frPerimeter, initial_layer_print_height, true).width());
file.write_format("\n");
}
print.throw_if_canceled();
#endif
file.write_format("; EXECUTABLE_BLOCK_START\n");
// adds tags for time estimators
@ -1512,7 +1550,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_placeholder_parser.set("first_layer_print_max", new ConfigOptionFloats({ bbox.max.x(), bbox.max.y() }));
m_placeholder_parser.set("first_layer_print_size", new ConfigOptionFloats({ bbox.size().x(), bbox.size().y() }));
}
float outer_wall_volumetric_speed = 0.0f;
{
int curr_bed_type = m_config.curr_bed_type.getInt();
@ -1524,6 +1562,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_placeholder_parser.set("bed_temperature", new ConfigOptionInts(*bed_temp_opt));
m_placeholder_parser.set("bed_temperature_initial_layer_single", new ConfigOptionInt(first_bed_temp_opt->get_at(initial_extruder_id)));
m_placeholder_parser.set("bed_temperature_initial_layer_vector", new ConfigOptionString(""));
m_placeholder_parser.set("chamber_temperature",new ConfigOptionInt(m_config.chamber_temperature));
//BBS: calculate the volumetric speed of outer wall. Ignore pre-object setting and multi-filament, and just use the default setting
{
@ -1535,7 +1574,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
}
Flow outer_wall_flow = Flow(outer_wall_line_width, m_config.layer_height, m_config.nozzle_diameter.get_at(initial_extruder_id));
float outer_wall_speed = print.default_region_config().outer_wall_speed.value;
float outer_wall_volumetric_speed = outer_wall_speed * outer_wall_flow.mm3_per_mm();
outer_wall_volumetric_speed = outer_wall_speed * outer_wall_flow.mm3_per_mm();
if (outer_wall_volumetric_speed > filament_max_volumetric_speed)
outer_wall_volumetric_speed = filament_max_volumetric_speed;
m_placeholder_parser.set("outer_wall_volumetric_speed", new ConfigOptionFloat(outer_wall_volumetric_speed));
@ -1598,8 +1637,23 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
if (this->m_objsWithBrim.empty() && this->m_objSupportsWithBrim.empty()) m_brim_done = true;
//BBS: open spaghetti detector
// if (print.config().spaghetti_detector.value)
file.write("M981 S1 P20000 ;open spaghetti detector\n");
if (is_bbl_printers) {
// if (print.config().spaghetti_detector.value)
file.write("M981 S1 P20000 ;open spaghetti detector\n");
file.write_format("M900 K%.3f M%0.3f ; Override pressure advance value\n",
m_config.pressure_advance.values.front(),
outer_wall_volumetric_speed / (1.75 * 1.75 / 4 * 3.14) *
m_config.pressure_advance.values.front());
} else {
if (m_config.enable_pressure_advance.value) {
if(print.config().gcode_flavor.value == gcfKlipper)
file.write_format("SET_PRESSURE_ADVANCE ADVANCE=%.3f ; Override pressure advance value\n",
m_config.pressure_advance.values.front());
else
file.write_format("M900 K%.3f ; Override pressure advance value\n",
m_config.pressure_advance.values.front());
}
}
// Do all objects for each layer.
if (print.config().print_sequence == PrintSequence::ByObject) {
@ -1663,7 +1717,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
this->process_layers(print, tool_ordering, collect_layers_to_print(object), *print_object_instance_sequential_active - object.instances().data(), file, prime_extruder);
//BBS: close powerlost recovery
{
if (m_second_layer_things_done) {
if (is_bbl_printers && m_second_layer_things_done) {
file.write("; close powerlost recovery\n");
file.write("M1003 S0\n");
}
@ -1734,7 +1788,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
this->process_layers(print, tool_ordering, print_object_instances_ordering, layers_to_print, file);
//BBS: close powerlost recovery
{
if (m_second_layer_things_done) {
if (is_bbl_printers && m_second_layer_things_done) {
file.write("; close powerlost recovery\n");
file.write("M1003 S0\n");
}
@ -1754,10 +1808,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write(m_writer.set_fan(0));
//BBS: make sure the additional fan is closed when end
file.write(m_writer.set_additional_fan(0));
//BBS: close spaghetti detector
//Note: M981 is also used to tell xcam the last layer is finished, so we need always send it even if spaghetti option is disabled.
//if (print.config().spaghetti_detector.value)
file.write("M981 S0 P20000 ; close spaghetti detector\n");
if (is_bbl_printers) {
//BBS: close spaghetti detector
//Note: M981 is also used to tell xcam the last layer is finished, so we need always send it even if spaghetti option is disabled.
//if (print.config().spaghetti_detector.value)
file.write("M981 S0 P20000 ; close spaghetti detector\n");
}
// adds tag for processor
file.write_format(";%s%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Role).c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());
@ -1800,11 +1856,41 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_writer.extruders(),
// Modifies
print.m_print_statistics));
//file.write("\n");
//file.write_format("; total filament weight [g] = %.2lf\n", print.m_print_statistics.total_weight);
//file.write_format("; total filament cost = %.2lf\n", print.m_print_statistics.total_cost);
//if (print.m_print_statistics.total_toolchanges > 0)
// file.write_format("; total filament change = %i\n", print.m_print_statistics.total_toolchanges);
if (!is_bbl_printers) {
file.write("\n");
file.write("; CONFIG_BLOCK_START\n");
std::string full_config;
append_full_config(print, full_config);
if (!full_config.empty())
file.write(full_config);
// SoftFever: write compatiple info
std::vector<int> temps_per_bed;
int first_layer_bed_temperature = 0;
get_bed_temperature(0, true, temps_per_bed, first_layer_bed_temperature);
file.write_format("; first_layer_bed_temperature = %d\n",
first_layer_bed_temperature);
file.write_format(
"; first_layer_temperature = %d\n",
print.config().nozzle_temperature_initial_layer.get_at(0));
file.write("; CONFIG_BLOCK_END\n\n");
file.write_format("; total filament used [g] = %.2lf\n",
print.m_print_statistics.total_weight);
file.write_format("; total filament cost = %.2lf\n",
print.m_print_statistics.total_cost);
if (print.m_print_statistics.total_toolchanges > 0)
file.write_format("; total filament change = %i\n",
print.m_print_statistics.total_toolchanges);
file.write_format("; total layers count = %i\n", m_layer_count);
file.write_format(
";%s\n",
GCodeProcessor::reserved_tag(
GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder)
.c_str());
}
file.write("\n");
print.throw_if_canceled();
}
@ -2501,28 +2587,41 @@ GCode::LayerResult GCode::process_layer(
double acceleration = m_config.initial_layer_acceleration.value;
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
}
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
double jerk = m_config.initial_layer_jerk.value;
gcode += m_writer.set_jerk_xy((unsigned int)floor(jerk + 0.5));
}
}
if (! first_layer && ! m_second_layer_things_done) {
//BBS: open powerlost recovery
if (print.is_BBL_printer()) {
// BBS: open powerlost recovery
{
gcode += "; open powerlost recovery\n";
gcode += "M1003 S1\n";
gcode += "; open powerlost recovery\n";
gcode += "M1003 S1\n";
}
// BBS: open first layer inspection at second layer
if (print.config().scan_first_layer.value) {
// BBS: retract first to avoid droping when scan model
gcode += this->retract();
gcode += "M976 S1 P1 ; scan model before printing 2nd layer\n";
gcode += "M400 P100\n";
gcode += this->unretract();
// BBS: retract first to avoid droping when scan model
gcode += this->retract();
gcode += "M976 S1 P1 ; scan model before printing 2nd layer\n";
gcode += "M400 P100\n";
gcode += this->unretract();
}
}
//BBS: reset acceleration at sencond layer
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) {
double acceleration = m_config.default_acceleration.value;
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
}
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
double jerk = m_config.default_jerk.value;
gcode += m_writer.set_jerk_xy((unsigned int)floor(jerk + 0.5));
}
// Transition from 1st to 2nd layer. Adjust nozzle temperatures as prescribed by the nozzle dependent
// nozzle_temperature_initial_layer vs. temperature settings.
for (const Extruder &extruder : m_writer.extruders()) {
@ -3237,9 +3336,13 @@ 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.
if (!this->on_first_layer())
if (!this->on_first_layer()){
// reset acceleration
gcode += m_writer.set_acceleration((unsigned int)(m_config.default_acceleration.value + 0.5));
if(m_config.default_acceleration.value > 0)
gcode += m_writer.set_acceleration((unsigned int)(m_config.default_acceleration.value + 0.5));
if(m_config.default_jerk.value > 0)
gcode += m_writer.set_jerk_xy((unsigned int)(m_config.default_jerk.value + 0.5));
}
// BBS
if (m_wipe.enable) {
@ -3312,9 +3415,12 @@ std::string GCode::extrude_multi_path(ExtrusionMultiPath multipath, std::string
m_wipe.path.reverse();
}
//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
gcode += m_writer.set_acceleration((unsigned int)floor(m_config.default_acceleration.value + 0.5));
if(m_config.default_jerk.value > 0)
gcode += m_writer.set_jerk_xy((unsigned int)floor(m_config.default_jerk.value + 0.5));
}
return gcode;
}
@ -3340,9 +3446,13 @@ std::string GCode::extrude_path(ExtrusionPath path, std::string description, dou
m_wipe.path.reverse();
}
//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
gcode += m_writer.set_acceleration((unsigned int)floor(m_config.default_acceleration.value + 0.5));
if(m_config.default_jerk.value > 0)
gcode += m_writer.set_jerk_xy((unsigned int)floor(m_config.default_jerk.value + 0.5));
}
return gcode;
}
@ -3541,6 +3651,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
} else if (m_config.perimeter_acceleration.value > 0 && is_perimeter(path.role())) {
acceleration = m_config.perimeter_acceleration.value;
#endif
} else if (m_config.outer_wall_acceleration.value > 0 && is_external_perimeter(path.role())) {
acceleration = m_config.outer_wall_acceleration.value;
} else if (m_config.inner_wall_acceleration.value > 0 && is_internal_perimeter(path.role())) {
acceleration = m_config.inner_wall_acceleration.value;
} else if (m_config.top_surface_acceleration.value > 0 && is_top_surface(path.role())) {
acceleration = m_config.top_surface_acceleration.value;
} else {
@ -3549,6 +3663,23 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
}
// adjust X Y jerk
if (m_config.default_jerk.value > 0) {
double jerk;
if (this->on_first_layer() && m_config.initial_layer_jerk.value > 0) {
jerk = m_config.initial_layer_jerk.value;
} else if (m_config.outer_wall_jerk.value > 0 && is_external_perimeter(path.role())) {
jerk = m_config.outer_wall_jerk.value;
} else if (m_config.inner_wall_jerk.value > 0 && is_internal_perimeter(path.role())) {
jerk = m_config.inner_wall_jerk.value;
} else if (m_config.top_surface_jerk.value > 0 && is_top_surface(path.role())) {
jerk = m_config.top_surface_jerk.value;
} else {
jerk = m_config.default_jerk.value;
}
gcode += m_writer.set_jerk_xy((unsigned int)floor(jerk + 0.5));
}
// calculate extrusion length per distance unit
double e_per_mm = m_writer.extruder()->e_per_mm3() * path.mm3_per_mm;
@ -3761,7 +3892,34 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
bool could_be_wipe_disabled = false;
// Save state of use_external_mp_once for the case that will be needed to call twice m_avoid_crossing_perimeters.travel_to.
const bool used_external_mp_once = m_avoid_crossing_perimeters.used_external_mp_once();
std::string gcode;
// SoftFever
if (this->on_first_layer()) {
if(m_config.default_acceleration.value > 0)
{
auto jerk = (unsigned int)floor(m_config.initial_layer_jerk.value + 0.5);
auto accel = (unsigned int)floor(m_config.initial_layer_acceleration.value + 0.5);
if(jerk > 0)
gcode += m_writer.set_jerk_xy(jerk);
if(accel > 0)
gcode += m_writer.set_acceleration(accel);
}
}
else
{
if(m_config.default_jerk.value > 0)
{
auto jerk = (unsigned int)floor(m_config.travel_jerk.value + 0.5);
auto accel = (unsigned int)floor(m_config.travel_acceleration.value + 0.5);
if(jerk > 0)
gcode += m_writer.set_jerk_xy(jerk);
if(accel > 0)
gcode += m_writer.set_acceleration(accel);
}
}
// if a retraction would be needed, try to use reduce_crossing_wall to plan a
// multi-hop travel path inside the configuration space
if (needs_retraction
@ -3777,7 +3935,6 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
m_avoid_crossing_perimeters.reset_once_modifiers();
// generate G-code for the travel move
std::string gcode;
if (needs_retraction) {
if (m_config.reduce_crossing_wall && could_be_wipe_disabled)
m_wipe.reset_path();
@ -3808,9 +3965,9 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
if (i == travel.size() - 1 && !m_spiral_vase) {
Vec2d dest2d = this->point_to_gcode(travel.points[i]);
Vec3d dest3d(dest2d(0), dest2d(1), m_nominal_z);
gcode += m_writer.travel_to_xyz(dest3d, comment);
gcode += m_writer.travel_to_xyz(dest3d, comment+" travel_to_xyz");
} else {
gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment);
gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment+" travel_to_xy");
}
}
this->set_last_pos(travel.points.back());
@ -3884,7 +4041,11 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction)
if (m_writer.extruder()->retraction_length() > 0) {
// BBS: don't do lazy_lift when enable spiral vase
size_t extruder_id = m_writer.extruder()->id();
gcode += m_writer.lift(!m_spiral_vase ? LiftType::SpiralLift : LiftType::NormalLift);
auto _lift = m_config.z_lift_type.value;
if(m_spiral_vase)
_lift = NormalLift;
gcode += m_writer.lift(_lift);
}
return gcode;

View file

@ -453,10 +453,7 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
char buf[128];
//sprintf(buf, "; estimated printing time (%s mode) = %s\n",
// (mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
// get_time_dhms(machine.time).c_str());
sprintf(buf, "; total estimated time: %s\n", get_time_dhms(machine.time).c_str());
sprintf(buf, "; estimated printing time: %s\n", get_time_dhms(machine.time).c_str());
ret += buf;
}
}

View file

@ -99,8 +99,7 @@ public:
}
WipeTowerWriter& disable_linear_advance() {
m_gcode += (m_gcode_flavor == gcfRepRapSprinter || m_gcode_flavor == gcfRepRapFirmware
? (std::string("M572 D") + std::to_string(m_current_tool) + " S0\n")
m_gcode += (m_gcode_flavor == gcfKlipper ? (std::string("SET_PRESSURE_ADVANCE ADVANCE=0\n"))
: std::string("M900 K0\n"));
return *this;
}

View file

@ -15,15 +15,16 @@
namespace Slic3r {
const bool GCodeWriter::full_gcode_comment = false;
const bool GCodeWriter::full_gcode_comment = true;
const double GCodeWriter::slope_threshold = 3 * PI / 180;
void GCodeWriter::apply_print_config(const PrintConfig &print_config)
{
this->config.apply(print_config, true);
m_single_extruder_multi_material = print_config.single_extruder_multi_material.value;
bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware;
bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || print_config.gcode_flavor.value == gcfKlipper;
m_max_acceleration = std::lrint(is_marlin ? print_config.machine_max_acceleration_extruding.values.front() : 0);
m_max_jerk = std::lrint(is_marlin ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
}
void GCodeWriter::set_extruders(std::vector<unsigned int> extruder_ids)
@ -54,7 +55,8 @@ std::string GCodeWriter::preamble()
FLAVOR_IS(gcfMarlinFirmware) ||
FLAVOR_IS(gcfTeacup) ||
FLAVOR_IS(gcfRepetier) ||
FLAVOR_IS(gcfSmoothie))
FLAVOR_IS(gcfSmoothie) ||
FLAVOR_IS(gcfKlipper))
{
if (RELATIVE_E_AXIS) {
gcode << "M83 ; only support relative e\n";
@ -183,6 +185,30 @@ std::string GCodeWriter::set_acceleration(unsigned int acceleration)
return gcode.str();
}
std::string GCodeWriter::set_jerk_xy(unsigned int jerk)
{
// Clamp the jerk to the allowed maximum.
if (m_max_jerk > 0 && jerk > m_max_jerk)
jerk = m_max_jerk;
if (jerk < 1 || jerk == m_last_jerk)
return std::string();
m_last_jerk = jerk;
std::ostringstream gcode;
if(FLAVOR_IS(gcfKlipper))
gcode << "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=" << jerk;
else
gcode << "M205 X" << jerk << " Y" << jerk;
if (GCodeWriter::full_gcode_comment) gcode << " ; adjust jerk";
gcode << "\n";
return gcode.str();
}
std::string GCodeWriter::reset_e(bool force)
{
if (FLAVOR_IS(gcfMach3)

View file

@ -11,12 +11,6 @@
namespace Slic3r {
enum class LiftType {
NormalLift,
LazyLift,
SpiralLift
};
class GCodeWriter {
public:
GCodeConfig config;
@ -26,6 +20,7 @@ public:
multiple_extruders(false), m_extruder(nullptr),
m_single_extruder_multi_material(false),
m_last_acceleration(0), m_max_acceleration(0),
m_last_jerk(0), m_max_jerk(0),
/*m_last_bed_temperature(0), */m_last_bed_temperature_reached(true),
m_lifted(0),
m_to_lift(0),
@ -51,6 +46,7 @@ public:
// BBS
std::string set_bed_temperature(std::vector<int> temps_per_bed, int default_temp, bool wait = false);
std::string set_acceleration(unsigned int acceleration);
std::string set_jerk_xy(unsigned int jerk);
std::string reset_e(bool force = false);
std::string update_progress(unsigned int num, unsigned int tot, bool allow_100 = false) const;
// return false if this extruder was already selected
@ -104,6 +100,13 @@ private:
// Limit for setting the acceleration, to respect the machine limits set for the Marlin firmware.
// If set to zero, the limit is not in action.
unsigned int m_max_acceleration;
unsigned int m_max_jerk;
unsigned int m_last_jerk;
unsigned int m_travel_acceleration;
unsigned int m_travel_jerk;
//BBS
unsigned int m_last_additional_fan_speed;
// BBS

View file

@ -296,8 +296,10 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
printf("Processing bridge at layer %zu:\n", this->layer()->id());
#endif
//BBS: use 0 as custom angle to enable auto detection all the time
double custom_angle = Geometry::deg2rad(0.0);
if (bd.detect_angle(custom_angle)) {
double custom_angle = Geometry::deg2rad(this->region().config().bridge_angle.value);
if(custom_angle > 0)
bridges[idx_last].bridge_angle = custom_angle;
else if (bd.detect_angle(custom_angle)) {
bridges[idx_last].bridge_angle = bd.angle;
if (this->layer()->object()->has_support()) {
// polygons_append(this->bridged, bd.coverage());

View file

@ -412,6 +412,8 @@ void PerimeterGenerator::process()
for (const Surface &surface : this->slices->surfaces) {
// detect how many perimeters must be generated for this island
int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops
if (this->layer_id == 0 && this->config->only_one_wall_first_layer)
loop_number = 0;
//BBS: set the topmost layer to be one wall
if (loop_number > 0 && config->only_one_wall_top && this->upper_slices == nullptr)
loop_number = 0;

View file

@ -697,8 +697,9 @@ static std::vector<std::string> s_Preset_print_options {
#endif /* HAS_PRESSURE_EQUALIZER */
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "sparse_infill_speed", "internal_solid_infill_speed",
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
"bridge_speed", "bridge_angle", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "travel_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk",
"brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers",
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
"support_base_pattern", "support_base_pattern_spacing", "support_style",
@ -722,14 +723,17 @@ static std::vector<std::string> s_Preset_print_options {
"detect_narrow_internal_solid_infill",
"gcode_add_line_number", "enable_arc_fitting", "infill_combination", "adaptive_layer_height",
"support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed",
"initial_layer_infill_speed", "only_one_wall_top",
"timelapse_type"
"initial_layer_infill_speed", "only_one_wall_top", "only_one_wall_first_layer",
"timelapse_type",
//SoftFever
"top_solid_infill_flow_ratio","bottom_solid_infill_flow_ratio"
};
static std::vector<std::string> s_Preset_filament_options {
/*"filament_colour", */"filament_diameter", "filament_type", "filament_soluble", "filament_is_support", "filament_max_volumetric_speed",
"filament_flow_ratio", "filament_density", "filament_cost", "filament_minimal_purge_on_wipe_tower",
"nozzle_temperature", "nozzle_temperature_initial_layer",
"filament_flow_ratio", "enable_pressure_advance", "pressure_advance", "filament_density", "filament_cost", "filament_minimal_purge_on_wipe_tower",
"chamber_temperature", "nozzle_temperature", "nozzle_temperature_initial_layer",
// BBS
"cool_plate_temp", "eng_plate_temp", "hot_plate_temp", "textured_plate_temp", "cool_plate_temp_initial_layer", "eng_plate_temp_initial_layer", "hot_plate_temp_initial_layer","textured_plate_temp_initial_layer",
// "bed_type",
@ -757,18 +761,20 @@ static std::vector<std::string> s_Preset_machine_limits_options {
static std::vector<std::string> s_Preset_printer_options {
"printer_technology",
"printable_area", "bed_exclude_area", "gcode_flavor",
"printable_area", "bed_exclude_area", "gcode_flavor","z_lift_type",
"single_extruder_multi_material", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "layer_change_gcode", "change_filament_gcode",
"printer_model", "printer_variant", "printable_height", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod",
"default_print_profile", "inherits",
"silent_mode",
// BBS
"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode",
"nozzle_type", "auxiliary_fan", "nozzle_volume",
"nozzle_type", "nozzle_diameter", "auxiliary_fan", "nozzle_volume",
//SoftFever
"host_type", "print_host", "printhost_apikey",
"printhost_cafile","printhost_port","printhost_authorization_type",
"printhost_user", "printhost_password", "printhost_ssl_ignore_revoke"
"printhost_user",
"printhost_password",
"printhost_ssl_ignore_revoke", "thumbnails"
};
static std::vector<std::string> s_Preset_sla_print_options {
@ -2238,6 +2244,21 @@ void add_correct_opts_to_diff(const std::string &opt_key, t_config_option_keys&
}
}
// template<class T>
// void add_correct_opt_to_diff(const std::string &opt_key, t_config_option_keys& vec, const ConfigBase &other, const ConfigBase &this_c)
// {
// const T* opt_init = static_cast<const T*>(other.option(opt_key));
// const T* opt_cur = static_cast<const T*>(this_c.option(opt_key));
// int opt_init_max_id = opt_init->values.size() - 1;
// for (int i = 0; i < int(opt_cur->values.size()); i++)
// {
// int init_id = i <= opt_init_max_id ? i : 0;
// if (opt_cur->values[i] != opt_init->values[init_id])
// vec.emplace_back(opt_key + "#" + std::to_string(i));
// }
// }
// Use deep_diff to correct return of changed options, considering individual options for each extruder.
inline t_config_option_keys deep_diff(const ConfigBase &config_this, const ConfigBase &config_other)
{
@ -2248,7 +2269,7 @@ inline t_config_option_keys deep_diff(const ConfigBase &config_this, const Confi
if (this_opt != nullptr && other_opt != nullptr && *this_opt != *other_opt)
{
//BBS: add bed_exclude_area
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers") {
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "thumbnails") {
// Scalar variable, or a vector variable, which is independent from number of extruders,
// thus the vector is presented to the user as a single input.
diff.emplace_back(opt_key);
@ -2261,6 +2282,7 @@ inline t_config_option_keys deep_diff(const ConfigBase &config_this, const Confi
case coBools: add_correct_opts_to_diff<ConfigOptionBools >(opt_key, diff, config_other, config_this); break;
case coFloats: add_correct_opts_to_diff<ConfigOptionFloats >(opt_key, diff, config_other, config_this); break;
case coStrings: add_correct_opts_to_diff<ConfigOptionStrings >(opt_key, diff, config_other, config_this); break;
// case coString: add_correct_opts_to_diff<ConfigOptionString >(opt_key, diff, config_other, config_this); break;
case coPercents:add_correct_opts_to_diff<ConfigOptionPercents >(opt_key, diff, config_other, config_this); break;
case coPoints: add_correct_opts_to_diff<ConfigOptionPoints >(opt_key, diff, config_other, config_this); break;
// BBS
@ -2741,6 +2763,8 @@ void PhysicalPrinterCollection::load_printers(
// see https://github.com/prusa3d/PrusaSlicer/issues/732
boost::filesystem::path dir = boost::filesystem::absolute(boost::filesystem::path(dir_path) / subdir).make_preferred();
m_dir_path = dir.string();
if(!boost::filesystem::exists(dir))
return;
std::string errors_cummulative;
// Store the loaded printers into a new vector, otherwise the binary search for already existing presets would be broken.
std::deque<PhysicalPrinter> printers_loaded;

View file

@ -38,9 +38,9 @@ static std::vector<std::string> s_project_options {
"wipe_tower_y",
"wipe_tower_rotation_angle",
"curr_bed_type",
#if !BBL_RELEASE_TO_PUBLIC
// #if !BBL_RELEASE_TO_PUBLIC
"flush_multiplier",
#endif
// #endif
};
//BBS: add BBL as default
@ -90,7 +90,7 @@ PresetBundle::PresetBundle()
for (size_t i = 0; i < 1; ++i) {
// The following ugly switch is to avoid printers.preset(0) to return the edited instance, as the 0th default is the current one.
Preset &preset = this->printers.default_preset(i);
for (const char *key : {"printer_settings_id", "printer_model", "printer_variant"}) preset.config.optptr(key, true);
for (const char *key : {"printer_settings_id", "printer_model", "printer_variant", "thumbnails"}) preset.config.optptr(key, true);
//if (i == 0) {
preset.config.optptr("default_print_profile", true);
preset.config.option<ConfigOptionStrings>("default_filament_profile", true);
@ -1419,8 +1419,10 @@ DynamicPrintConfig PresetBundle::full_config() const
DynamicPrintConfig PresetBundle::full_config_secure() const
{
DynamicPrintConfig config = this->full_config();
//BBS example: config.erase("print_host");
return config;
//FIXME legacy, the keys should not be there after conversion to a Physical Printer profile.
config.erase("print_host");
config.erase("printhost_apikey");
config.erase("printhost_cafile"); return config;
}
const std::set<std::string> ignore_settings_list ={
@ -2960,7 +2962,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
//parse error
std::string subfile_path = path + "/" + vendor_name + "/" + subfile.second;
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(", got error when parse process setting from %1%") % subfile_path;
throw ConfigurationError((boost::format("Failed loading configuration file %1%\nSuggest cleaning the directory %2% firstly") % subfile_path %vendor_system_path).str());
throw ConfigurationError((boost::format("Failed loading configuration file %1%\nSuggest cleaning the directory %2% firstly.\nReason: %3%") % subfile_path %vendor_system_path %reason).str());
}
}
@ -3435,4 +3437,4 @@ void PresetBundle::set_default_suppressed(bool default_suppressed)
printers.set_default_suppressed(default_suppressed);
}
} // namespace Slic3r
} // namespace Slic3r

View file

@ -68,7 +68,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
//BBS: add bed_exclude_area
"bed_exclude_area",
"before_layer_change_gcode",
"enable_overhang_bridge_fan"
"enable_pressure_advance",
"pressure_advance",
"enable_overhang_bridge_fan",
"overhang_fan_speed",
"overhang_fan_threshold",
"slow_down_for_layer_cooling",
@ -90,8 +92,11 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"filament_diameter",
"filament_density",
"filament_cost",
"outer_wall_acceleration",
"inner_wall_acceleration",
"initial_layer_acceleration",
"top_surface_acceleration",
"travel_acceleration",
// BBS
"cool_plate_temp_initial_layer",
"eng_plate_temp_initial_layer",
@ -124,10 +129,13 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"filament_start_gcode",
"change_filament_gcode",
"wipe",
"z_lift_type",
// BBS
"wipe_distance",
"curr_bed_type",
"nozzle_volume"
"nozzle_volume",
"chamber_temperature",
"thumbnails"
};
static std::unordered_set<std::string> steps_ignore;
@ -164,6 +172,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
} else if (
opt_key == "print_sequence"
|| opt_key == "filament_type"
|| opt_key == "chamber_temperature"
|| opt_key == "nozzle_temperature_initial_layer"
|| opt_key == "filament_minimal_purge_on_wipe_tower"
|| opt_key == "filament_max_volumetric_speed"

View file

@ -728,7 +728,11 @@ public:
// Return 4 wipe tower corners in the world coordinates (shifted and rotated), including the wipe tower brim.
std::vector<Point> first_layer_wipe_tower_corners(bool check_wipe_tower_existance=true) const;
protected:
//SoftFever
bool &is_BBL_printer() { return m_isBBLPrinter; }
const bool is_BBL_printer() const { return m_isBBLPrinter; }
protected:
// Invalidates the step, and its depending steps in Print.
bool invalidate_step(PrintStep step);
@ -750,6 +754,9 @@ private:
PrintRegionConfig m_default_region_config;
PrintObjectPtrs m_objects;
PrintRegionPtrs m_print_regions;
//SoftFever
bool m_isBBLPrinter;
// Ordered collections of extrusion paths to build skirt loops and brim.
ExtrusionEntityCollection m_skirt;

View file

@ -72,18 +72,18 @@ static t_config_enum_values s_keys_map_PrinterTechnology {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrinterTechnology)
static t_config_enum_values s_keys_map_PrintHostType{
static t_config_enum_values s_keys_map_PrintHostType {
{ "prusalink", htPrusaLink },
{ "octoprint", htOctoPrint },
//{ "duet", htDuet },
//{ "flashair", htFlashAir },
//{ "astrobox", htAstroBox },
//{ "repetier", htRepetier },
//{ "mks", htMKS }
{ "duet", htDuet },
{ "flashair", htFlashAir },
{ "astrobox", htAstroBox },
{ "repetier", htRepetier },
{ "mks", htMKS }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrintHostType)
static t_config_enum_values s_keys_map_AuthorizationType{
static t_config_enum_values s_keys_map_AuthorizationType {
{ "key", atKeyPassword },
{ "user", atUserPassword }
};
@ -98,6 +98,7 @@ static t_config_enum_values s_keys_map_GCodeFlavor {
{ "makerware", gcfMakerWare },
{ "marlin2", gcfMarlinFirmware },
{ "sailfish", gcfSailfish },
{ "klipper", gcfKlipper },
{ "smoothie", gcfSmoothie },
{ "mach3", gcfMach3 },
{ "machinekit", gcfMachinekit },
@ -105,6 +106,15 @@ static t_config_enum_values s_keys_map_GCodeFlavor {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(GCodeFlavor)
static t_config_enum_values s_keys_map_LiftType {
{ "NormalLift", int(LiftType::NormalLift) },
{ "LazyLift", int(LiftType::LazyLift) },
{ "SpiralLift", int(LiftType::SpiralLift) }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(LiftType)
static t_config_enum_values s_keys_map_FuzzySkinType {
{ "none", int(FuzzySkinType::None) },
{ "external", int(FuzzySkinType::External) },
@ -317,7 +327,7 @@ void PrintConfigDef::init_common_params()
def = this->add("printable_area", coPoints);
def->label = L("Printable area");
//BBS
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPoints{ Vec2d(0, 0), Vec2d(200, 0), Vec2d(200, 200), Vec2d(0, 200) });
//BBS: add "bed_exclude_area"
@ -575,7 +585,7 @@ void PrintConfigDef::init_fff_params()
def->multiline = true;
def->full_width = true;
def->height = 5;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionString(""));
def = this->add("bottom_shell_layers", coInt);
@ -644,12 +654,38 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1));
def = this->add("top_solid_infill_flow_ratio", coFloat);
def->label = L("Top surface flow ratio");
def->category = L("Advanced");
def->tooltip = L("This factor affects the amount of material for top solid infill. "
"You can decrease it slightly to have smooth surface finish");
def->min = 0;
def->max = 2;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1));
def = this->add("bottom_solid_infill_flow_ratio", coFloat);
def->label = L("Bottom surface flow ratio");
def->category = L("Advanced");
def->tooltip = L("This factor affects the amount of material for bottom solid infill");
def->min = 0;
def->max = 2;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1));
def = this->add("only_one_wall_top", coBool);
def->label = L("Only one wall on top surfaces");
def->category = L("Quality");
def->tooltip = L("Use only one wall on flat top surface, to give more space to the top infill pattern");
def->set_default_value(new ConfigOptionBool(false));
def = this->add("only_one_wall_first_layer", coBool);
def->label = L("Only one wall on first layer");
def->category = L("Quality");
def->tooltip = L("Use only one wall on first layer, to give more space to the bottom infill pattern");
def->set_default_value(new ConfigOptionBool(false));
def = this->add("enable_overhang_speed", coBool);
def->label = L("Slow down for overhang");
def->category = L("Speed");
@ -975,7 +1011,7 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back("3");
def->enum_labels.push_back("4");
def->enum_labels.push_back("5");
def->mode = comDevelop;
def->mode = comAdvanced;
def = this->add("extruder_clearance_height_to_rod", coFloat);
def->label = L("Height to rod");
@ -1009,7 +1045,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Only used as a visual help on UI");
def->gui_type = ConfigOptionDef::GUIType::color;
// Empty string means no color assigned yet.
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionStrings { "" });
def = this->add("extruder_offset", coPoints);
@ -1019,7 +1055,7 @@ void PrintConfigDef::init_fff_params()
// "with respect to the first one. It expects positive coordinates (they will be subtracted "
// "from the XY coordinate).");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPoints { Vec2d(0,0) });
def = this->add("filament_flow_ratio", coFloats);
@ -1032,6 +1068,18 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 1. });
def = this->add("enable_pressure_advance", coBool);
def->label = L("Enable pressure advance");
def->tooltip = L("Enable pressure advance, auto calibration result will be overwriten once enabled.");
def->set_default_value(new ConfigOptionBool(false));
def = this->add("pressure_advance", coFloats);
def->label = L("Pressure advance");
def->tooltip = L("Pressure advnce(Klipper) AKA Linear advance factor(Marlin)");
def->max = 2;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0.02 });
def = this->add("line_width", coFloat);
def->label = L("Default");
def->category = L("Quality");
@ -1062,7 +1110,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Color");
def->tooltip = L("Only used as a visual help on UI");
def->gui_type = ConfigOptionDef::GUIType::color;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionStrings{ "#00AE42" });
def = this->add("filament_max_volumetric_speed", coFloats);
@ -1077,13 +1125,13 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_minimal_purge_on_wipe_tower", coFloats);
def->label = L("Minimal purge on wipe tower");
//def->tooltip = L("After a tool change, the exact position of the newly loaded filament inside "
// "the nozzle may not be known, and the filament pressure is likely not yet stable. "
// "Before purging the print head into an infill or a sacrificial object, Slic3r will always prime "
// "this amount of material into the wipe tower to produce successive infill or sacrificial object extrusions reliably.");
def->tooltip = L("After a tool change, the exact position of the newly loaded filament inside "
"the nozzle may not be known, and the filament pressure is likely not yet stable. "
"Before purging the print head into an infill or a sacrificial object, Slic3r will always prime "
"this amount of material into the wipe tower to produce successive infill or sacrificial object extrusions reliably.");
def->sidetext = L("mm³");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 15. });
def = this->add("machine_load_filament_time", coFloat);
@ -1139,13 +1187,13 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_soluble", coBools);
def->label = L("Soluble material");
def->tooltip = L("Soluble material is commonly used to print support and support interface");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBools { false });
def = this->add("filament_is_support", coBools);
def->label = L("Support material");
def->tooltip = L("Support material is commonly used to print support and support interface");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBools { false });
// BBS
@ -1186,6 +1234,16 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(45));
def = this->add("bridge_angle", coFloat);
def->label = L("Bridge infill direction");
def->category = L("Strength");
def->tooltip = L("Angle for bridge infill pattern, which controls the start or main direction of line");
def->sidetext = L("°");
def->min = 0;
def->max = 360;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("sparse_infill_density", coPercent);
def->label = L("Sparse infill density");
def->category = L("Strength");
@ -1240,6 +1298,30 @@ void PrintConfigDef::init_fff_params()
#endif // HAS_LIGHTNING_INFILL
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipCubic));
def = this->add("outer_wall_acceleration", coFloat);
def->label = L("Outer wall");
def->tooltip = L("Acceleration of outer walls");
def->sidetext = L("mm/s²");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(10000));
def = this->add("inner_wall_acceleration", coFloat);
def->label = L("Inner wall");
def->tooltip = L("Acceleration of inner walls");
def->sidetext = L("mm/s²");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(10000));
def = this->add("travel_acceleration", coFloat);
def->label = L("Travel");
def->tooltip = L("Acceleration of travel moves");
def->sidetext = L("mm/s²");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(10000));
def = this->add("top_surface_acceleration", coFloat);
def->label = L("Top surface");
def->tooltip = L("Acceleration of top surface infill. Using a lower value may improve top surface quality");
@ -1256,6 +1338,54 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(300));
def = this->add("default_jerk", coFloat);
def->label = L("Default");
def->tooltip = L("Default");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("outer_wall_jerk", coFloat);
def->label = L("Outer wall");
def->tooltip = L("Jerk of outer walls");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(9));
def = this->add("inner_wall_jerk", coFloat);
def->label = L("Inner wall");
def->tooltip = L("Jerk of inner walls");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(9));
def = this->add("top_surface_jerk", coFloat);
def->label = L("Top surface");
def->tooltip = L("Jerk for top surface");
def->sidetext = L("mm/s");
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(9));
def = this->add("initial_layer_jerk", coFloat);
def->label = L("Initial layer");
def->tooltip = L("Jerk for initial layer");
def->sidetext = L("mm/s");
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(9));
def = this->add("travel_jerk", coFloat);
def->label = L("Travel");
def->tooltip = L("Jerk for travel");
def->sidetext = L("mm/s");
def->min = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(12));
def = this->add("initial_layer_line_width", coFloat);
def->label = L("Initial layer");
def->category = L("Quality");
@ -1338,7 +1468,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("The width within which to jitter. It's adversed to be below outer wall line width");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.3));
def = this->add("fuzzy_skin_point_distance", coFloat);
@ -1346,7 +1476,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Others");
def->tooltip = L("The average diatance between the random points introducded on each line segment");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.8));
def = this->add("gap_infill_speed", coFloat);
@ -1376,7 +1506,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("scan_first_layer", coBool);
def->label = L("Scan first layer");
def->tooltip = L("Enable this to enable the camera on printer to check the quality of first layer");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
//BBS
// def = this->add("spaghetti_detector", coBool);
@ -1398,13 +1528,13 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back(L("Hardened steel"));
def->enum_labels.push_back(L("Stainless steel"));
def->enum_labels.push_back(L("Brass"));
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<NozzleType>(ntUndefine));
def = this->add("auxiliary_fan", coBool);
def->label = L("Auxiliary part cooling fan");
def->tooltip = L("Enable this option if machine has auxiliary part cooling fan");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("gcode_flavor", coEnum);
@ -1412,7 +1542,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("What kind of gcode the printer is compatible with");
def->enum_keys_map = &ConfigOptionEnum<GCodeFlavor>::get_enum_values();
def->enum_values.push_back("marlin");
//def->enum_values.push_back("reprap");
def->enum_values.push_back("klipper");
//def->enum_values.push_back("reprapfirmware");
//def->enum_values.push_back("repetier");
//def->enum_values.push_back("teacup");
@ -1435,6 +1565,7 @@ void PrintConfigDef::init_fff_params()
//def->enum_labels.push_back("Machinekit");
//def->enum_labels.push_back("Smoothie");
//def->enum_labels.push_back(L("No extrusion"));
def->enum_labels.push_back(L("Klipper"));
def->mode = comAdvanced;
def->readonly = false;
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfMarlinLegacy));
@ -1500,13 +1631,13 @@ void PrintConfigDef::init_fff_params()
def->cli = ConfigOptionDef::nocli;
def = this->add("interface_shells", coBool);
//def->label = L("Interface shells");
def->label = L("Interface shells");
def->label = "Interface shells";
//def->tooltip = L("Force the generation of solid shells between adjacent materials/volumes. "
// "Useful for multi-extruder prints with translucent materials or manual soluble "
// "support material");
def->tooltip = L("Force the generation of solid shells between adjacent materials/volumes. "
"Useful for multi-extruder prints with translucent materials or manual soluble "
"support material");
def->category = L("Quality");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("ironing_type", coEnum);
@ -1554,7 +1685,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Print speed of ironing lines");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(20));
def = this->add("layer_change_gcode", coString);
@ -1715,7 +1846,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Maximum acceleration for travel (M204 T)");
def->sidetext = L("mm/s²");
def->min = 0;
def->readonly = true;
def->readonly = false;
def->mode = comDevelop;
def->set_default_value(new ConfigOptionFloats{ 1500., 1250. });
@ -1735,7 +1866,7 @@ void PrintConfigDef::init_fff_params()
"the maximum layer hight when enable adaptive layer height");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0. });
#ifdef HAS_PRESSURE_EQUALIZER
@ -1787,7 +1918,7 @@ void PrintConfigDef::init_fff_params()
"the minimum layer hight when enable adaptive layer height");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0.07 });
def = this->add("slow_down_min_speed", coFloats);
@ -1795,44 +1926,45 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("The minimum printing speed when slow down for cooling");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 10. });
def = this->add("nozzle_diameter", coFloats);
def->label = L("Nozzle diameter");
def->tooltip = L("Diameter of nozzle");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0.4 });
def = this->add("host_type", coEnum);
def->label = L("Host Type");
def->tooltip = L("Slic3r can upload G-code files to a printer host. This field must contain "
"the kind of the host.");
"the kind of the host.");
def->enum_keys_map = &ConfigOptionEnum<PrintHostType>::get_enum_values();
def->enum_values.push_back("prusalink");
def->enum_values.push_back("octoprint");
//def->enum_values.push_back("duet");
//def->enum_values.push_back("flashair");
//def->enum_values.push_back("astrobox");
//def->enum_values.push_back("repetier");
//def->enum_values.push_back("mks");
def->enum_values.push_back("duet");
def->enum_values.push_back("flashair");
def->enum_values.push_back("astrobox");
def->enum_values.push_back("repetier");
def->enum_values.push_back("mks");
def->enum_labels.push_back("PrusaLink");
def->enum_labels.push_back("OctoPrint");
//def->enum_labels.push_back("Duet");
//def->enum_labels.push_back("FlashAir");
//def->enum_labels.push_back("AstroBox");
//def->enum_labels.push_back("Repetier");
//def->enum_labels.push_back("MKS");
def->enum_labels.push_back("Duet");
def->enum_labels.push_back("FlashAir");
def->enum_labels.push_back("AstroBox");
def->enum_labels.push_back("Repetier");
def->enum_labels.push_back("MKS");
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionEnum<PrintHostType>(htOctoPrint));
def = this->add("nozzle_volume", coFloat);
def->label = L("Nozzle volume");
def->tooltip = L("Volume of nozzle between the cutter and the end of nozzle");
def->sidetext = L("mm³");
def->mode = comDevelop;
def->mode = comAdvanced;
def->readonly = true;
def->set_default_value(new ConfigOptionFloat { 0.0 });
@ -1856,15 +1988,15 @@ void PrintConfigDef::init_fff_params()
def->label = L("Filename format");
def->tooltip = L("User can self-define the project file name when export");
def->full_width = true;
def->mode = comDevelop;
def->set_default_value(new ConfigOptionString("[input_filename_base].gcode"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionString("{input_filename_base}_{filament_type[0]}_{print_time}.gcode"));
def = this->add("detect_overhang_wall", coBool);
def->label = L("Detect overhang wall");
def->category = L("Quality");
def->tooltip = L("Detect the overhang percentage relative to line width and use different speed to print. "
"For 100%% overhang, bridge speed is used.");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("wall_filament", coInt);
@ -1936,7 +2068,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Z gap between object and raft. Ignored for soluble interface");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.1));
def = this->add("raft_expansion", coFloat);
@ -1945,7 +2077,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Expand all raft layers in XY plane");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1.5));
def = this->add("raft_first_layer_density", coPercent);
@ -1955,7 +2087,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("%");
def->min = 10;
def->max = 100;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercent(90));
def = this->add("raft_first_layer_expansion", coFloat);
@ -1964,7 +2096,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Expand the first raft or support layer to improve bed plate adhesion");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
//BBS: change from 3.0 to 2.0
def->set_default_value(new ConfigOptionFloat(2.0));
@ -1976,7 +2108,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("layers");
def->min = 0;
def->max = 100;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(0));
def = this->add("resolution", coFloat);
@ -1999,7 +2131,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Retract amount before wipe");
def->tooltip = L("The length of fast retraction before wipe, relative to retraction length");
def->sidetext = L("%");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercents { 100 });
def = this->add("retract_when_changing_layer", coBools);
@ -2025,7 +2157,7 @@ void PrintConfigDef::init_fff_params()
// "by the specified amount (the length is measured on raw filament, before it enters "
// "the extruder).");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 10. });
def = this->add("z_hop", coFloats);
@ -2038,21 +2170,21 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionFloats { 0.4 });
def = this->add("retract_restart_extra", coFloats);
//def->label = L("Extra length on restart");
def->label = L("Extra length on restart");
def->label = "Extra length on restart";
//def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push "
// "this additional amount of filament. This setting is rarely needed.");
def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push "
"this additional amount of filament. This setting is rarely needed.");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0. });
def = this->add("retract_restart_extra_toolchange", coFloats);
//def->label = L("Extra length on restart");
def->label = L("Extra length on restart");
def->label = "Extra length on restart";
//def->tooltip = L("When the retraction is compensated after changing tool, the extruder will push "
// "this additional amount of filament.");
def->tooltip = L("When the retraction is compensated after changing tool, the extruder will push "
"this additional amount of filament.");
def->sidetext = L("mm");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 0. });
def = this->add("retraction_speed", coFloats);
@ -2093,7 +2225,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("mm");
def->min = 0;
def->max = 10;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(2));
def = this->add("skirt_height", coInt);
@ -2101,7 +2233,7 @@ void PrintConfigDef::init_fff_params()
def->label = "Skirt height";
//def->tooltip = L("How many layers of skirt. Usually only one layer");
def->sidetext = L("layers");
def->mode = comDevelop;
def->mode = comAdvanced;
def->max = 10000;
def->set_default_value(new ConfigOptionInt(1));
@ -2303,7 +2435,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("°");
def->min = 0;
def->max = 359;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("support_on_build_plate_only", coBool);
@ -2419,7 +2551,7 @@ void PrintConfigDef::init_fff_params()
//TRN To be shown in Print Settings "Bottom interface layers". Have to be as short as possible
def->enum_labels.push_back("-1");
append(def->enum_labels, support_interface_top_layers->enum_labels);
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(0));
def = this->add("support_interface_spacing", coFloat);
@ -2438,7 +2570,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Spacing of bottom interface lines. Zero means solid interface");
def->sidetext = L("mm");
def->min = 0;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.5));
def = this->add("support_interface_speed", coFloat);
@ -2515,7 +2647,7 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("snug");
def->enum_labels.push_back(L("Grid"));
def->enum_labels.push_back(L("Snug"));
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<SupportMaterialStyle>(smsGrid));
def = this->add("independent_support_layer_height", coBool);
@ -2581,6 +2713,15 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("chamber_temperature", coInt);
def->label = L("Chamber temperature");
def->tooltip = L("Target chamber temperature");
def->sidetext = L("°C");
def->full_label = L("Chamber temperature");
def->min = 0;
def->max = max_temp;
def->set_default_value(new ConfigOptionInt(0));
def = this->add("nozzle_temperature", coInts);
def->label = L("Other layers");
def->tooltip = L("Nozzle temperature for layers after the initial one");
@ -2697,6 +2838,19 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBools { false });
def = this->add("z_lift_type", coEnum);
def->label = L("Z hop type");
def->tooltip = L("Z hop type");
def->enum_keys_map = &ConfigOptionEnum<LiftType>::get_enum_values();
def->enum_values.push_back("NormalLift");
def->enum_values.push_back("SpiralLift");
// def->enum_values.push_back("LazyLift");
def->enum_labels.push_back(L("NormalLift"));
def->enum_labels.push_back(L("SpiralLift"));
// def->enum_labels.push_back(L("LazyLift"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<LiftType>(LiftType::SpiralLift));
def = this->add("wipe_distance", coFloats);
def->label = L("Wipe Distance");
def->tooltip = L("Discribe how long the nozzle will move along the last path when retracting");
@ -2735,7 +2889,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Flush multiplier");
def->tooltip = L("");
def->sidetext = L("");
def->mode = comDevelop;
def->mode = comAdvanced;
def->min = 0;
def->set_default_value(new ConfigOptionFloat(1.0));
@ -2836,6 +2990,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("thumbnails", coPoints);
def->label = L("G-code thumbnails");
def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \"XxY, XxY, ...\"");
def->mode = comAdvanced;
def->gui_type = ConfigOptionDef::GUIType::one_string;
def->set_default_value(new ConfigOptionPoints{Vec2d(300, 300)});
// Declare retract values for filament profile, overriding the printer's extruder profile.
for (const char *opt_key : {
// floats
@ -2857,8 +3018,6 @@ void PrintConfigDef::init_fff_params()
if ((strcmp(opt_key, "retraction_length") == 0) ||
(strcmp(opt_key, "z_hop") == 0))
def->mode = comSimple;
else if (strcmp(opt_key, "retract_before_wipe") == 0)
def->mode = comDevelop;
else
def->mode = comAdvanced;
switch (def->type) {
@ -2875,7 +3034,7 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("This option will auto detect narrow internal solid infill area."
" If enabled, concentric pattern will be used for the area to speed printing up."
" Otherwise, rectilinear pattern is used defaultly.");
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
}
@ -3629,7 +3788,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
static std::set<std::string> ignore = {
"acceleration", "scale", "rotate", "duplicate", "duplicate_grid",
"bed_size",
"print_center", "g0", "pressure_advance", "wipe_tower_per_color_wipe"
"print_center", "g0", "wipe_tower_per_color_wipe"
#ifndef HAS_PRESSURE_EQUALIZER
, "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative"
#endif /* HAS_PRESSURE_EQUALIZER */

View file

@ -32,8 +32,8 @@
namespace Slic3r {
enum GCodeFlavor : unsigned char {
gcfMarlinLegacy, gcfRepRapSprinter, gcfRepRapFirmware, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit,
gcfSmoothie, gcfNoExtrusion,
gcfMarlinLegacy, gcfKlipper, gcfRepRapSprinter, gcfRepRapFirmware, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit,
gcfSmoothie, gcfNoExtrusion
};
enum class FuzzySkinType {
@ -118,6 +118,12 @@ enum SeamPosition {
spNearest, spAligned, spRear, spRandom
};
enum LiftType {
NormalLift,
SpiralLift,
LazyLift
};
enum SLAMaterial {
slamTough,
slamFlex,
@ -658,7 +664,10 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, bottom_shell_thickness))
((ConfigOptionFloat, bridge_flow))
((ConfigOptionFloat, bridge_speed))
((ConfigOptionFloat, bridge_angle))
((ConfigOptionEnum<InfillPattern>, top_surface_pattern))
((ConfigOptionFloat, top_solid_infill_flow_ratio))
((ConfigOptionFloat, bottom_solid_infill_flow_ratio))
((ConfigOptionEnum<InfillPattern>, bottom_surface_pattern))
((ConfigOptionFloat, outer_wall_line_width))
((ConfigOptionFloat, outer_wall_speed))
@ -705,6 +714,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, overhang_3_4_speed))
((ConfigOptionFloat, overhang_4_4_speed))
((ConfigOptionBool, only_one_wall_top))
((ConfigOptionBool, only_one_wall_first_layer))
)
PRINT_CONFIG_CLASS_DEFINE(
@ -748,6 +758,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionString, machine_end_gcode))
((ConfigOptionStrings, filament_end_gcode))
((ConfigOptionFloats, filament_flow_ratio))
((ConfigOptionBool, enable_pressure_advance))
((ConfigOptionFloats, pressure_advance))
((ConfigOptionFloats, filament_diameter))
((ConfigOptionFloats, filament_density))
((ConfigOptionStrings, filament_type))
@ -774,6 +786,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloats, retraction_length))
((ConfigOptionFloats, retract_length_toolchange))
((ConfigOptionFloats, z_hop))
((ConfigOptionEnum<LiftType>, z_lift_type))
((ConfigOptionFloats, retract_restart_extra))
((ConfigOptionFloats, retract_restart_extra_toolchange))
((ConfigOptionFloats, retraction_speed))
@ -790,6 +803,7 @@ PRINT_CONFIG_CLASS_DEFINE(
//BBS
((ConfigOptionEnum<NozzleType>, nozzle_type))
((ConfigOptionBool, auxiliary_fan))
)
// This object is mapped to Perl as Slic3r::Config::Print.
@ -830,11 +844,21 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBools, reduce_fan_stop_start_freq))
((ConfigOptionInts, fan_cooling_layer_time))
((ConfigOptionStrings, filament_colour))
((ConfigOptionFloat, outer_wall_acceleration))
((ConfigOptionFloat, inner_wall_acceleration))
((ConfigOptionFloat, top_surface_acceleration))
((ConfigOptionFloat, initial_layer_acceleration))
((ConfigOptionFloat, travel_acceleration))
((ConfigOptionFloat, initial_layer_line_width))
((ConfigOptionFloat, initial_layer_print_height))
((ConfigOptionFloat, initial_layer_speed))
((ConfigOptionFloat, default_jerk))
((ConfigOptionFloat, outer_wall_jerk))
((ConfigOptionFloat, inner_wall_jerk))
((ConfigOptionFloat, top_surface_jerk))
((ConfigOptionFloat, initial_layer_jerk))
((ConfigOptionFloat, travel_jerk))
//BBS
((ConfigOptionFloat, initial_layer_infill_speed))
((ConfigOptionInts, nozzle_temperature_initial_layer))
@ -861,6 +885,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBool, spiral_mode))
((ConfigOptionInt, standby_temperature_delta))
((ConfigOptionInts, nozzle_temperature))
((ConfigOptionInt , chamber_temperature))
((ConfigOptionBools, wipe))
// BBS
((ConfigOptionInts, bed_temperature_difference))
@ -888,7 +913,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBool, has_prime_tower))
((ConfigOptionFloat, nozzle_volume))
((ConfigOptionEnum<TimelapseType>, timelapse_type))
((ConfigOptionPoints, thumbnails))
)
// This object is mapped to Perl as Slic3r::Config::Full.

View file

@ -667,6 +667,7 @@ bool PrintObject::invalidate_state_by_config_options(
} else if (
opt_key == "wall_loops"
|| opt_key == "only_one_wall_top"
|| opt_key == "only_one_wall_first_layer"
|| opt_key == "initial_layer_line_width"
|| opt_key == "inner_wall_line_width"
|| opt_key == "infill_wall_overlap") {
@ -762,13 +763,15 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "minimum_sparse_infill_area"
|| opt_key == "sparse_infill_filament"
|| opt_key == "solid_infill_filament"
|| opt_key == "sparse_infill_line_width") {
|| opt_key == "sparse_infill_line_width"
|| opt_key == "infill_direction"
|| opt_key == "bridge_angle") {
steps.emplace_back(posPrepareInfill);
} else if (
opt_key == "top_surface_pattern"
|| opt_key == "bottom_surface_pattern"
|| opt_key == "external_fill_link_max_length"
|| opt_key == "infill_direction"
|| opt_key == "sparse_infill_pattern"
|| opt_key == "top_surface_line_width"
|| opt_key == "initial_layer_line_width") {
steps.emplace_back(posInfill);

View file

@ -22,10 +22,15 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he
{
const PrintConfig &print_config = object.print()->config();
ConfigOptionFloat config_width;
double flow_ratio = 1.0;
// Get extrusion width from configuration.
// (might be an absolute value, or a percent value, or zero for auto)
if (first_layer && print_config.initial_layer_line_width.value > 0) {
config_width = print_config.initial_layer_line_width;
if (first_layer) {
if(role != frExternalPerimeter)
flow_ratio = m_config.bottom_solid_infill_flow_ratio;
if(print_config.initial_layer_line_width.value > 0) {
config_width = print_config.initial_layer_line_width;
}
} else if (role == frExternalPerimeter) {
config_width = m_config.outer_wall_line_width;
} else if (role == frPerimeter) {
@ -36,6 +41,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he
config_width = m_config.internal_solid_infill_line_width;
} else if (role == frTopSolidInfill) {
config_width = m_config.top_surface_line_width;
flow_ratio = m_config.top_solid_infill_flow_ratio;
} else {
throw Slic3r::InvalidArgument("Unknown role");
}
@ -46,7 +52,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he
// Get the configured nozzle_diameter for the extruder associated to the flow role requested.
// Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right.
auto nozzle_diameter = float(print_config.nozzle_diameter.get_at(this->extruder(role) - 1));
return Flow::new_from_config_width(role, config_width, nozzle_diameter, float(layer_height));
return Flow::new_from_config_width(role, config_width, nozzle_diameter, float(layer_height)).with_flow_ratio(flow_ratio);
}
coordf_t PrintRegion::nozzle_dmr_avg(const PrintConfig &print_config) const

View file

@ -4,6 +4,7 @@
#define SLIC3R_APP_NAME "@SLIC3R_APP_NAME@"
#define SLIC3R_APP_KEY "@SLIC3R_APP_KEY@"
#define SLIC3R_VERSION "@SLIC3R_VERSION@"
#define SoftFever_VERSION "@SoftFever_VERSION@"
#define SLIC3R_BUILD_ID "@SLIC3R_BUILD_ID@"
//#define SLIC3R_RC_VERSION "@SLIC3R_VERSION@"
#define BBL_RELEASE_TO_PUBLIC @BBL_RELEASE_TO_PUBLIC@

View file

@ -1106,7 +1106,7 @@ std::string string_printf(const char *format, ...)
std::string header_slic3r_generated()
{
return std::string(SLIC3R_APP_NAME " " SLIC3R_VERSION);
return std::string(SLIC3R_APP_NAME "-SoftFever" " " SLIC3R_VERSION);
}
std::string header_gcodeviewer_generated()