From c17cc8898ac1068a3796c93cbda00104756db52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AD=90=E6=98=8E?= Date: Sat, 5 Oct 2024 17:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8E=E5=A2=A8=E9=87=8F=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张子明 --- services/print_service/src/print_cups_client.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/print_service/src/print_cups_client.cpp b/services/print_service/src/print_cups_client.cpp index 7160245..7fac53f 100644 --- a/services/print_service/src/print_cups_client.cpp +++ b/services/print_service/src/print_cups_client.cpp @@ -91,10 +91,12 @@ static const std::string PRINTER_STATE_IGNORE_BUSY_MISSING_JOB_STATE_COMPLETED = static const std::string PRINTER_STATE_IGNORE_BUSY_WAITING_COMPLETE_OTHER_REPORT = "cups-waiting-for-job-completed,other-report"; static const std::string PRINTER_STATE_IGNORE_BUSY_OTHER_REPORT = "other-report"; +static const std::string PRINTER_STATE_IGNORE_MARKER_LOW_WARNING = "marker-supply-low-warning"; +static const std::string PRINTER_STATE_IGNORE_MEDIA_EMPTY_WARNING = + "cups-waiting-for-job-completed,media-empty-warning,media-needed"; static const std::string PRINTER_STATE_NONE = "none"; static const std::string PRINTER_STATE_EMPTY = ""; static const std::string PRINTER_STATE_MEDIA_EMPTY = "media-empty"; -static const std::string PRINTER_STATE_MEDIA_EMPTY_WARNING = "media-empty-warning"; static const std::string PRINTER_STATE_MEDIA_JAM = "media-jam"; static const std::string PRINTER_STATE_PAUSED = "paused"; static const std::string PRINTER_STATE_TONER_LOW = "toner-low"; @@ -122,7 +124,9 @@ static const std::vector IGNORE_STATE_LIST = {PRINTER_STATE_WAITING PRINTER_STATE_IGNORE_BUSY_MISSING_JOB_STATE, PRINTER_STATE_IGNORE_BUSY_MISSING_JOB_STATE_COMPLETED, PRINTER_STATE_IGNORE_BUSY_WAITING_COMPLETE_OTHER_REPORT, - PRINTER_STATE_IGNORE_BUSY_OTHER_REPORT}; + PRINTER_STATE_IGNORE_BUSY_OTHER_REPORT, + PRINTER_STATE_IGNORE_MARKER_LOW_WARNING, + PRINTER_STATE_IGNORE_MEDIA_EMPTY_WARNING}; std::mutex jobMutex; static std::vector usbPrinters; @@ -1312,10 +1316,7 @@ void PrintCupsClient::ReportBlockedReason(JobMonitorParam *param, JobStatus *job } uint32_t substate = GetBlockedSubstate(jobStatus); - if (strstr(jobStatus->printer_state_reasons, PRINTER_STATE_MEDIA_EMPTY_WARNING.c_str()) != NULL) { - param->serviceAbility->UpdatePrintJobState(param->serviceJobId, PRINT_JOB_RUNNING, - PRINT_JOB_BLOCKED_BUSY); - } else if (substate > PRINT_JOB_COMPLETED_SUCCESS) { + if (substate > PRINT_JOB_COMPLETED_SUCCESS) { param->serviceAbility->UpdatePrintJobState(param->serviceJobId, PRINT_JOB_BLOCKED, substate); } else if (strstr(jobStatus->printer_state_reasons, PRINTER_STATE_MEDIA_NEEDED.c_str()) != NULL) {