Merge: Snapmaker Orca 2.1.2

This commit is contained in:
xiaoyeliu
2025-11-17 10:04:25 +08:00
parent 737948be1f
commit e89263e51a
1147 changed files with 668188 additions and 15290 deletions
@@ -1,5 +1,5 @@
// AdaptivePAInterpolator.cpp
// OrcaSlicer
// Snapmaker_Orca
//
// Implementation file for the AdaptivePAInterpolator class, providing methods to parse data and perform PA interpolation.
@@ -1,5 +1,5 @@
// AdaptivePAInterpolator.hpp
// OrcaSlicer
// Snapmaker_Orca
//
// Header file for the AdaptivePAInterpolator class, responsible for interpolating pressure advance (PA) values based on flow rate and acceleration using PCHIP interpolation.
+1 -1
View File
@@ -1,5 +1,5 @@
// AdaptivePAProcessor.cpp
// OrcaSlicer
// Snapmaker_Orca
//
// Implementation of the AdaptivePAProcessor class, responsible for processing G-code layers with adaptive pressure advance.
+1 -1
View File
@@ -1,5 +1,5 @@
// AdaptivePAProcessor.hpp
// OrcaSlicer
// Snapmaker_Orca
//
// Header file for the AdaptivePAProcessor class, responsible for processing G-code layers for the purposes of applying adaptive pressure advance.
+15 -11
View File
@@ -616,12 +616,12 @@ void GCodeProcessorResult::reset() {
#endif // ENABLE_GCODE_VIEWER_STATISTICS
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {
//BBS: OrcaSlicer is also "bambu". Otherwise the time estimation didn't work.
//BBS: Snapmaker_Orca is also "bambu". Otherwise the time estimation didn't work.
//FIXME: Workaround and should be handled when do removing-bambu
{ EProducer::OrcaSlicer, SLIC3R_APP_NAME },
{ EProducer::OrcaSlicer, "generated by OrcaSlicer" },
{ EProducer::OrcaSlicer, "generated by BambuStudio" },
{ EProducer::OrcaSlicer, "BambuStudio" }
{ EProducer::Snapmaker_Orca, SLIC3R_APP_NAME },
{ EProducer::Snapmaker_Orca, "generated by Snapmaker_Orca" },
{ EProducer::Snapmaker_Orca, "generated by BambuStudio" },
{ EProducer::Snapmaker_Orca, "BambuStudio" }
//{ EProducer::Slic3rPE, "generated by Slic3r Bambu Edition" },
//{ EProducer::Slic3r, "generated by Slic3r" },
//{ EProducer::SuperSlicer, "generated by SuperSlicer" },
@@ -712,6 +712,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
// Orca:
m_is_XL_printer = is_XL_printer(config);
m_preheat_time = config.preheat_time;
m_delta_temperature = config.delta_temperature;
m_preheat_steps = config.preheat_steps;
// sanity check
if(m_preheat_steps < 1)
@@ -811,6 +812,8 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
{
m_current_config = config;
m_parser.apply_config(config);
//BBS
@@ -1191,6 +1194,7 @@ void GCodeProcessor::reset()
m_seams_count = 0;
m_preheat_time = 0.f;
m_delta_temperature = 0;
m_preheat_steps = 1;
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
@@ -1242,12 +1246,12 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
});
m_parser.reset();
// if the gcode was produced by OrcaSlicer,
// if the gcode was produced by Snapmaker_Orca,
// extract the config from it
if (m_producer == EProducer::OrcaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
if (m_producer == EProducer::Snapmaker_Orca || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
DynamicPrintConfig config;
config.apply(FullPrintConfig::defaults());
// Silently substitute unknown values by new ones for loading configurations from OrcaSlicer's own G-code.
// Silently substitute unknown values by new ones for loading configurations from Snapmaker_Orca's own G-code.
// Showing substitution log or errors may make sense, but we are not really reading many values from the G-code config,
// thus a probability of incorrect substitution is low and the G-code viewer is a consumer-only anyways.
config.load_from_gcode_file(filename, ForwardCompatibilitySubstitutionRule::EnableSilent);
@@ -1959,7 +1963,7 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
return;
}
if (!producers_enabled || m_producer == EProducer::OrcaSlicer) {
if (!producers_enabled || m_producer == EProducer::Snapmaker_Orca) {
// height tag
if (boost::starts_with(comment, reserved_tag(ETags::Height))) {
if (!parse_number(comment.substr(reserved_tag(ETags::Height).size()), m_forced_height))
@@ -2106,7 +2110,7 @@ bool GCodeProcessor::process_producers_tags(const std::string_view comment)
case EProducer::Slic3rPE:
case EProducer::Slic3r:
case EProducer::SuperSlicer:
case EProducer::OrcaSlicer: { return process_bambuslicer_tags(comment); }
case EProducer::Snapmaker_Orca: { return process_bambuslicer_tags(comment); }
case EProducer::Cura: { return process_cura_tags(comment); }
case EProducer::Simplify3D: { return process_simplify3d_tags(comment); }
case EProducer::CraftWare: { return process_craftware_tags(comment); }
@@ -4640,7 +4644,7 @@ void GCodeProcessor::run_post_process()
} else {
std::string comment = "preheat T" + std::to_string(tool_number) +
" time: " + std::to_string((int) std::round(time_diffs[0])) + "s";
return GCodeWriter::set_temperature(temperature, this->m_flavor, false, tool_number, comment);
return GCodeWriter::set_temperature(temperature + m_delta_temperature, this->m_flavor, false, tool_number, comment);
}
},
// line replacer
+7 -1
View File
@@ -731,6 +731,7 @@ class Print;
int m_seams_count;
bool m_single_extruder_multi_material;
float m_preheat_time;
int m_delta_temperature;
int m_preheat_steps;
bool m_disable_m73;
#if ENABLE_GCODE_VIEWER_STATISTICS
@@ -740,7 +741,7 @@ class Print;
enum class EProducer
{
Unknown,
OrcaSlicer,
Snapmaker_Orca,
Slic3rPE,
Slic3r,
SuperSlicer,
@@ -754,6 +755,8 @@ class Print;
static const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> Producers;
EProducer m_producer;
DynamicConfig m_current_config;
TimeProcessor m_time_processor;
UsedFilaments m_used_filaments;
@@ -783,7 +786,10 @@ class Print;
const GCodeProcessorResult& get_result() const { return m_result; }
GCodeProcessorResult& result() { return m_result; }
GCodeProcessorResult&& extract_result() { return std::move(m_result); }
DynamicConfig& current_dynamic_config() { return m_current_config; }
GCodeReader& parser() { return m_parser; }
// Load a G-code into a stand-alone G-code viewer.
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
void process_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
@@ -1,5 +1,5 @@
// PchipInterpolatorHelper.cpp
// OrcaSlicer
// Snapmaker_Orca
//
// Implementation file for the PchipInterpolatorHelper class
@@ -1,5 +1,5 @@
// PchipInterpolatorHelper.hpp
// OrcaSlicer
// Snapmaker_Orca
//
// Header file for the PchipInterpolatorHelper class, responsible for performing Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) interpolation on given data points.
+28
View File
@@ -246,6 +246,24 @@ ToolOrdering::ToolOrdering(const PrintObject &object, unsigned int first_extrude
this->mark_skirt_layers(object.print()->config(), max_layer_height);
}
bool ToolOrdering::insert_wipe_tower_extruder()
{
if(!m_print_config_ptr->enable_prime_tower)
return false;
// In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list.
bool changed = false;
if (m_print_config_ptr->wipe_tower_filament != 0) {
for (LayerTools& lt : m_layer_tools) {
if (lt.wipe_tower_partitions > 0) {
lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_filament - 1);
sort_remove_duplicates(lt.extruders);
changed = true;
}
}
}
return changed;
}
// For the use case when all objects are printed at once.
// (print->config().print_sequence == PrintSequence::ByObject is false).
ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool prime_multi_material)
@@ -312,6 +330,16 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
this->fill_wipe_tower_partitions(print.config(), object_bottom_z, max_layer_height);
if (this->insert_wipe_tower_extruder()) {
// Now convert the 0-based list to 1-based again, because that is what reorder_extruder expects.
for (LayerTools& lt : m_layer_tools) {
for (auto& extruder : lt.extruders)
++extruder;
}
this->reorder_extruders(first_extruder);
this->fill_wipe_tower_partitions(print.config(), object_bottom_z, max_layer_height);
}
this->collect_extruder_statistics(prime_multi_material);
this->mark_skirt_layers(print.config(), max_layer_height);
+1
View File
@@ -194,6 +194,7 @@ private:
// BBS
void reorder_extruders(std::vector<unsigned int> tool_order_layer0);
void fill_wipe_tower_partitions(const PrintConfig &config, coordf_t object_bottom_z, coordf_t max_layer_height);
bool insert_wipe_tower_extruder();
void mark_skirt_layers(const PrintConfig &config, coordf_t max_layer_height);
void collect_extruder_statistics(bool prime_multi_material);
void reorder_extruders_for_minimum_flush_volume();
+11 -10
View File
@@ -119,7 +119,7 @@ public:
WipeTowerWriter& set_initial_tool(size_t tool) { m_current_tool = tool; return *this; }
WipeTowerWriter& set_z(float z)
WipeTowerWriter& set_z(float z)
{ m_current_z = z; return *this; }
WipeTowerWriter& set_extrusion_flow(float flow)
@@ -238,7 +238,7 @@ public:
WipeTowerWriter& travel(float x, float y, float f = 0.f)
{ return extrude_explicit(x, y, 0.f, f); }
WipeTowerWriter& travel(const Vec2f &dest, float f = 0.f)
WipeTowerWriter& travel(const Vec2f &dest, float f = 0.f)
{ return extrude_explicit(dest.x(), dest.y(), 0.f, f); }
// Extrude a line from current position to x, y with the extrusion amount given by m_extrusion_flow.
@@ -249,7 +249,7 @@ public:
return extrude_explicit(x, y, std::sqrt(dx*dx+dy*dy) * m_extrusion_flow, f, true);
}
WipeTowerWriter& extrude(const Vec2f &dest, const float f = 0.f)
WipeTowerWriter& extrude(const Vec2f &dest, const float f = 0.f)
{ return extrude(dest.x(), dest.y(), f); }
WipeTowerWriter& rectangle(const Vec2f& ld,float width,float height,const float f = 0.f)
@@ -300,7 +300,7 @@ public:
do {
++i;
if (i == 4) i = 0;
if (need_change_flow) {
if (need_change_flow) {
if (i == 1) {
// using bridge flow in bridge area, and add notes for gcode-check when flow changed
set_extrusion_flow(wipe_tower->extrusion_flow(0.2));
@@ -359,7 +359,7 @@ public:
// Elevate the extruder head above the current print_z position.
WipeTowerWriter& z_hop(float hop, float f = 0.f)
{
{
m_gcode += std::string("G1") + set_format_Z(m_current_z + hop);
if (f != 0 && f != m_current_feedrate)
m_gcode += set_format_F(f);
@@ -368,7 +368,7 @@ public:
}
// Lower the extruder head back to the current print_z position.
WipeTowerWriter& z_hop_reset(float f = 0.f)
WipeTowerWriter& z_hop_reset(float f = 0.f)
{ return z_hop(0, f); }
// Move to x1, +y_increment,
@@ -456,14 +456,14 @@ public:
}
WipeTowerWriter& flush_planner_queue()
{
m_gcode += "G4 S0\n";
{
m_gcode += "G4 S0\n";
return *this;
}
// Reset internal extruder counter.
WipeTowerWriter& reset_extruder()
{
{
m_gcode += "G92 E0\n";
return *this;
}
@@ -674,7 +674,8 @@ void WipeTower::set_extruder(size_t idx, const PrintConfig& config)
m_filpar.push_back(FilamentParameters());
m_filpar[idx].material = config.filament_type.get_at(idx);
m_filpar[idx].is_soluble = config.filament_soluble.get_at(idx);
// m_filpar[idx].is_soluble = config.filament_soluble.get_at(idx);
m_filpar[idx].is_soluble = config.wipe_tower_filament == 0 ? config.filament_soluble.get_at(idx) : (idx != size_t(config.wipe_tower_filament - 1));
// BBS
m_filpar[idx].is_support = config.filament_is_support.get_at(idx);
m_filpar[idx].nozzle_temperature = config.nozzle_temperature.get_at(idx);
+77 -27
View File
@@ -565,7 +565,8 @@ public:
float line_width,
GCodeFlavor flavor,
const std::vector<WipeTower2::FilamentParameters>& filament_parameters,
bool enable_arc_fitting)
bool enable_arc_fitting,
const std::string& printer_model)
:
m_current_pos(std::numeric_limits<float>::max(), std::numeric_limits<float>::max()),
m_current_z(0.f),
@@ -574,8 +575,9 @@ public:
m_extrusion_flow(0.f),
m_preview_suppressed(false),
m_elapsed_time(0.f),
m_gcode_flavor(flavor), m_filpar(filament_parameters)
//m_enable_arc_fitting(enable_arc_fitting)
m_gcode_flavor(flavor),
m_filpar(filament_parameters),
m_printer_model(printer_model)
{
// ORCA: This class is only used by non BBL printers, so set the parameter appropriately.
// This fixes an issue where the wipe tower was using BBL tags resulting in statistics for purging in the purge tower not being displayed.
@@ -624,13 +626,28 @@ public:
WipeTowerWriter2& disable_linear_advance() {
if (m_gcode_flavor == gcfRepRapSprinter || m_gcode_flavor == gcfRepRapFirmware)
m_gcode += (std::string("M572 D") + std::to_string(m_current_tool) + " S0\n");
else if (m_gcode_flavor == gcfKlipper)
m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n";
else if (m_gcode_flavor == gcfKlipper){
// m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n"; // Snapmaker U1
}
else
m_gcode += "M900 K0\n";
return *this;
}
WipeTowerWriter2& disable_linear_advance_value(float value = 0.0) {
if (m_gcode_flavor == gcfRepRapSprinter || m_gcode_flavor == gcfRepRapFirmware)
m_gcode += (std::string("M572 D") + std::to_string(m_current_tool) + " S"+ std::to_string(value) + "\n");
else if (m_gcode_flavor == gcfKlipper) {
m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=" + Slic3r::float_to_string_decimal_point(value, 4) + "\n"; // Snapmaker U1
}
else
m_gcode += "M900 K" + std::to_string(value) + "\n";
return *this;
}
WipeTowerWriter2& switch_filament_monitoring(bool enable) {
m_gcode += std::string("G4 S0\n") + "M591 " + (enable ? "R" : "S0") + "\n";
return *this;
@@ -896,16 +913,20 @@ public:
WipeTowerWriter2& speed_override_backup()
{
// This is only supported by Prusa at this point (https://github.com/prusa3d/PrusaSlicer/issues/3114)
if (m_gcode_flavor == gcfMarlinLegacy || m_gcode_flavor == gcfMarlinFirmware)
if (m_gcode_flavor == gcfMarlinLegacy || m_gcode_flavor == gcfMarlinFirmware || is_snapmaker_u1()) {
// u1 特殊处理
m_gcode += "M220 B\n";
}
return *this;
}
// Let the firmware restore the active speed override value.
WipeTowerWriter2& speed_override_restore()
{
if (m_gcode_flavor == gcfMarlinLegacy || m_gcode_flavor == gcfMarlinFirmware)
if (m_gcode_flavor == gcfMarlinLegacy || m_gcode_flavor == gcfMarlinFirmware || is_snapmaker_u1()) {
// u1 特殊处理
m_gcode += "M220 R\n";
}
return *this;
}
@@ -1151,6 +1172,13 @@ private:
GCodeFlavor m_gcode_flavor;
bool m_enable_arc_fitting = false;
const std::vector<WipeTower2::FilamentParameters>& m_filpar;
std::string m_printer_model;
// 判断是否是 Snapmaker U1 打印机
bool is_snapmaker_u1() const {
return boost::icontains(m_printer_model, "Snapmaker") &&
boost::icontains(m_printer_model, "U1");
}
std::string set_format_X(float x)
{
@@ -1240,7 +1268,11 @@ WipeTower2::WipeTower2(const PrintConfig& config, const PrintRegionConfig& defau
m_infill_speed(default_region_config.sparse_infill_speed),
m_perimeter_speed(default_region_config.inner_wall_speed),
m_current_tool(initial_tool),
wipe_volumes(wiping_matrix), m_wipe_tower_max_purge_speed(float(config.wipe_tower_max_purge_speed)),
wipe_volumes(wiping_matrix),
m_wipe_tower_max_purge_speed(float(config.wipe_tower_max_purge_speed)),
m_change_pressure(config.enable_change_pressure_when_wiping),
m_change_pressure_value(config.ramming_pressure_advance_value),
m_ramming_width_ratio(config.ramming_line_width_ratio),
m_enable_arc_fitting(config.enable_arc_fitting),
m_used_fillet(config.wipe_tower_fillet_wall),
m_rib_width(config.wipe_tower_rib_width),
@@ -1274,6 +1306,9 @@ WipeTower2::WipeTower2(const PrintConfig& config, const PrintRegionConfig& defau
m_is_mk4mmu3 = boost::icontains(config.printer_notes.value, "PRINTER_MODEL_MK4") && boost::icontains(config.printer_notes.value, "MMU");
// 保存打印机型号信息
m_printer_model = config.printer_model.value;
// Calculate where the priming lines should be - very naive test not detecting parallelograms etc.
const std::vector<Vec2d>& bed_points = config.printable_area.values;
BoundingBoxf bb(bed_points);
@@ -1305,7 +1340,8 @@ void WipeTower2::set_extruder(size_t idx, const PrintConfig& config)
m_filpar.push_back(FilamentParameters());
m_filpar[idx].material = config.filament_type.get_at(idx);
m_filpar[idx].is_soluble = config.filament_soluble.get_at(idx);
// m_filpar[idx].is_soluble = config.filament_soluble.get_at(idx);
m_filpar[idx].is_soluble = config.wipe_tower_filament == 0 ? config.filament_soluble.get_at(idx) : (idx != size_t(config.wipe_tower_filament - 1));
m_filpar[idx].temperature = config.nozzle_temperature.get_at(idx);
m_filpar[idx].first_layer_temperature = config.nozzle_temperature_initial_layer.get_at(idx);
m_filpar[idx].filament_minimal_purge_on_wipe_tower = config.filament_minimal_purge_on_wipe_tower.get_at(idx);
@@ -1351,7 +1387,7 @@ void WipeTower2::set_extruder(size_t idx, const PrintConfig& config)
float vol = config.filament_multitool_ramming_volume.get_at(idx);
float flow = config.filament_multitool_ramming_flow.get_at(idx);
m_filpar[idx].multitool_ramming = config.filament_multitool_ramming.get_at(idx) && vol > 0.f && flow > 0.f;
m_filpar[idx].ramming_line_width_multiplicator = 2.;
m_filpar[idx].ramming_line_width_multiplicator = m_ramming_width_ratio;
m_filpar[idx].ramming_step_multiplicator = 1.;
// Now the ramming speed vector. In this case it contains just one value (flow).
@@ -1405,7 +1441,7 @@ std::vector<WipeTower::ToolChangeResult> WipeTower2::prime(
for (size_t idx_tool = 0; idx_tool < tools.size(); ++ idx_tool) {
size_t old_tool = m_current_tool;
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting);
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting, m_printer_model);
writer.set_extrusion_flow(m_extrusion_flow)
.set_z(m_z_pos)
.set_initial_tool(m_current_tool);
@@ -1432,7 +1468,10 @@ std::vector<WipeTower::ToolChangeResult> WipeTower2::prime(
toolchange_Load(writer, cleaning_box); // Prime the tool.
if (idx_tool + 1 == tools.size()) {
// Last tool should not be unloaded, but it should be wiped enough to become of a pure color.
toolchange_Wipe(writer, cleaning_box, wipe_volumes[tools[idx_tool-1]][tool]);
if (idx_tool == 0)
toolchange_Wipe(writer, cleaning_box, wipe_volumes[tools[idx_tool]][tool]);
else
toolchange_Wipe(writer, cleaning_box, wipe_volumes[tools[idx_tool - 1]][tool]);
} else {
// Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool.
//writer.travel(writer.x(), writer.y() + m_perimeter_width, 7200);
@@ -1500,7 +1539,7 @@ WipeTower::ToolChangeResult WipeTower2::tool_change(size_t tool)
(tool != (unsigned int)(-1) ? wipe_area+m_depth_traversed-0.5f*m_perimeter_width
: m_wipe_tower_depth-m_perimeter_width));
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting);
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting, m_printer_model);
writer.set_extrusion_flow(m_extrusion_flow)
.set_z(m_z_pos)
.set_initial_tool(m_current_tool)
@@ -1590,8 +1629,12 @@ void WipeTower2::toolchange_Unload(
if (do_ramming) {
writer.travel(ramming_start_pos); // move to starting position
if (! m_is_mk4mmu3)
writer.disable_linear_advance();
if (!m_is_mk4mmu3) {
if (m_change_pressure) {
writer.disable_linear_advance_value(m_change_pressure_value);
}
}
if (cold_ramming)
writer.set_extruder_temp(old_temperature - 20);
}
@@ -1634,8 +1677,13 @@ void WipeTower2::toolchange_Unload(
}
bool is_over_tower_height = false;
if (m_plan.size() > 0 && m_num_layer_changes == m_plan.size()) {
is_over_tower_height = true;
}
// now the ramming itself:
while (do_ramming && i < m_filpar[m_current_tool].ramming_speed.size())
while (do_ramming && i < m_filpar[m_current_tool].ramming_speed.size() && !is_over_tower_height)
{
// The time step is different for SEMM ramming and the MM ramming. See comments in set_extruder() for details.
const float time_step = m_semm ? 0.25f : m_filpar[m_current_tool].multitool_ramming_time;
@@ -1705,8 +1753,12 @@ void WipeTower2::toolchange_Unload(
float speed_inc = (final_speed - initial_speed) / (2.f * number_of_cooling_moves - 1.f);
if (m_is_mk4mmu3)
writer.disable_linear_advance();
if (m_is_mk4mmu3) {
if (m_change_pressure) {
writer.disable_linear_advance_value(m_change_pressure_value);
}
}
writer.suppress_preview()
.travel(writer.x(), writer.y() + y_step);
@@ -1928,7 +1980,7 @@ WipeTower::ToolChangeResult WipeTower2::finish_layer()
size_t old_tool = m_current_tool;
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting);
WipeTowerWriter2 writer(m_layer_height, m_perimeter_width, m_gcode_flavor, m_filpar, m_enable_arc_fitting, m_printer_model);
writer.set_extrusion_flow(m_extrusion_flow)
.set_z(m_z_pos)
.set_initial_tool(m_current_tool)
@@ -2216,14 +2268,12 @@ void WipeTower2::save_on_last_wipe()
int WipeTower2::first_toolchange_to_nonsoluble(
const std::vector<WipeTowerInfo::ToolChange>& tool_changes) const
{
// Orca: allow calculation of the required depth and wipe volume for soluable toolchanges as well
// NOTE: it's not clear if this is the right way, technically we should disable wipe tower if soluble filament is used as it
// will will make the wipe tower unstable. Need to revist this in the future.
return tool_changes.empty() ? -1 : 0;
//for (size_t idx=0; idx<tool_changes.size(); ++idx)
// if (! m_filpar[tool_changes[idx].new_tool].is_soluble)
// return idx;
//return -1;
// 使用 wipe_tower_filament 配置来决定哪个挤出机用于 wipe tower
for (size_t idx=0; idx<tool_changes.size(); ++idx) {
if (!m_filpar[tool_changes[idx].new_tool].is_soluble)
return idx;
}
return -1;
}
static WipeTower::ToolChangeResult merge_tcr(WipeTower::ToolChangeResult& first,
+4 -1
View File
@@ -175,10 +175,13 @@ private:
return m_filpar[0].filament_area; // all extruders are assumed to have the same filament diameter at this point
}
bool m_change_pressure = true;
float m_change_pressure_value = 0.0;
float m_ramming_width_ratio = 2.0;
bool m_semm = true; // Are we using a single extruder multimaterial printer?
bool m_enable_filament_ramming = true;
bool m_is_mk4mmu3 = false;
std::string m_printer_model; // Printer model name (e.g., "Snapmaker U1")
Vec2f m_wipe_tower_pos; // Left front corner of the wipe tower in mm.
float m_wipe_tower_width; // Width of the wipe tower.
float m_wipe_tower_depth = 0.f; // Depth of the wipe tower