ENH: CLI: some refines of slicing

1. add support_used flag in sliced_info
2. use the old thumbnail if no need

Change-Id: I8ad166978fe6f76f86b1ef014945dd70b26a6285
This commit is contained in:
lane.wei 2022-11-14 21:59:49 +08:00 committed by Lane.Wei
parent 0713945e02
commit c431cbf202
6 changed files with 329 additions and 235 deletions

View file

@ -1031,6 +1031,11 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", i=%1%, key=%2%")%i %changed_keys[i];
}
}
const ConfigOption* enable_support_option = new_full_config.option("enable_support");
if (enable_support_option && enable_support_option->getBool())
m_support_used = true;
else
m_support_used = false;
// Find modified keys of the various configs. Resolve overrides extruder retract values by filament profiles.
DynamicPrintConfig filament_overrides;
@ -1550,7 +1555,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
// If it is not valid, then it is ensured that PrintObject.m_slicing_params is not in use
// (posSlicing and posSupportMaterial was invalidated).
for (PrintObject *object : m_objects)
{
object->update_slicing_parameters();
m_support_used |= object->config().enable_support;
}
#ifdef _DEBUG
check_model_ids_equal(m_model, model);
@ -1559,7 +1567,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
//BBS: add timestamp logic
if (apply_status != APPLY_STATUS_UNCHANGED)
m_modified_count++;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" %1%: finished, this %2%, m_modified_count %3%, apply_status %4%, ")%__LINE__ %this %m_modified_count %apply_status;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" %1%: finished, this %2%, m_modified_count %3%, apply_status %4%, m_support_used %5%")%__LINE__ %this %m_modified_count %apply_status %m_support_used;
return static_cast<ApplyStatus>(apply_status);
}