ENH: improve the send all logic

if has one plate with valid gcode, let the send_all success
https://jira.bambooolab.com/browse/STUDIO-2355

Change-Id: I9f022604e354560fea67d2914294391194e5234f
This commit is contained in:
lane.wei 2023-03-21 17:59:23 +08:00 committed by Lane.Wei
parent 9e077b2e65
commit 82d10c34e0

View file

@ -162,9 +162,26 @@ void SendJob::process()
PartPlate* plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx);
if (plate == nullptr) {
plate = m_plater->get_partplate_list().get_curr_plate();
if (plate == nullptr)
return;
if (job_data.plate_idx == PLATE_ALL_IDX) {
//all plate
for (int index = 0; index < total_plate_num; index++)
{
PartPlate* plate_n = m_plater->get_partplate_list().get_plate(index);
if (plate_n && plate_n->is_valid_gcode_file())
{
plate = plate_n;
break;
}
}
}
else {
plate = m_plater->get_partplate_list().get_curr_plate();
}
if (plate == nullptr) {
BOOST_LOG_TRIVIAL(error) << "can not find plate with valid gcode file when sending to print, plate_index="<< job_data.plate_idx;
update_status(curr_percent, check_gcode_failed_str);
return;
}
}
/* check gcode is valid */