FIX: fix serveral issues under multiple plate slicing

1. preview result not correct when switch from invalid to valid
2. slice_all button not correct after loading gcode
3. slice_all button always set to enable with normal model(not gcode and exported files)
4. thumbnail missing issue after mmu paint

Change-Id: I9873a035acc277b790d46d705c4a794c09bbd889
This commit is contained in:
lane.wei 2022-11-17 20:02:39 +08:00 committed by Lane.Wei
parent 276989a878
commit aac34a5411
3 changed files with 31 additions and 17 deletions

View file

@ -9068,7 +9068,12 @@ int Plater::export_3mf(const boost::filesystem::path& output_path, SaveStrategy
if (!(strategy & SaveStrategy::Backup)) {
for (int i = 0; i < p->partplate_list.get_plate_count(); i++) {
ThumbnailData* thumbnail_data = &p->partplate_list.get_plate(i)->thumbnail_data;
if (!p->partplate_list.get_plate(i)->thumbnail_data.is_valid()) {
if (p->partplate_list.get_plate(i)->thumbnail_data.is_valid() && using_exported_file()) {
//no need to generate thumbnail
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": non need to re-generate thumbnail for gcode/exported mode of plate %1%")%i;
}
else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": re-generate thumbnail for plate %1%") % i;
const ThumbnailsParams thumbnail_params = { {}, false, true, true, true, i };
p->generate_thumbnail(p->partplate_list.get_plate(i)->thumbnail_data, THUMBNAIL_SIZE_3MF.first, THUMBNAIL_SIZE_3MF.second, thumbnail_params, Camera::EType::Ortho);
}
@ -9270,6 +9275,14 @@ void Plater::reslice()
//BBS: jusdge the result
bool result = this->p->restart_background_process(state | priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", Line %1%: restart background,state=%2%, result=%3%")%__LINE__%state %result;
if ((state & priv::UPDATE_BACKGROUND_PROCESS_INVALID) != 0)
{
//BBS: add logs
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": state %1% is UPDATE_BACKGROUND_PROCESS_INVALID, can not slice") % state;
p->update_fff_scene_only_shells();
return;
}
if ((!result) && p->m_slice_all && (p->m_cur_slice_plate < (p->partplate_list.get_plate_count() - 1)))
{
//slice next
@ -9290,13 +9303,6 @@ void Plater::reslice()
this->SetDropTarget(nullptr);
}
if ((state & priv::UPDATE_BACKGROUND_PROCESS_INVALID) != 0)
{
//BBS: add logs
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": state %1% is UPDATE_BACKGROUND_PROCESS_INVALID, can not slice") % state ;
return;
}
bool clean_gcode_toolpaths = true;
// BBS
if (p->background_process.running())