dnpds40: Add a media database for legacy models

So we can calculate a proper "prints remaining" percentage on printers
that don't support the mqty_default command.
This commit is contained in:
Solomon Peachy 2016-08-18 00:12:35 -04:00
parent 41f5f688f7
commit a0c6637dba
1 changed files with 51 additions and 3 deletions

View File

@ -691,9 +691,57 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
ctx->media_count_new -= ctx->mediaoffset;
}
} else {
// XXX look it up based on printer and media.
ctx->media_count_new = 0;
// DS40, DS80/DS80D, RX1
/* Look it up for legacy models & FW */
switch (ctx->type) {
case P_DNP_DS40:
switch (ctx->media) {
case 200: // L
ctx->media_count_new = 460;
break;
case 210: // 2L
ctx->media_count_new = 230;
break;
case 300: // PC
ctx->media_count_new = 400;
break;
case 310: // A5
ctx->media_count_new = 200;
break;
case 400: // A5W
ctx->media_count_new = 180;
break;
default:
ctx->media_count_new = 0;
}
break;
case P_DNP_DSRX1:
switch (ctx->media) {
case 300: // PC
ctx->media_count_new = 700;
break;
case 310: // A5
ctx->media_count_new = 350;
break;
default:
ctx->media_count_new = 0;
}
break;
case P_DNP_DS80:
case P_DNP_DS80D:
switch (ctx->media) {
case 500: // 8x10
ctx->media_count_new = 130;
case 510: // 8x12
ctx->media_count_new = 110;
break;
default:
ctx->media_count_new = 0;
}
break;
default:
ctx->media_count_new = 0;
break;
}
}
}