FIX: add can slice judgement in slice all plates processing
jira: STUDIO-6325 Change-Id: Ic7fb8cef000c03210bb77289a570ee6b60b6083e
This commit is contained in:
parent
65db1ef6e0
commit
6d0280da16
|
@ -7564,24 +7564,26 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar()
|
||||||
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICED;
|
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICED;
|
||||||
else
|
else
|
||||||
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICE_FAILED;
|
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICE_FAILED;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (!plate_list.get_plate(i)->can_slice())
|
||||||
|
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICE_FAILED;
|
||||||
|
else {
|
||||||
if (plate_list.get_plate(i)->get_slicing_percent() < 0.0f)
|
if (plate_list.get_plate(i)->get_slicing_percent() < 0.0f)
|
||||||
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::UNSLICED;
|
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::UNSLICED;
|
||||||
else
|
else
|
||||||
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICING;
|
m_sel_plate_toolbar.m_items[i]->slice_state = IMToolbarItem::SliceState::SLICING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (m_sel_plate_toolbar.show_stats_item) {
|
if (m_sel_plate_toolbar.show_stats_item) {
|
||||||
all_plates_stats_item->percent = 0.0f;
|
all_plates_stats_item->percent = 0.0f;
|
||||||
|
|
||||||
size_t sliced_plates_cnt = 0;
|
size_t sliced_plates_cnt = 0;
|
||||||
bool slice_failed = false;
|
|
||||||
for (auto plate : plate_list.get_nonempty_plate_list()) {
|
for (auto plate : plate_list.get_nonempty_plate_list()) {
|
||||||
if (plate->is_slice_result_valid() && plate->is_slice_result_ready_for_print())
|
if (plate->is_slice_result_valid() && plate->is_slice_result_ready_for_print())
|
||||||
sliced_plates_cnt++;
|
sliced_plates_cnt++;
|
||||||
if (plate->is_slice_result_valid() && !plate->is_slice_result_ready_for_print())
|
|
||||||
slice_failed = true;
|
|
||||||
}
|
}
|
||||||
all_plates_stats_item->percent = (float)(sliced_plates_cnt) / (float)(plate_list.get_nonempty_plate_list().size()) * 100.0f;
|
all_plates_stats_item->percent = (float)(sliced_plates_cnt) / (float)(plate_list.get_nonempty_plate_list().size()) * 100.0f;
|
||||||
|
|
||||||
|
@ -7592,8 +7594,13 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar()
|
||||||
else if (all_plates_stats_item->percent < 100.0f)
|
else if (all_plates_stats_item->percent < 100.0f)
|
||||||
all_plates_stats_item->slice_state = IMToolbarItem::SliceState::SLICING;
|
all_plates_stats_item->slice_state = IMToolbarItem::SliceState::SLICING;
|
||||||
|
|
||||||
if (slice_failed)
|
for (auto toolbar_item : m_sel_plate_toolbar.m_items) {
|
||||||
|
if(toolbar_item->slice_state == IMToolbarItem::SliceState::SLICE_FAILED) {
|
||||||
all_plates_stats_item->slice_state = IMToolbarItem::SliceState::SLICE_FAILED;
|
all_plates_stats_item->slice_state = IMToolbarItem::SliceState::SLICE_FAILED;
|
||||||
|
all_plates_stats_item->selected = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Changing parameters does not invalid all plates, need extra logic to validate
|
// Changing parameters does not invalid all plates, need extra logic to validate
|
||||||
bool gcode_result_valid = true;
|
bool gcode_result_valid = true;
|
||||||
|
|
|
@ -11956,7 +11956,7 @@ int Plater::start_next_slice()
|
||||||
this->p->view3D->reload_scene(false);
|
this->p->view3D->reload_scene(false);
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": update_background_process returns %1%")%state;
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": update_background_process returns %1%")%state;
|
||||||
if (p->partplate_list.get_curr_plate()->is_apply_result_invalid()) {
|
if (!p->partplate_list.get_curr_plate()->can_slice()) {
|
||||||
p->process_completed_with_error = p->partplate_list.get_curr_plate_index();
|
p->process_completed_with_error = p->partplate_list.get_curr_plate_index();
|
||||||
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": found invalidated apply in update_background_process.");
|
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": found invalidated apply in update_background_process.");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue