ENH: optimize WipeTowerDialog logics

1. flush_multiplier will be apply the the flush volume during slicing
   rather than only in auto-calc
2. mark too small flush volume as red instead of a warning dialog
3. do not forbidden flush volume lower than the nozzle volume
4. fix incorrect focus status of text input box in WipeTowerDialog
5. check the minimum flush volume based on flush_multiplier
6. limit the decimal digit to two places

Signed-off-by: yifan.wu <yifan.wu@bambulab.com>
Change-Id: Icdcc50c88ecd9463fb9ce73f996d57c2d9f0187f
(cherry picked from commit 60e01edc511f117b05a8a9b92aaf6fd55325e485)
This commit is contained in:
yifan.wu 2022-12-05 09:14:52 +08:00 committed by Lane.Wei
parent 97cd9e900b
commit 41fcf8eb1e
7 changed files with 105 additions and 36 deletions

View file

@ -2024,23 +2024,22 @@ void Print::_make_wipe_tower()
for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers
if (!layer_tools.has_wipe_tower) continue;
bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front();
wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id, false);
wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id);
for (const auto extruder_id : layer_tools.extruders) {
// BBS: priming logic is removed, so no need to do toolchange for first extruder
if (/*(first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || */extruder_id != current_extruder_id) {
float volume_to_purge = wipe_volumes[current_extruder_id][extruder_id];
volume_to_purge *= m_config.flush_multiplier;
// Not all of that can be used for infill purging:
//volume_to_purge -= (float)m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id);
volume_to_purge -= (float)m_config.nozzle_volume;
// try to assign some infills/objects for the wiping:
volume_to_purge = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, volume_to_purge);
// add back the minimal amount toforce on the wipe tower:
//volume_to_purge += (float)m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id);
volume_to_purge += (float)m_config.nozzle_volume;
// request a toolchange at the wipe tower with at least volume_to_wipe purging amount
wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height,