mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
NEW: add comments for print job
Change-Id: Ie7a65a76d535dc210268842704fdaf4a7475135a Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
de712b08f1
commit
346480005a
2 changed files with 18 additions and 0 deletions
|
@ -221,9 +221,19 @@ void PrintJob::process()
|
||||||
return was_canceled();
|
return was_canceled();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
NetworkAgent* m_agent = wxGetApp().getAgent();
|
NetworkAgent* m_agent = wxGetApp().getAgent();
|
||||||
|
|
||||||
if (params.connection_type != "lan") {
|
if (params.connection_type != "lan") {
|
||||||
|
if (params.dev_ip.empty())
|
||||||
|
params.comments = "no_ip";
|
||||||
|
else if (this->cloud_print_only)
|
||||||
|
params.comments = "low_version";
|
||||||
|
else if (!this->has_sdcard)
|
||||||
|
params.comments = "no_sdcard";
|
||||||
|
else if (params.password.empty())
|
||||||
|
params.comments = "no_password";
|
||||||
|
|
||||||
if (!this->cloud_print_only
|
if (!this->cloud_print_only
|
||||||
&& !params.password.empty()
|
&& !params.password.empty()
|
||||||
&& !params.dev_ip.empty()
|
&& !params.dev_ip.empty()
|
||||||
|
@ -232,6 +242,13 @@ void PrintJob::process()
|
||||||
BOOST_LOG_TRIVIAL(info) << "print_job: try to start local print 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"));
|
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);
|
||||||
|
if (result == BAMBU_NETWORK_ERR_FTP_LOGIN_DENIED) {
|
||||||
|
params.comments = "wrong_code";
|
||||||
|
} else if (result == BAMBU_NETWORK_ERR_FTP_UPLOAD_FAILED) {
|
||||||
|
params.comments = "upload_failed";
|
||||||
|
} else {
|
||||||
|
params.comments = (boost::format("failed(%1%)") % result).str();
|
||||||
|
}
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
// try to send with cloud
|
// try to send with cloud
|
||||||
BOOST_LOG_TRIVIAL(warning) << "print_job: try to send with cloud";
|
BOOST_LOG_TRIVIAL(warning) << "print_job: try to send with cloud";
|
||||||
|
|
|
@ -113,6 +113,7 @@ struct PrintParams {
|
||||||
std::string ftp_file_md5;
|
std::string ftp_file_md5;
|
||||||
std::string ams_mapping;
|
std::string ams_mapping;
|
||||||
std::string connection_type;
|
std::string connection_type;
|
||||||
|
std::string comments;
|
||||||
|
|
||||||
/* access options */
|
/* access options */
|
||||||
std::string dev_ip;
|
std::string dev_ip;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue