mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
NEW: support wait function in print job
JIRA: STUDIO-4175 Change-Id: I15bdd07dcd2bd153cc94ad411f180c8ab2022ceb Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
c09252ce11
commit
1f50a2a421
3 changed files with 22 additions and 14 deletions
|
@ -209,7 +209,7 @@ void PrintJob::process()
|
|||
params.filename = job_data._temp_path.string();
|
||||
params.connection_type = this->connection_type;
|
||||
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr);
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
|
||||
if (result != 0) {
|
||||
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
|
||||
m_enter_ip_address_fun_fail();
|
||||
|
@ -391,6 +391,12 @@ void PrintJob::process()
|
|||
return was_canceled();
|
||||
};
|
||||
|
||||
auto wait_fn = [this](int state, std::string job_info) {
|
||||
// TODO
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
if (params.connection_type != "lan") {
|
||||
if (params.dev_ip.empty())
|
||||
params.comments = "no_ip";
|
||||
|
@ -413,7 +419,7 @@ void PrintJob::process()
|
|||
BOOST_LOG_TRIVIAL(info) << "print_job: use ftp send print only";
|
||||
this->update_status(curr_percent, _L("Sending print job over LAN"));
|
||||
is_try_lan_mode = true;
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
|
||||
if (result < 0) {
|
||||
error_text = wxString::Format("Access code:%s Ip address:%s", params.password, params.dev_ip);
|
||||
// try to send with cloud
|
||||
|
@ -429,7 +435,7 @@ void PrintJob::process()
|
|||
// try to send local with record
|
||||
BOOST_LOG_TRIVIAL(info) << "print_job: try to start local print with record";
|
||||
this->update_status(curr_percent, _L("Sending print job over LAN"));
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
|
||||
if (result == 0) {
|
||||
params.comments = "";
|
||||
}
|
||||
|
@ -444,13 +450,13 @@ void PrintJob::process()
|
|||
// try to send with cloud
|
||||
BOOST_LOG_TRIVIAL(warning) << "print_job: try to send with cloud";
|
||||
this->update_status(curr_percent, _L("Sending print job through cloud service"));
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
|
||||
}
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << "print_job: send with cloud";
|
||||
this->update_status(curr_percent, _L("Sending print job through cloud service"));
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn);
|
||||
result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -489,6 +495,8 @@ void PrintJob::process()
|
|||
|
||||
BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
|
||||
} else {
|
||||
// wait for printer mqtt ready the same job id
|
||||
|
||||
wxGetApp().plater()->record_slice_preset("print");
|
||||
|
||||
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue