FIX: STUDIO-3745 open gcode.3mf, unable export to file

Change-Id: Ib8a45cb38f28438ecc4d2a772f1437dbd324078a
This commit is contained in:
maosheng.wei 2023-07-26 10:51:38 +08:00 committed by Lane.Wei
parent 5eba42b565
commit d8b56977b9
3 changed files with 33 additions and 2 deletions

View File

@ -1866,7 +1866,7 @@ bool MainFrame::get_enable_print_status()
}
else if (m_print_select == eExportSlicedFile)
{
if (!current_plate->is_slice_result_ready_for_print())
if (!current_plate->is_slice_result_ready_for_export())
{
enable = false;
}
@ -1889,7 +1889,7 @@ bool MainFrame::get_enable_print_status()
}
else if (m_print_select == eExportAllSlicedFile)
{
if (!part_plate_list.is_all_slice_results_ready_for_print())
if (!part_plate_list.is_all_slice_result_ready_for_export())
{
enable = false;
}

View File

@ -4728,6 +4728,30 @@ bool PartPlateList::is_all_slice_results_ready_for_print() const
return res;
}
//check whether all plates' slice result valid for export to file
bool PartPlateList::is_all_slice_result_ready_for_export() const
{
bool res = false;
for (unsigned int i = 0; i < (unsigned int) m_plate_list.size(); ++i) {
if (!m_plate_list[i]->empty()) {
if (m_plate_list[i]->is_all_instances_unprintable()) {
continue;
}
if (!m_plate_list[i]->is_slice_result_ready_for_print()) {
return false;
}
}
if (m_plate_list[i]->is_slice_result_ready_for_print()) {
if (!m_plate_list[i]->has_printable_instances()) {
return false;
}
res = true;
}
}
return res;
}
//check whether all plates ready for slice
bool PartPlateList::is_all_plates_ready_for_slice() const

View File

@ -411,6 +411,12 @@ public:
return result;
}
// check whether plate's slice result valid for export to file
bool is_slice_result_ready_for_export()
{
return is_slice_result_ready_for_print() && has_printable_instances();
}
//invalid sliced result
void update_slice_result_valid_state(bool valid = false);
@ -775,6 +781,7 @@ public:
bool is_all_slice_results_valid() const;
bool is_all_slice_results_ready_for_print() const;
bool is_all_plates_ready_for_slice() const;
bool is_all_slice_result_ready_for_export() const;
void print() const;
//get the all the sliced result