ENH:Add a network disconnection state to the sending module

jira:[STUDIO-11839]

Change-Id: I87d68f87a2fcb87110c20faa589b863c6cc34ce5
This commit is contained in:
milk 2025-05-20 14:21:23 +08:00 committed by lane.wei
parent 1735817a24
commit d5be32428a
2 changed files with 17 additions and 9 deletions

View File

@ -1733,7 +1733,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
} else if (status == PrintStatusTPUUnsupportAutoCali) {
Enable_Refresh_Button(true);
Enable_Send_Button(false);
} else if (status == PrintStatusHasFilamentInBlackListError) { //this war
} else if (status == PrintStatusHasFilamentInBlackListError) {
Enable_Refresh_Button(true);
Enable_Send_Button(false);
} else if (status == PrintStatusWarningKvalueNotUsed) {
@ -3577,7 +3577,7 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
try
{
int chamber_temp = chamber_temperatures->values[item.id];
if (chamber_temp >= obj_->chamber_temp_switch_heat) {// check close door
if (chamber_temp >= obj_->chamber_temp_switch_heat) {// check close door
show_status(PrintDialogStatus::PrintStatusFilamentWarningHighChamberTempCloseDoor);
if (PrePrintChecker::is_error(PrintDialogStatus::PrintStatusFilamentWarningHighChamberTempCloseDoor)) { return; }
}

View File

@ -312,6 +312,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
OutputDebugStringA(std::to_string(i).c_str());
OutputDebugStringA("\n");*/
m_file_sys->Retry();
wxLogMessage(_L("click to retry"));
}
});
@ -775,6 +776,8 @@ void SendToPrinterDialog::on_cancel(wxCloseEvent &event)
m_task_timer->Stop();
m_task_timer.reset();
}
m_file_sys->Stop(true);
m_file_sys.reset();
}
m_tcp_try_connect = true;
m_tutk_try_connect = false;
@ -1243,6 +1246,7 @@ void SendToPrinterDialog::update_show_status()
if (!agent) return;
if (!dev) return;
MachineObject* obj_ = dev->get_my_machine(m_printer_last_select);
if (!obj_) {
if (agent) {
if (agent->is_user_login()) {
@ -1252,6 +1256,9 @@ void SendToPrinterDialog::update_show_status()
return;
}
/* check cloud machine connections */
if (!obj_->is_lan_mode_printer()) {
if (!agent->is_server_connected()) {
@ -1261,7 +1268,7 @@ void SendToPrinterDialog::update_show_status()
}
}
if (!obj_->is_info_ready()) {
if (!obj_->is_info_ready() || !obj_->is_online() || !obj_->is_connected()) {
if (is_timeout()) {
show_status(PrintDialogStatus::PrintStatusReadingTimeout);
return;
@ -1313,7 +1320,7 @@ void SendToPrinterDialog::update_show_status()
m_file_sys->Stop(true);
m_file_sys.reset();
}
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect is" << m_ftp_try_connect;
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect is ok" << m_ftp_try_connect;
// add log
show_status(PrintDialogStatus::PrintStatusReadingFinished);
@ -1386,13 +1393,14 @@ void SendToPrinterDialog::update_show_status()
m_tutk_try_connect = false;
}
}
BOOST_LOG_TRIVIAL(info) << "connect failed" ;
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect is " << m_ftp_try_connect;
BOOST_LOG_TRIVIAL(info) << "m_tutk_try_connect is " << m_tutk_try_connect ;
BOOST_LOG_TRIVIAL(info) << "m_tcp_try_connect is " << m_tcp_try_connect;
BOOST_LOG_TRIVIAL(info) << "connect failed" ;
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect1 is " << m_ftp_try_connect;
BOOST_LOG_TRIVIAL(info) << "m_tutk_try_connect1 is " << m_tutk_try_connect ;
BOOST_LOG_TRIVIAL(info) << "m_tcp_try_connect1 is " << m_tcp_try_connect;
}
else
msg = _L("Please check the network and try again, You can restart or update the printer if the issue persists.");
fs->Stop();
m_connect_try_times++;
BOOST_LOG_TRIVIAL(info) << "m_connect_try_times is " << m_connect_try_times;
@ -1578,7 +1586,7 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
if (status == PrintDialogStatus::PrintStatusInit) {
update_print_status_msg(wxEmptyString, false, false);
Enable_Send_Button(false);
Enable_Refresh_Button(false);
Enable_Refresh_Button(true);
}
else if (status == PrintDialogStatus::PrintStatusInvalidPrinter) {
update_print_status_msg(wxEmptyString, true, true);