ENH: normalize comment from OrcaSlicer

Mark code from OrcaSlicer with same comment tag for follow easily

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: If4db502a1b0e6d0648c73f2f383b6d1cc8e1aa01
This commit is contained in:
salt.wei 2023-06-20 19:50:06 +08:00 committed by Lane.Wei
parent e9ad8374bc
commit 2fe7629388
16 changed files with 30 additions and 32 deletions

View File

@ -3174,7 +3174,7 @@ void FillMonotonicLineWGapFill::fill_surface_extrusion(const Surface* surface, c
if (!polylines.empty() && !is_bridge(params.extrusion_role)) { if (!polylines.empty() && !is_bridge(params.extrusion_role)) {
ExtrusionEntityCollection gap_fill; ExtrusionEntityCollection gap_fill;
// SoftFever: filter out tiny gap fills // OrcaSlicer: filter out tiny gap fills
polylines.erase(std::remove_if(polylines.begin(), polylines.end(), [&](const ThickPolyline &p) { polylines.erase(std::remove_if(polylines.begin(), polylines.end(), [&](const ThickPolyline &p) {
return p.length() < scale_(params.filter_out_gap_fill); return p.length() < scale_(params.filter_out_gap_fill);
}), polylines.end()); }), polylines.end());

View File

@ -292,7 +292,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
/* Reduce feedrate a bit; travel speed is often too high to move on existing material. /* Reduce feedrate a bit; travel speed is often too high to move on existing material.
Too fast = ripping of existing material; too slow = short wipe path, thus more blob. */ Too fast = ripping of existing material; too slow = short wipe path, thus more blob. */
//softFever //OrcaSlicer
double wipe_speed = gcodegen.writer().config.travel_speed.value * gcodegen.config().wipe_speed.value / 100; double wipe_speed = gcodegen.writer().config.travel_speed.value * gcodegen.config().wipe_speed.value / 100;
// get the retraction length // get the retraction length
@ -581,7 +581,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
gcode += tcr_gcode; gcode += tcr_gcode;
check_add_eol(toolchange_gcode_str); check_add_eol(toolchange_gcode_str);
//SoftFever: set new PA for new filament. BBS: never use for Bambu Printer //OrcaSlicer: set new PA for new filament. BBS: never use for Bambu Printer
if (!gcodegen.is_BBL_Printer() && gcodegen.config().enable_pressure_advance.get_at(new_extruder_id)) if (!gcodegen.is_BBL_Printer() && gcodegen.config().enable_pressure_advance.get_at(new_extruder_id))
gcode += gcodegen.writer().set_pressure_advance(gcodegen.config().pressure_advance.get_at(new_extruder_id)); gcode += gcodegen.writer().set_pressure_advance(gcodegen.config().pressure_advance.get_at(new_extruder_id));
@ -1587,7 +1587,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write_format("; EXECUTABLE_BLOCK_START\n"); file.write_format("; EXECUTABLE_BLOCK_START\n");
// SoftFever: Orca's implementation for skipping object, for klipper firmware printer only // OrcaSlicer: Orca's implementation for skipping object, for klipper firmware printer only
if (this->config().exclude_object && print.config().gcode_flavor.value == gcfKlipper) if (this->config().exclude_object && print.config().gcode_flavor.value == gcfKlipper)
file.write(set_object_info(&print)); file.write(set_object_info(&print));
@ -1871,7 +1871,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
} }
if (this->m_objsWithBrim.empty() && this->m_objSupportsWithBrim.empty()) m_brim_done = true; if (this->m_objsWithBrim.empty() && this->m_objSupportsWithBrim.empty()) m_brim_done = true;
// SoftFever: calib // OrcaSlicer: calib
if (print.calib_params().mode == CalibMode::Calib_PA_Line) { if (print.calib_params().mode == CalibMode::Calib_PA_Line) {
std::string gcode; std::string gcode;
if ((m_config.default_acceleration.value > 0 && m_config.outer_wall_acceleration.value > 0)) { if ((m_config.default_acceleration.value > 0 && m_config.outer_wall_acceleration.value > 0)) {
@ -4199,7 +4199,7 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
// use G1 because we rely on paths being straight (G0 may make round paths) // use G1 because we rely on paths being straight (G0 may make round paths)
if (travel.size() >= 2) { if (travel.size() >= 2) {
// SoftFever // OrcaSlicer
if (this->on_first_layer()) { if (this->on_first_layer()) {
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0 && !this->is_BBL_Printer()) if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0 && !this->is_BBL_Printer())
gcode += m_writer.set_jerk_xy(m_config.initial_layer_jerk.value); gcode += m_writer.set_jerk_xy(m_config.initial_layer_jerk.value);

View File

@ -195,7 +195,7 @@ public:
void set_layer_count(unsigned int value) { m_layer_count = value; } void set_layer_count(unsigned int value) { m_layer_count = value; }
void apply_print_config(const PrintConfig &print_config); void apply_print_config(const PrintConfig &print_config);
// SoftFever // OrcaSlicer
std::string set_object_info(Print* print); std::string set_object_info(Print* print);
// append full config to the given string // append full config to the given string

View File

@ -1659,7 +1659,7 @@ void GCodeProcessor::process_gcode_line(const GCodeReader::GCodeLine& line, bool
m_start_position = m_end_position; m_start_position = m_end_position;
const std::string_view cmd = line.cmd(); const std::string_view cmd = line.cmd();
//softfever //OrcaSlicer
if (m_flavor == gcfKlipper) if (m_flavor == gcfKlipper)
{ {
if (boost::iequals(cmd, "SET_VELOCITY_LIMIT")) if (boost::iequals(cmd, "SET_VELOCITY_LIMIT"))

View File

@ -196,7 +196,7 @@ std::string GCodeWriter::set_pressure_advance(double pa) const
std::ostringstream gcode; std::ostringstream gcode;
if (pa < 0) return gcode.str(); if (pa < 0) return gcode.str();
if (false) { // todo: bbl printer if (false) { // todo: bbl printer
// SoftFever: set L1000 to use linear model // OrcaSlicer: set L1000 to use linear model
gcode << "M900 K" << std::setprecision(4) << pa << " L1000 M10 ; Override pressure advance value\n"; gcode << "M900 K" << std::setprecision(4) << pa << " L1000 M10 ; Override pressure advance value\n";
} else { } else {
if (this->config.gcode_flavor == gcfKlipper) if (this->config.gcode_flavor == gcfKlipper)

View File

@ -1194,7 +1194,7 @@ void PerimeterGenerator::process_classic()
++ irun; ++ irun;
} }
#endif #endif
// SoftFever: filter out tiny gap fills // OrcaSlicer: filter out tiny gap fills
polylines.erase(std::remove_if(polylines.begin(), polylines.end(), [&](const ThickPolyline &p) { polylines.erase(std::remove_if(polylines.begin(), polylines.end(), [&](const ThickPolyline &p) {
return p.length()< scale_(this->config->filter_out_gap_fill.value); return p.length()< scale_(this->config->filter_out_gap_fill.value);
}), polylines.end()); }), polylines.end());

View File

@ -810,7 +810,7 @@ static std::vector<std::string> s_Preset_filament_options {
//BBS //BBS
"filament_wipe_distance", "additional_cooling_fan_speed", "filament_wipe_distance", "additional_cooling_fan_speed",
"bed_temperature_difference", "nozzle_temperature_range_low", "nozzle_temperature_range_high", "bed_temperature_difference", "nozzle_temperature_range_low", "nozzle_temperature_range_high",
//softfever //OrcaSlicer
"enable_pressure_advance", "pressure_advance", "chamber_temperature" "enable_pressure_advance", "pressure_advance", "chamber_temperature"
}; };
@ -832,7 +832,7 @@ static std::vector<std::string> s_Preset_printer_options {
// BBS // BBS
"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode", "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode",
"nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types",
//SoftFever //OrcaSlicer
"host_type", "print_host", "printhost_apikey", "host_type", "print_host", "printhost_apikey",
"print_host_webui", "print_host_webui",
"printhost_cafile","printhost_port","printhost_authorization_type", "printhost_cafile","printhost_port","printhost_authorization_type",
@ -1725,7 +1725,7 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
{ {
// Load the preset over a default preset, so that the missing fields are filled in from the default preset. // Load the preset over a default preset, so that the missing fields are filled in from the default preset.
DynamicPrintConfig cfg(this->default_preset_for(combined_config).config); DynamicPrintConfig cfg(this->default_preset_for(combined_config).config);
// SoftFever: ignore print connection info from project // OrcaSlicer: ignore print connection info from project
cfg.erase("print_host"); cfg.erase("print_host");
cfg.erase("print_host_webui"); cfg.erase("print_host_webui");
cfg.erase("printhost_apikey"); cfg.erase("printhost_apikey");

View File

@ -149,7 +149,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"nozzle_hrc", "nozzle_hrc",
"required_nozzle_HRC", "required_nozzle_HRC",
"upward_compatible_machine", "upward_compatible_machine",
//SoftFever //OrcaSlicer
"seam_gap", "seam_gap",
"wipe_speed" "wipe_speed"
"default_jerk", "default_jerk",
@ -2005,7 +2005,7 @@ std::vector<Point> Print::first_layer_wipe_tower_corners(bool check_wipe_tower_e
return corners; return corners;
} }
//SoftFever //OrcaSlicer
Vec2d Print::translate_to_print_space(const Vec2d& point) const { Vec2d Print::translate_to_print_space(const Vec2d& point) const {
//const BoundingBoxf bed_bbox(config().printable_area.values); //const BoundingBoxf bed_bbox(config().printable_area.values);
return Vec2d(point(0) - m_origin(0), point(1) - m_origin(1)); return Vec2d(point(0) - m_origin(0), point(1) - m_origin(1));

View File

@ -197,7 +197,7 @@ struct PrintInstance
BoundingBoxf3 get_bounding_box(); BoundingBoxf3 get_bounding_box();
Polygon get_convex_hull_2d(); Polygon get_convex_hull_2d();
// SoftFever // OrcaSlicer
// //
// instance id // instance id
size_t id; size_t id;
@ -429,7 +429,7 @@ public:
// BBS: Boundingbox of the first layer // BBS: Boundingbox of the first layer
BoundingBox firstLayerObjectBrimBoundingBox; BoundingBox firstLayerObjectBrimBoundingBox;
// SoftFever // OrcaSlicer
size_t get_klipper_object_id() const { return m_klipper_object_id; } size_t get_klipper_object_id() const { return m_klipper_object_id; }
void set_klipper_object_id(size_t id) { m_klipper_object_id = id; } void set_klipper_object_id(size_t id) { m_klipper_object_id = id; }
@ -517,7 +517,7 @@ private:
PrintObject* m_shared_object{ nullptr }; PrintObject* m_shared_object{ nullptr };
// SoftFever // OrcaSlicer
// //
// object id for klipper firmware only // object id for klipper firmware only
size_t m_klipper_object_id; size_t m_klipper_object_id;
@ -807,7 +807,7 @@ public:
// Return 4 wipe tower corners in the world coordinates (shifted and rotated), including the wipe tower brim. // 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; std::vector<Point> first_layer_wipe_tower_corners(bool check_wipe_tower_existance=true) const;
//SoftFever //OrcaSlicer
CalibMode & calib_mode() { return m_calib_params.mode; } CalibMode & calib_mode() { return m_calib_params.mode; }
const CalibMode& calib_mode() const { return m_calib_params.mode; } const CalibMode& calib_mode() const { return m_calib_params.mode; }
void set_calib_params(const Calib_Params &params); void set_calib_params(const Calib_Params &params);
@ -869,7 +869,7 @@ private:
ConflictResultOpt m_conflict_result; ConflictResultOpt m_conflict_result;
FakeWipeTower m_fake_wipe_tower; FakeWipeTower m_fake_wipe_tower;
// SoftFever: calibration // OrcaSlicer: calibration
Calib_Params m_calib_params; Calib_Params m_calib_params;
// To allow GCode to set the Print's GCodeExport step status. // To allow GCode to set the Print's GCodeExport step status.

View File

@ -700,7 +700,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionPercent, min_bead_width)) ((ConfigOptionPercent, min_bead_width))
((ConfigOptionBool, only_one_wall_top)) ((ConfigOptionBool, only_one_wall_top))
((ConfigOptionBool, only_one_wall_first_layer)) ((ConfigOptionBool, only_one_wall_first_layer))
// SoftFever // OrcaSlicer
((ConfigOptionFloat, seam_gap)) ((ConfigOptionFloat, seam_gap))
((ConfigOptionPercent, wipe_speed)) ((ConfigOptionPercent, wipe_speed))
) )
@ -764,7 +764,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, overhang_4_4_speed)) ((ConfigOptionFloat, overhang_4_4_speed))
((ConfigOptionFloatOrPercent, sparse_infill_anchor)) ((ConfigOptionFloatOrPercent, sparse_infill_anchor))
((ConfigOptionFloatOrPercent, sparse_infill_anchor_max)) ((ConfigOptionFloatOrPercent, sparse_infill_anchor_max))
//SoftFever //OrcaSlicer
((ConfigOptionFloat, top_solid_infill_flow_ratio)) ((ConfigOptionFloat, top_solid_infill_flow_ratio))
((ConfigOptionFloat, bottom_solid_infill_flow_ratio)) ((ConfigOptionFloat, bottom_solid_infill_flow_ratio))
((ConfigOptionFloat, filter_out_gap_fill)) ((ConfigOptionFloat, filter_out_gap_fill))

View File

@ -688,10 +688,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_field("only_one_wall_top", !have_arachne); toggle_field("only_one_wall_top", !have_arachne);
PresetBundle *preset_bundle = wxGetApp().preset_bundle; PresetBundle *preset_bundle = wxGetApp().preset_bundle;
// SoftFever // OrcaSlicer
auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value; auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
// SoftFever
if( gcflavor != gcfKlipper ) if( gcflavor != gcfKlipper )
{ {
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"}) for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})

View File

@ -1056,7 +1056,7 @@ void MainFrame::init_tabpanel()
} }
// SoftFever // OrcaSlicer
void MainFrame::show_device(bool bBBLPrinter) { void MainFrame::show_device(bool bBBLPrinter) {
if (m_tabpanel->GetPage(tpMonitor) != m_monitor && if (m_tabpanel->GetPage(tpMonitor) != m_monitor &&
m_tabpanel->GetPage(tpMonitor) != m_printer_view) { m_tabpanel->GetPage(tpMonitor) != m_printer_view) {
@ -2670,7 +2670,7 @@ void MainFrame::init_menubar_as_editor()
//m_topbar->AddDropDownMenuItem(config_item); //m_topbar->AddDropDownMenuItem(config_item);
m_topbar->AddDropDownSubMenu(helpMenu, _L("Help")); m_topbar->AddDropDownSubMenu(helpMenu, _L("Help"));
// SoftFever calibrations // OrcaSlicer calibrations
{ {
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Temperature"), _L("Temperature Calibration"), append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Temperature"), _L("Temperature Calibration"),
[this](wxCommandEvent&) { [this](wxCommandEvent&) {
@ -2736,7 +2736,7 @@ void MainFrame::init_menubar_as_editor()
// help // help
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Tutorial"), _L("Calibration help"), append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Tutorial"), _L("Calibration help"),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/SoftFever/OrcaSlicer/wiki/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr, [this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/OrcaSlicer/OrcaSlicer/wiki/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this); [this]() {return m_plater->is_view3D_shown();; }, this);
} }

View File

@ -337,7 +337,7 @@ public:
void RunScript(wxString js); void RunScript(wxString js);
void show_device(bool bBBLPrinter); void show_device(bool bBBLPrinter);
// SoftFever calibration // OrcaSlicer calibration
PA_Calibration_Dlg * m_pa_calib_dlg{nullptr}; PA_Calibration_Dlg * m_pa_calib_dlg{nullptr};
Temp_Calibration_Dlg * m_temp_calib_dlg{nullptr}; Temp_Calibration_Dlg * m_temp_calib_dlg{nullptr};
MaxVolumetricSpeed_Test_Dlg *m_vol_test_dlg{nullptr}; MaxVolumetricSpeed_Test_Dlg *m_vol_test_dlg{nullptr};

View File

@ -8334,7 +8334,7 @@ void Plater::calib_flowrate(int pass)
_obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1)); _obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1));
_obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5)); _obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5));
_obj->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true)); _obj->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true));
_obj->config.set_key_value("filter_out_gap_fill", new ConfigOptionFloat(0)); // todo: SoftFever parameter _obj->config.set_key_value("filter_out_gap_fill", new ConfigOptionFloat(0)); // todo: OrcaSlicer parameter
_obj->config.set_key_value("sparse_infill_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear)); _obj->config.set_key_value("sparse_infill_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
_obj->config.set_key_value("top_surface_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f)); _obj->config.set_key_value("top_surface_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f));
_obj->config.set_key_value("internal_solid_infill_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f)); _obj->config.set_key_value("internal_solid_infill_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f));

View File

@ -231,7 +231,7 @@ public:
void reload_gcode_from_disk(); void reload_gcode_from_disk();
void refresh_print(); void refresh_print();
// SoftFever calibration // OrcaSlicer calibration
void calib_pa(const Calib_Params &params); void calib_pa(const Calib_Params &params);
void calib_flowrate(int pass); void calib_flowrate(int pass);
void calib_temp(const Calib_Params &params); void calib_temp(const Calib_Params &params);

View File

@ -292,7 +292,7 @@ void CalibUtils::calib_flowrate(int pass, const CalibInfo& calib_info, std::stri
_obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1)); _obj->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(1));
_obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5)); _obj->config.set_key_value("top_shell_layers", new ConfigOptionInt(5));
_obj->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true)); _obj->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true));
_obj->config.set_key_value("filter_out_gap_fill", new ConfigOptionFloat(0)); // SoftFever parameter _obj->config.set_key_value("filter_out_gap_fill", new ConfigOptionFloat(0)); // OrcaSlicer parameter
_obj->config.set_key_value("sparse_infill_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear)); _obj->config.set_key_value("sparse_infill_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
_obj->config.set_key_value("top_surface_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f)); _obj->config.set_key_value("top_surface_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f));
_obj->config.set_key_value("internal_solid_infill_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f)); _obj->config.set_key_value("internal_solid_infill_line_width", new ConfigOptionFloat(nozzle_diameter * 1.2f));