Merged psSkirt and psBrim

This commit is contained in:
Lukas Matena 2021-06-28 15:26:47 +02:00
parent 97d95e814f
commit 63566a92b3
5 changed files with 15 additions and 21 deletions

View File

@ -157,7 +157,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "wipe_tower_x" || opt_key == "wipe_tower_x"
|| opt_key == "wipe_tower_y" || opt_key == "wipe_tower_y"
|| opt_key == "wipe_tower_rotation_angle") { || opt_key == "wipe_tower_rotation_angle") {
steps.emplace_back(psSkirt); steps.emplace_back(psSkirtBrim);
} else if ( } else if (
opt_key == "nozzle_diameter" opt_key == "nozzle_diameter"
|| opt_key == "resolution" || opt_key == "resolution"
@ -201,7 +201,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|| opt_key == "first_layer_speed" || opt_key == "first_layer_speed"
|| opt_key == "z_offset") { || opt_key == "z_offset") {
steps.emplace_back(psWipeTower); steps.emplace_back(psWipeTower);
steps.emplace_back(psSkirt); steps.emplace_back(psSkirtBrim);
} else if (opt_key == "filament_soluble") { } else if (opt_key == "filament_soluble") {
steps.emplace_back(psWipeTower); steps.emplace_back(psWipeTower);
// Soluble support interface / non-soluble base interface produces non-soluble interface layers below soluble interface layers. // Soluble support interface / non-soluble base interface produces non-soluble interface layers below soluble interface layers.
@ -215,8 +215,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
osteps.emplace_back(posPerimeters); osteps.emplace_back(posPerimeters);
osteps.emplace_back(posInfill); osteps.emplace_back(posInfill);
osteps.emplace_back(posSupportMaterial); osteps.emplace_back(posSupportMaterial);
steps.emplace_back(psSkirt); steps.emplace_back(psSkirtBrim);
steps.emplace_back(psBrim);
} else { } else {
// for legacy, if we can't handle this option let's invalidate all steps // for legacy, if we can't handle this option let's invalidate all steps
//FIXME invalidate all steps of all objects as well? //FIXME invalidate all steps of all objects as well?
@ -239,8 +238,6 @@ bool Print::invalidate_step(PrintStep step)
{ {
bool invalidated = Inherited::invalidate_step(step); bool invalidated = Inherited::invalidate_step(step);
// Propagate to dependent steps. // Propagate to dependent steps.
if (step == psSkirt)
invalidated |= Inherited::invalidate_step(psBrim);
if (step != psGCodeExport) if (step != psGCodeExport)
invalidated |= Inherited::invalidate_step(psGCodeExport); invalidated |= Inherited::invalidate_step(psGCodeExport);
return invalidated; return invalidated;
@ -861,7 +858,7 @@ void Print::process()
} }
this->set_done(psWipeTower); this->set_done(psWipeTower);
} }
if (this->set_started(psSkirt)) { if (this->set_started(psSkirtBrim)) {
m_skirt.clear(); m_skirt.clear();
m_skirt_convex_hull.clear(); m_skirt_convex_hull.clear();
m_first_layer_convex_hull.points.clear(); m_first_layer_convex_hull.points.clear();
@ -869,9 +866,7 @@ void Print::process()
this->set_status(88, L("Generating skirt")); this->set_status(88, L("Generating skirt"));
this->_make_skirt(); this->_make_skirt();
} }
this->set_done(psSkirt);
}
if (this->set_started(psBrim)) {
m_brim.clear(); m_brim.clear();
m_first_layer_convex_hull.points.clear(); m_first_layer_convex_hull.points.clear();
if (this->has_brim()) { if (this->has_brim()) {
@ -884,7 +879,7 @@ void Print::process()
// Brim depends on skirt (brim lines are trimmed by the skirt lines), therefore if // Brim depends on skirt (brim lines are trimmed by the skirt lines), therefore if
// the skirt gets invalidated, brim gets invalidated as well and the following line is called. // the skirt gets invalidated, brim gets invalidated as well and the following line is called.
this->finalize_first_layer_convex_hull(); this->finalize_first_layer_convex_hull();
this->set_done(psBrim); this->set_done(psSkirtBrim);
} }
BOOST_LOG_TRIVIAL(info) << "Slicing process finished." << log_memory_info(); BOOST_LOG_TRIVIAL(info) << "Slicing process finished." << log_memory_info();
} }

View File

@ -45,11 +45,10 @@ enum PrintStep {
// psToolOrdering is a synonym to psWipeTower, as the Wipe Tower calculates and modifies the ToolOrdering, // psToolOrdering is a synonym to psWipeTower, as the Wipe Tower calculates and modifies the ToolOrdering,
// while if printing without the Wipe Tower, the ToolOrdering is calculated as well. // while if printing without the Wipe Tower, the ToolOrdering is calculated as well.
psToolOrdering = psWipeTower, psToolOrdering = psWipeTower,
psSkirt, psSkirtBrim,
psBrim,
// Last step before G-code export, after this step is finished, the initial extrusion path preview // Last step before G-code export, after this step is finished, the initial extrusion path preview
// should be refreshed. // should be refreshed.
psSlicingFinished = psBrim, psSlicingFinished = psSkirtBrim,
psGCodeExport, psGCodeExport,
psCount, psCount,
}; };

View File

@ -1240,7 +1240,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
deleted_objects = true; deleted_objects = true;
} }
if (new_objects || deleted_objects) if (new_objects || deleted_objects)
update_apply_status(this->invalidate_steps({ psSkirt, psBrim, psWipeTower, psGCodeExport })); update_apply_status(this->invalidate_steps({ psSkirtBrim, psWipeTower, psGCodeExport }));
if (new_objects) if (new_objects)
update_apply_status(false); update_apply_status(false);
print_regions_reshuffled = true; print_regions_reshuffled = true;

View File

@ -91,7 +91,7 @@ PrintBase::ApplyStatus PrintObject::set_instances(PrintInstances &&instances)
[](const PrintInstance& lhs, const PrintInstance& rhs) { return lhs.model_instance == rhs.model_instance && lhs.shift == rhs.shift; }); [](const PrintInstance& lhs, const PrintInstance& rhs) { return lhs.model_instance == rhs.model_instance && lhs.shift == rhs.shift; });
if (! equal) { if (! equal) {
status = PrintBase::APPLY_STATUS_CHANGED; status = PrintBase::APPLY_STATUS_CHANGED;
if (m_print->invalidate_steps({ psSkirt, psBrim, psGCodeExport }) || if (m_print->invalidate_steps({ psSkirtBrim, psGCodeExport }) ||
(! equal_length && m_print->invalidate_step(psWipeTower))) (! equal_length && m_print->invalidate_step(psWipeTower)))
status = PrintBase::APPLY_STATUS_INVALIDATED; status = PrintBase::APPLY_STATUS_INVALIDATED;
m_instances = std::move(instances); m_instances = std::move(instances);
@ -674,18 +674,18 @@ bool PrintObject::invalidate_step(PrintObjectStep step)
// propagate to dependent steps // propagate to dependent steps
if (step == posPerimeters) { if (step == posPerimeters) {
invalidated |= this->invalidate_steps({ posPrepareInfill, posInfill, posIroning }); invalidated |= this->invalidate_steps({ posPrepareInfill, posInfill, posIroning });
invalidated |= m_print->invalidate_steps({ psSkirt, psBrim }); invalidated |= m_print->invalidate_steps({ psSkirtBrim });
} else if (step == posPrepareInfill) { } else if (step == posPrepareInfill) {
invalidated |= this->invalidate_steps({ posInfill, posIroning }); invalidated |= this->invalidate_steps({ posInfill, posIroning });
} else if (step == posInfill) { } else if (step == posInfill) {
invalidated |= this->invalidate_steps({ posIroning }); invalidated |= this->invalidate_steps({ posIroning });
invalidated |= m_print->invalidate_steps({ psSkirt, psBrim }); invalidated |= m_print->invalidate_steps({ psSkirtBrim });
} else if (step == posSlice) { } else if (step == posSlice) {
invalidated |= this->invalidate_steps({ posPerimeters, posPrepareInfill, posInfill, posIroning, posSupportMaterial }); invalidated |= this->invalidate_steps({ posPerimeters, posPrepareInfill, posInfill, posIroning, posSupportMaterial });
invalidated |= m_print->invalidate_steps({ psSkirt, psBrim }); invalidated |= m_print->invalidate_steps({ psSkirtBrim });
m_slicing_params.valid = false; m_slicing_params.valid = false;
} else if (step == posSupportMaterial) { } else if (step == posSupportMaterial) {
invalidated |= m_print->invalidate_steps({ psSkirt, psBrim }); invalidated |= m_print->invalidate_steps({ psSkirtBrim });
m_slicing_params.valid = false; m_slicing_params.valid = false;
} }

View File

@ -5704,7 +5704,7 @@ void GLCanvas3D::_load_print_toolpaths()
if (print == nullptr) if (print == nullptr)
return; return;
if (!print->is_step_done(psSkirt) || !print->is_step_done(psBrim)) if (! print->is_step_done(psSkirtBrim))
return; return;
if (!print->has_skirt() && !print->has_brim()) if (!print->has_skirt() && !print->has_brim())