NEW: print with emmc

jira: [STUDIO-14427]
Change-Id: I8b0c56ce1c2b7b90949b72c49acfdbb31c876df1
(cherry picked from commit 76e45bde2540ee418719e00b999c5fd724baec71)
This commit is contained in:
haolin.tian
2025-09-23 20:20:06 +08:00
committed by Noisyfox
parent d6e40352c2
commit aa75c444aa
8 changed files with 145 additions and 10 deletions

View File

@@ -12,6 +12,8 @@
#include "slic3r/GUI/DeviceCore/DevManager.h"
#include "slic3r/GUI/DeviceCore/DevUtil.h"
#include "slic3r/Utils/FileTransferUtils.hpp"
namespace Slic3r {
namespace GUI {
@@ -206,13 +208,26 @@ void PrintJob::process(Ctl &ctl)
// check access code and ip address
if (this->connection_type == "lan" && m_print_type == "from_normal") {
params.dev_id = m_dev_id;
params.project_name = "verify_job";
params.filename = job_data._temp_path.string();
params.connection_type = this->connection_type;
bool emmc_ok = false;
bool ftp_ok = false;
if (could_emmc_print) {
std::string devIP = m_dev_ip;
std::string accessCode = m_access_code;
std::string url = "bambu:///local/" + devIP + "?port=6000&user=" + "bblp" + "&passwd=" + accessCode;
std::unique_ptr<FileTransferTunnel> tunnel = std::make_unique<FileTransferTunnel>(module(), url);
emmc_ok = tunnel->sync_start_connect();
}
{
params.dev_id = m_dev_id;
params.project_name = "verify_job";
params.filename = job_data._temp_path.string();
params.connection_type = this->connection_type;
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
if (result != 0) {
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
ftp_ok = result == 0;
}
if (!emmc_ok && !ftp_ok) {
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
m_enter_ip_address_fun_fail();
m_job_finished = true;
@@ -563,7 +578,7 @@ void PrintJob::process(Ctl &ctl)
}
}
} else {
if (this->has_sdcard) {
if (this->has_sdcard || this->could_emmc_print) {
ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
result = m_agent->start_local_print(params, update_fn, cancel_fn);
} else {