FIX: Can do switch while printing pause

jira: [STUDIO-9789]
Change-Id: I8d5d2195adcd2cd048d95303f0562f24b696e34e
This commit is contained in:
xin.zhang 2025-01-14 09:56:38 +08:00 committed by lane.wei
parent 151f40ad4d
commit f3777db02d
3 changed files with 10 additions and 2 deletions

View File

@ -2808,6 +2808,11 @@ bool MachineObject::is_in_prepare()
return print_status == "PREPARE"; return print_status == "PREPARE";
} }
bool MachineObject::is_in_printing_pause() const
{
return print_status == "PAUSE";
}
bool MachineObject::is_printing_finished() bool MachineObject::is_printing_finished()
{ {
if (print_status.compare("FINISH") == 0 if (print_status.compare("FINISH") == 0

View File

@ -1165,6 +1165,7 @@ public:
bool can_pause(); bool can_pause();
bool can_abort(); bool can_abort();
bool is_in_printing(); bool is_in_printing();
bool is_in_printing_pause() const;
bool is_in_prepare(); bool is_in_prepare();
bool is_printing_finished(); bool is_printing_finished();
bool is_core_xy(); bool is_core_xy();

View File

@ -2832,7 +2832,8 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
} }
/*enable status*/ /*enable status*/
if (obj->is_in_printing() || /* Can do switch while printing pause STUDIO-9789*/
if ((obj->is_in_printing() && !obj->is_in_printing_pause()) ||
obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE || obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE ||
targ_nozzle_id_from_pc != INVALID_NOZZLE_ID) targ_nozzle_id_from_pc != INVALID_NOZZLE_ID)
{ {
@ -4660,7 +4661,8 @@ void StatusPanel::on_nozzle_selected(wxCommandEvent &event)
{ {
if (obj) { if (obj) {
if (obj->is_in_printing() || obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) { /*Enable switch head while printing is paused STUDIO-9789*/
if ((obj->is_in_printing() && !obj->is_in_printing_pause()) || obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
MessageDialog dlg(nullptr, _L("The printer is busy on other print job"), _L("Error"), wxICON_WARNING | wxOK); MessageDialog dlg(nullptr, _L("The printer is busy on other print job"), _L("Error"), wxICON_WARNING | wxOK);
dlg.ShowModal(); dlg.ShowModal();
return; return;