ENH:Modification to Optimization of File Transfer System

jira: [STUDIO-11777]

Change-Id: Ica33b4a8177691590c07c3941b738939845d1e55
(cherry picked from commit 2100066a4acb3fd5ec987606c6efc978f9e0a392)
This commit is contained in:
milk
2025-04-27 15:30:43 +08:00
committed by Noisyfox
parent 14aa417122
commit 45936b6de8

View File

@@ -760,8 +760,6 @@ void SendToPrinterDialog::init_timer()
void SendToPrinterDialog::on_cancel(wxCloseEvent &event) void SendToPrinterDialog::on_cancel(wxCloseEvent &event)
{ {
m_worker->cancel_all(); m_worker->cancel_all();
#if !BBL_RELEASE_TO_PUBLIC
if (m_file_sys) { if (m_file_sys) {
m_file_sys->CancelUploadTask(); m_file_sys->CancelUploadTask();
@@ -770,7 +768,6 @@ void SendToPrinterDialog::on_cancel(wxCloseEvent &event)
m_task_timer.reset(); m_task_timer.reset();
} }
} }
#endif
m_tcp_try_connect = true; m_tcp_try_connect = true;
m_tutk_try_connect = false; m_tutk_try_connect = false;
m_ftp_try_connect = false; m_ftp_try_connect = false;
@@ -811,7 +808,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
m_status_bar->set_cancel_callback_fina([this]() { m_status_bar->set_cancel_callback_fina([this]() {
BOOST_LOG_TRIVIAL(info) << "print_job: enter canceled"; BOOST_LOG_TRIVIAL(info) << "print_job: enter canceled";
m_worker->cancel_all(); m_worker->cancel_all();
#if !BBL_RELEASE_TO_PUBLIC
if (m_file_sys) { if (m_file_sys) {
m_file_sys->CancelUploadTask(); m_file_sys->CancelUploadTask();
if (m_task_timer && m_task_timer->IsRunning()) { if (m_task_timer && m_task_timer->IsRunning()) {
@@ -819,7 +816,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
m_task_timer.reset(); m_task_timer.reset();
} }
} }
#endif
m_is_canceled = true; m_is_canceled = true;
wxCommandEvent* event = new wxCommandEvent(EVT_PRINT_JOB_CANCEL); wxCommandEvent* event = new wxCommandEvent(EVT_PRINT_JOB_CANCEL);
wxQueueEvent(this, event); wxQueueEvent(this, event);
@@ -874,7 +871,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
fs::path default_output_file_path = boost::filesystem::path(default_output_file.c_str()); fs::path default_output_file_path = boost::filesystem::path(default_output_file.c_str());
file_name = default_output_file_path.filename().string(); file_name = default_output_file_path.filename().string();
}*/ }*/
#if !BBL_RELEASE_TO_PUBLIC
if (!obj_->is_lan_mode_printer() && obj_->is_support_brtc) { if (!obj_->is_lan_mode_printer() && obj_->is_support_brtc) {
update_print_status_msg(wxEmptyString, false, false); update_print_status_msg(wxEmptyString, false, false);
if (m_file_sys) { if (m_file_sys) {
@@ -917,7 +914,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
} }
} }
} else { } else {
#endif
auto m_send_job = std::make_unique<SendJob>(m_printer_last_select); auto m_send_job = std::make_unique<SendJob>(m_printer_last_select);
m_send_job->m_dev_ip = obj_->dev_ip; m_send_job->m_dev_ip = obj_->dev_ip;
m_send_job->m_access_code = obj_->get_access_code(); m_send_job->m_access_code = obj_->get_access_code();
@@ -962,9 +959,8 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
m_send_job->check_and_continue(); m_send_job->check_and_continue();
} }
replace_job(*m_worker, std::move(m_send_job)); replace_job(*m_worker, std::move(m_send_job));
#if !BBL_RELEASE_TO_PUBLIC
} }
#endif
BOOST_LOG_TRIVIAL(info) << "send_job: send print job"; BOOST_LOG_TRIVIAL(info) << "send_job: send print job";
} }
@@ -1168,16 +1164,12 @@ void SendToPrinterDialog::on_selection_changed(wxCommandEvent &event)
obj->command_request_push_all(); obj->command_request_push_all();
if (!dev->get_selected_machine()) { if (!dev->get_selected_machine()) {
dev->set_selected_machine(m_printer_last_select, true); dev->set_selected_machine(m_printer_last_select, true);
#if !BBL_RELEASE_TO_PUBLIC
if (m_file_sys) m_file_sys.reset(); if (m_file_sys) m_file_sys.reset();
#endif
}else if (dev->get_selected_machine()->dev_id != m_printer_last_select) { }else if (dev->get_selected_machine()->dev_id != m_printer_last_select) {
m_ability_list.clear(); m_ability_list.clear();
//update_storage_list(std::vector<std::string>()); //update_storage_list(std::vector<std::string>());
dev->set_selected_machine(m_printer_last_select, true); dev->set_selected_machine(m_printer_last_select, true);
#if !BBL_RELEASE_TO_PUBLIC
if (m_file_sys) m_file_sys.reset(); if (m_file_sys) m_file_sys.reset();
#endif
} }
} }
else { else {
@@ -1257,11 +1249,6 @@ void SendToPrinterDialog::update_show_status()
} }
if (!m_is_in_sending_mode) { if (!m_is_in_sending_mode) {
#if BBL_RELEASE_TO_PUBLIC
show_status(PrintDialogStatus::PrintStatusReadingFinished);
return;
}
#else
if (!obj_->is_support_brtc || m_ftp_try_connect) { if (!obj_->is_support_brtc || m_ftp_try_connect) {
if (m_file_sys) { if (m_file_sys) {
m_device_select.clear(); m_device_select.clear();
@@ -1420,7 +1407,6 @@ void SendToPrinterDialog::update_show_status()
m_file_sys->Start(); m_file_sys->Start();
} }
} }
#endif
} }
bool SendToPrinterDialog::is_blocking_printing(MachineObject* obj_) bool SendToPrinterDialog::is_blocking_printing(MachineObject* obj_)
@@ -1766,14 +1752,11 @@ bool SendToPrinterDialog::Show(bool show)
Fit(); Fit();
if (show) { CenterOnParent(); } if (show) { CenterOnParent(); }
#if !BBL_RELEASE_TO_PUBLIC
if (m_file_sys) { if (m_file_sys) {
m_waiting_enable = false; m_waiting_enable = false;
m_waiting_support = false; m_waiting_support = false;
show ? m_file_sys->Start() : m_file_sys->Stop(); show ? m_file_sys->Start() : m_file_sys->Stop();
} }
#endif
return DPIDialog::Show(show); return DPIDialog::Show(show);
} }