FIX: Can do switch while printing pause

jira: [STUDIO-9789]
Change-Id: I8d5d2195adcd2cd048d95303f0562f24b696e34e
(cherry picked from commit f3777db02d1ae61ff2ad996bf1dbb6c3aba8a1c3)
This commit is contained in:
xin.zhang 2025-01-14 09:56:38 +08:00 committed by Noisyfox
parent 046685c626
commit c2a91c613d
3 changed files with 10 additions and 2 deletions

View file

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

View file

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

View file

@ -2859,7 +2859,8 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
}
/*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 ||
targ_nozzle_id_from_pc != INVALID_NOZZLE_ID)
{
@ -4745,7 +4746,8 @@ void StatusPanel::on_nozzle_selected(wxCommandEvent &event)
{
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);
dlg.ShowModal();
return;