fix: Print plate and Send to Moonraker printers upload a 3MF zip as G-code (#16968)

With "Use printer agents" on, Print plate and Send on Moonraker-based printer agents uploaded the plate's .gcode.3mf bundle under a .gcode name, so Klipper read a zip as G-code and cancelled the print.

Both paths now upload the plate's G-code from the bundle, named after the job. Printers whose profile sets use_3mf keep getting the bundle, named <job>.gcode.3mf, and the Qidi agent's print start names the plate with plateindex. The print start quotes the file name, so job names keep spaces, apostrophes and non-ASCII letters.

Picks up #16453 by DIEHARDave, who wrote the plate G-code extraction for Print plate.

Fixes #16954

Co-authored-by: DIEHARDave <diehard.dave@gmail.com>
This commit is contained in:
Kris AustinandDIEHARDave authored and GitHub committed 2026-10-29 07:03:15 -05:00
1 parent 98619b64a2
commit 187baae4ee
6 files changed
+415 -24

No files matched your search

@@ -4,7 +4,10 @@
#include <string>
#include <nlohmann/json.hpp>
#include "slic3r/Utils/QidiPrinterAgent.hpp"
#include "slic3r/Utils/bambu_networking.hpp"
using namespace Slic3r;
@@ -46,3 +49,13 @@ TEST_CASE("Filaments past the firmware's last tool variable are skipped", "[Qidi
CHECK(QidiPrinterAgent::build_tool_slot_script(mapping) == "SAVE_VARIABLE VARIABLE=value_t15 VALUE=\"'slot1'\"");
}
TEST_CASE("The print start of a 3MF names the plate to print", "[QidiPrinterAgent]")
{
PrintParams params;
params.plate_index = 2;
CHECK(QidiPrinterAgent::print_start_request(params, "Cube.gcode.3mf") ==
nlohmann::json{{"filename", "Cube.gcode.3mf"}, {"plateindex", "2"}});
CHECK(QidiPrinterAgent::print_start_request(params, "Cube.gcode") == nlohmann::json{{"filename", "Cube.gcode"}});
}