| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- // ReceiptSnbc.cpp: implementation of the ReceiptSnbc class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "ReceiptSnbc.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- ReceiptSnbc::ReceiptSnbc()
- {
- }
- ReceiptSnbc::~ReceiptSnbc()
- {
- }
- //打印机初始化
- int ReceiptSnbc::Init()
- {
- int iRet = ReceiptBase::Init();
- if (iRet != 0) return iRet;
- unsigned char szSendBuf[20];
- szSendBuf[0] = 0x1d;
- szSendBuf[1] = 0x45;
- szSendBuf[2] = 0x20;//打印低速20,中速10,高速 00
- SendData(szSendBuf,3,3000);
- szSendBuf[0] = 0x1d;
- szSendBuf[1] = 0x28;
- szSendBuf[2] = 0x4b;//
- szSendBuf[3] = 0x02;//
- szSendBuf[4] = 0x00;//
- szSendBuf[5] = 0x31;//
- szSendBuf[6] = 6; //清晰度,-6->6 数字越高越清晰
- //新北洋位-6 至 6,证通为 0 至 14
- SendData(szSendBuf,7,3000);
- SetPrintArea(640);
- return RECEIPT_SUCCESS;
- }
- int ReceiptSnbc::GetStateData(const char* sCmd1, const char* sCmd2, const char* sCmd3, const char* sCmd4)
- {
- if(sCmd2[1] == '1' || sCmd3[4]=='1') //打印机故障
- return RECEIPT_ERR_DEV_ERR;
- if(sCmd2[5] == '1') //打印机头抬起
- return RECEIPT_WARN_HEAD_UP;
- if(sCmd4[7] == '1') //卡纸
- return RECEIPT_WARN_JAMMED;
- if(sCmd4[2] == '1') //缺纸
- return RECEIPT_WARN_NO_MEDIA;
- if(sCmd4[4] == '1') //纸将尽
- return RECEIPT_WARN_PAP_LOW;
- return RECEIPT_SUCCESS;
- }
|