From 992031620ec3dcebd1aa6d7f0c89ef2374ddc30a Mon Sep 17 00:00:00 2001 From: scott0122 <39105828+scott0122@users.noreply.github.com> Date: Wed, 3 Nov 2021 06:34:12 +0800 Subject: [PATCH] Repetier-Server: Enable "Start printing after upload" (#5351) --- src/slic3r/Utils/Repetier.cpp | 6 +++++- src/slic3r/Utils/Repetier.hpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/Utils/Repetier.cpp b/src/slic3r/Utils/Repetier.cpp index 7b66922d7..094d1baa2 100644 --- a/src/slic3r/Utils/Repetier.cpp +++ b/src/slic3r/Utils/Repetier.cpp @@ -107,7 +107,7 @@ bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error bool res = true; - auto url = make_url((boost::format("printer/model/%1%") % port).str()); + auto url = upload_data.start_print?make_url((boost::format("printer/job/%1%") % port).str()):make_url((boost::format("printer/model/%1%") % port).str()); BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Uploading file %2% at %3%, filename: %4%, path: %5%, print: %6%, group: %7%") % name @@ -125,6 +125,10 @@ bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error http.form_add("group", upload_data.group); } + if(upload_data.start_print) { + http.form_add("name", upload_filename.string()); + } + http.form_add("a", "upload") .form_add_file("filename", upload_data.source_path.string(), upload_filename.string()) .on_complete([&](std::string body, unsigned status) { diff --git a/src/slic3r/Utils/Repetier.hpp b/src/slic3r/Utils/Repetier.hpp index 5141dc040..057575417 100644 --- a/src/slic3r/Utils/Repetier.hpp +++ b/src/slic3r/Utils/Repetier.hpp @@ -27,7 +27,7 @@ public: bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override; bool has_auto_discovery() const override { return false; } bool can_test() const override { return true; } - bool can_start_print() const override { return false; } + bool can_start_print() const override { return true; } bool supports_multiple_printers() const override { return true; } std::string get_host() const override { return host; }