dnpcitizen: Respect the job's BUFFCNTRL setting.
If it's not supplied, default to on if possible
This commit is contained in:
parent
bdf38b874b
commit
581602539f
|
@ -58,6 +58,7 @@ struct dnpds40_printjob {
|
|||
int fullcut;
|
||||
int printspeed;
|
||||
int can_rewind;
|
||||
int buffcntrl;
|
||||
|
||||
int buf_needed;
|
||||
int cut_paper;
|
||||
|
@ -1581,6 +1582,7 @@ static int dnpds40_read_parse(void *vctx, const void **vjob, int data_fd, int co
|
|||
memset(job, 0, sizeof(*job));
|
||||
job->common.jobsize = sizeof(*job);
|
||||
job->printspeed = -1;
|
||||
job->buffcntrl = -1;
|
||||
|
||||
/* There's no way to figure out the total job length in advance, we
|
||||
have to parse the stream until we get to the image plane data,
|
||||
|
@ -1713,8 +1715,8 @@ static int dnpds40_read_parse(void *vctx, const void **vjob, int data_fd, int co
|
|||
continue;
|
||||
}
|
||||
if(!memcmp("CNTRL BUFFCNTRL", job->databuf + job->datalen+2, 15)) {
|
||||
/* Ignore this. We will insert our own later on
|
||||
if the printer and job support it. */
|
||||
memcpy(buf, job->databuf + job->datalen + 32, 8);
|
||||
job->buffcntrl = atoi(buf);
|
||||
continue;
|
||||
}
|
||||
if(!memcmp("CNTRL OVERCOAT", job->databuf + job->datalen+2, 14)) {
|
||||
|
@ -2518,19 +2520,34 @@ top:
|
|||
if (!manual_copies || ctx->pano)
|
||||
copies = 1;
|
||||
|
||||
/* Enable job resumption on correctable errors */
|
||||
if (ctx->supports_matte && !ctx->pano) {
|
||||
snprintf(buf, sizeof(buf), "%08d", 1);
|
||||
/* DS80D does not support BUFFCNTRL when using
|
||||
cut media; all others support this */
|
||||
if (ctx->conn->type != P_DNP_DS80D ||
|
||||
multicut < 100) {
|
||||
/* Job resumption on correctable errors */
|
||||
{
|
||||
int en = job->buffcntrl;
|
||||
if (!ctx->supports_matte)
|
||||
en = 0; /* Disable if the printer doesn't support matte overcoat */
|
||||
else if (ctx->pano)
|
||||
en = 0; /* Disable recovery for any pano operation */
|
||||
else if (ctx->conn->type == P_DNP_DS80D && multicut >= 100)
|
||||
en = 0; /* DS80D does not support this for sheet media */
|
||||
else if (en == -1)
|
||||
en = 1;
|
||||
|
||||
if (en) {
|
||||
snprintf(buf, sizeof(buf), "%08d", en);
|
||||
dnpds40_build_cmd(&cmd, "CNTRL", "BUFFCNTRL", 8);
|
||||
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)buf, 8)))
|
||||
return CUPS_BACKEND_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Tell printer to not retain anything */
|
||||
snprintf(buf, sizeof(buf), "%08d", 0);
|
||||
dnpds40_build_cmd(&cmd, "CNTRL", "RETENTION", 8);
|
||||
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)buf, 8)))
|
||||
return CUPS_BACKEND_FAILED;
|
||||
#endif
|
||||
|
||||
/* Set overcoat parameters if appropriate */
|
||||
if (ctx->supports_matte && ctx->partialmatte != 2) {
|
||||
snprintf(buf, sizeof(buf), "%08d", job->matte);
|
||||
|
|
Loading…
Reference in a new issue