ENH:instead of prime_volume by filament_prime_volume

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I96e7d0604da8f90678feed81833e3a634752ffff
(cherry picked from commit be02e769bb49680d6be678fc5fa73a141ca8da1c)
This commit is contained in:
qing.zhang
2025-01-20 11:31:33 +08:00
committed by Noisyfox
parent 9e024d1d4d
commit e7e6405ad3
15 changed files with 73 additions and 47 deletions

View File

@@ -314,7 +314,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "wipe_tower_extra_flow"
|| opt_key == "wipe_tower_no_sparse_layers"
|| opt_key == "flush_volumes_matrix"
|| opt_key == "prime_volume"
|| opt_key == "filament_prime_volume"
|| opt_key == "flush_into_infill"
|| opt_key == "flush_into_support"
|| opt_key == "initial_layer_infill_speed"
@@ -2809,9 +2809,10 @@ const WipeTowerData &Print::wipe_tower_data(size_t filaments_cnt) const
if (max_height < EPSILON) return m_wipe_tower_data;
if (! is_step_done(psWipeTower) && filaments_cnt !=0) {
std::vector<double> filament_wipe_volume = m_config.filament_prime_volume.values;
double wipe_volume = get_max_element(filament_wipe_volume);
if (m_config.prime_tower_rib_wall.value) {
double layer_height = 0.08f; // hard code layer height
double wipe_volume = m_config.prime_volume;
layer_height = m_objects.front()->config().layer_height.value;
int filament_depth_count = m_config.nozzle_diameter.values.size() == 2 ? filaments_cnt : filaments_cnt - 1;
if (filaments_cnt == 1 && enable_timelapse_print())
@@ -2841,7 +2842,6 @@ const WipeTowerData &Print::wipe_tower_data(size_t filaments_cnt) const
maximum *= 0.6;
const_cast<Print *>(this)->m_wipe_tower_data.depth = maximum / (layer_height * width);
} else {
double wipe_volume = m_config.prime_volume;
if (filaments_cnt == 1 && enable_timelapse_print()) {
const_cast<Print *>(this)->m_wipe_tower_data.depth = wipe_volume / (layer_height * width);
} else {
@@ -2915,7 +2915,7 @@ void Print::_make_wipe_tower()
if (!bUseWipeTower2) {
// in BBL machine, wipe tower is only use to prime extruder. So just use a global wipe volume.
WipeTower wipe_tower(m_config, m_plate_index, m_origin, m_config.prime_volume, m_wipe_tower_data.tool_ordering.first_extruder(),
WipeTower wipe_tower(m_config, m_plate_index, m_origin, m_wipe_tower_data.tool_ordering.first_extruder(),
m_wipe_tower_data.tool_ordering.empty() ? 0.f : m_wipe_tower_data.tool_ordering.back().print_z);
wipe_tower.set_has_tpu_filament(this->has_tpu_filament());
wipe_tower.set_filament_map(this->get_filament_maps());
@@ -2980,7 +2980,7 @@ void Print::_make_wipe_tower()
volume_to_purge = std::max(0.f, volume_to_purge - grab_purge_volume);
wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, filament_id,
m_config.prime_volume, volume_to_purge);
m_config.filament_prime_volume.values[filament_id], volume_to_purge);
current_filament_id = filament_id;
nozzle_cur_filament_ids[nozzle_id] = filament_id;
}
@@ -3052,7 +3052,7 @@ void Print::_make_wipe_tower()
for (unsigned int i = 0; i < number_of_extruders; ++i) {
for (unsigned int j = 0; j < number_of_extruders; ++j) {
if (wipe_volumes[i][j] > 0) {
wipe_volumes[i][j] = m_config.prime_volume;
wipe_volumes[i][j] = m_config.filament_prime_volume.values[j];
}
}
}
@@ -3084,7 +3084,7 @@ void Print::_make_wipe_tower()
for (const auto extruder_id : layer_tools.extruders) {
if ((first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || extruder_id !=
current_extruder_id) {
float volume_to_wipe = m_config.prime_volume;
float volume_to_wipe = m_config.filament_prime_volume.values[extruder_id];
if (m_config.purge_in_prime_tower && m_config.single_extruder_multi_material) {
volume_to_wipe = wipe_volumes[current_extruder_id][extruder_id]; // total volume to wipe after this toolchange
volume_to_wipe *= m_config.flush_multiplier.get_at(0);