FIX: do not touch the plate with different printing sequence
jira: STUDIO-5424 Change-Id: I8ad00fa991b753de126a5bef0d320c452033e2e7 (cherry picked from commit c4adfe16e285f238f2c5cd8938b2167fdfb6b1b0)
This commit is contained in:
parent
f81ba71aa5
commit
da1b9bd747
|
@ -92,6 +92,7 @@ void ArrangeJob::clear_input()
|
||||||
m_unprintable.clear();
|
m_unprintable.clear();
|
||||||
m_locked.clear();
|
m_locked.clear();
|
||||||
m_unarranged.clear();
|
m_unarranged.clear();
|
||||||
|
m_uncompatible_plates.clear();
|
||||||
m_selected.reserve(count + 1 /* for optional wti */);
|
m_selected.reserve(count + 1 /* for optional wti */);
|
||||||
m_unselected.reserve(count + 1 /* for optional wti */);
|
m_unselected.reserve(count + 1 /* for optional wti */);
|
||||||
m_unprintable.reserve(cunprint /* for optional wti */);
|
m_unprintable.reserve(cunprint /* for optional wti */);
|
||||||
|
@ -185,10 +186,20 @@ void ArrangeJob::prepare_selected() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArrangeJob::prepare_all() {
|
void ArrangeJob::prepare_all() {
|
||||||
PartPlateList& plate_list = m_plater->get_partplate_list();
|
|
||||||
|
|
||||||
clear_input();
|
clear_input();
|
||||||
|
|
||||||
|
PartPlateList& plate_list = m_plater->get_partplate_list();
|
||||||
|
for (size_t i = 0; i < plate_list.get_plate_count(); i++) {
|
||||||
|
PartPlate* plate = plate_list.get_plate(i);
|
||||||
|
bool same_as_global_print_seq = true;
|
||||||
|
plate->get_real_print_seq(&same_as_global_print_seq);
|
||||||
|
if (plate->is_locked() == false && !same_as_global_print_seq) {
|
||||||
|
plate->lock(true);
|
||||||
|
m_uncompatible_plates.push_back(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Model &model = m_plater->model();
|
Model &model = m_plater->model();
|
||||||
bool selected_is_locked = false;
|
bool selected_is_locked = false;
|
||||||
|
|
||||||
|
@ -707,6 +718,10 @@ void ArrangeJob::finalize() {
|
||||||
plate_list.rebuild_plates_after_arrangement(!only_on_partplate, true);
|
plate_list.rebuild_plates_after_arrangement(!only_on_partplate, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unlock the plates we just locked
|
||||||
|
for (int i : m_uncompatible_plates)
|
||||||
|
plate_list.get_plate(i)->lock(false);
|
||||||
|
|
||||||
// BBS: update slice context and gcode result.
|
// BBS: update slice context and gcode result.
|
||||||
m_plater->update_slicing_context_to_current_partplate();
|
m_plater->update_slicing_context_to_current_partplate();
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ class ArrangeJob : public PlaterJob
|
||||||
ArrangePolygons m_selected, m_unselected, m_unprintable, m_locked;
|
ArrangePolygons m_selected, m_unselected, m_unprintable, m_locked;
|
||||||
std::vector<ModelInstance*> m_unarranged;
|
std::vector<ModelInstance*> m_unarranged;
|
||||||
std::map<int, ArrangePolygons> m_selected_groups; // groups of selected items for sequential printing
|
std::map<int, ArrangePolygons> m_selected_groups; // groups of selected items for sequential printing
|
||||||
|
std::vector<int> m_uncompatible_plates; // plate indices with different printing sequence than global
|
||||||
|
|
||||||
arrangement::ArrangeParams params;
|
arrangement::ArrangeParams params;
|
||||||
int current_plate_index = 0;
|
int current_plate_index = 0;
|
||||||
Polygon bed_poly;
|
Polygon bed_poly;
|
||||||
|
|
Loading…
Reference in New Issue