From 82d10c34e0421258d5552626718060ee7d760fb3 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Tue, 21 Mar 2023 17:59:23 +0800 Subject: [PATCH] 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 --- src/slic3r/GUI/Jobs/SendJob.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Jobs/SendJob.cpp b/src/slic3r/GUI/Jobs/SendJob.cpp index eb3a065dc2..189ddec298 100644 --- a/src/slic3r/GUI/Jobs/SendJob.cpp +++ b/src/slic3r/GUI/Jobs/SendJob.cpp @@ -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 */