ENH: refine multiple plate and CLI logic

1. support bed_type for each plate in CLI
2. don't render the calibration thumbnail under CLI
3. fix the plate box not generated issue
4. refine the slice_all button's status logic: from all slicable to one slicable
5. fix serveral issues in multiple plate's switch and slicing

Change-Id: I6193a799da0367068169ce315d1fcc9098357fd1
This commit is contained in:
lane.wei 2022-11-11 22:02:54 +08:00 committed by Lane.Wei
parent dea19ded1e
commit 65f2a063b6
6 changed files with 174 additions and 151 deletions

View file

@ -92,6 +92,7 @@ private:
bool m_locked;
bool m_ready_for_slice;
bool m_slice_result_valid;
bool m_apply_invalid {false};
float m_slice_percent;
Print *m_print; //Print reference, not own it, no need to serialize
@ -331,11 +332,30 @@ public:
bool is_printable() const { return m_printable; }
//can be sliced or not
bool can_slice() const { return m_ready_for_slice; }
void update_slice_ready_status(bool ready_slice) { m_ready_for_slice = ready_slice; }
bool can_slice() const
{
return m_ready_for_slice && !m_apply_invalid;
}
void update_slice_ready_status(bool ready_slice)
{
m_ready_for_slice = ready_slice;
}
//bedtype mismatch or not
bool is_apply_result_invalid() const
{
return m_apply_invalid;
}
void update_apply_result_invalid(bool invalid)
{
m_apply_invalid = invalid;
}
//is slice result valid or not
bool is_slice_result_valid() const { return m_slice_result_valid; }
bool is_slice_result_valid() const
{
return m_slice_result_valid;
}
//is slice result ready for print
bool is_slice_result_ready_for_print() const
@ -389,7 +409,7 @@ public:
std::vector<std::pair<int, int>> objects_and_instances;
std::vector<std::pair<int, int>> instances_outside;
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
for (std::vector<std::pair<int, int>>::iterator it = objects_and_instances.begin(); it != objects_and_instances.end(); ++it)
obj_to_instance_set.insert(std::pair(it->first, it->second));
@ -407,7 +427,7 @@ public:
for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it)
objects_and_instances.emplace_back(it->first, it->second);
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
}
/*template<class Archive> void serialize(Archive& ar)
{