001 /* 002 * =========================================================================================== 003 * = COPYRIGHT 004 * PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION 005 * This software is supplied under the terms of a license agreement or nondisclosure 006 * agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or 007 * disclosed except in accordance with the terms in that agreement. 008 * Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved. 009 * Description: // Detail description about the function of this module, 010 * // interfaces with the other modules, and dependencies. 011 * Revision History: 012 * Date Author Action 013 * 2017/04/01 PAX Create/Add/Modify/Delete 014 * =========================================================================================== 015 */ 016 017package com.pax.dal.exceptions; 018 019import com.pax.dal.utils.Utils; 020 021public enum EPrintDevException { 022 /** 023 * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div> 024 */ 025 DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"), 026 /** 027 * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div> 028 */ 029 DEVICES_ERR_INVALID_ARGUMENT(98, "invalid argument error", "参数错误"), 030 /** 031 * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div> 032 */ 033 DEVICES_ERR_CONNECT(99, "connect error", "RPC I/O 连接异常"), 034 /** 035 * <div class="zh"> 不支持 </div> <div class="en"> not support error </div> 036 */ 037 DEVICES_ERR_NO_SUPPORT(100, "not support error", "不支持"), 038 /** 039 * <div class="zh"> 无权限异常</div> <div class="en"> no permission error </div> 040 */ 041 DEVICES_ERR_NO_PERMISSION(101, "no permission error", "无权限异常"), 042 043 /** 044 * <div class="zh"> 模块被禁用 </div> <div class="en"> module disabled </div> 045 */ 046 ERROR_DISABLED(102, "module disabled", "模块被禁用"), 047 048 /** 049 * <div class="zh"> 不在白名单中 </div> <div class="en"> not in whiteList </div> 050 */ 051 ERROR_NOT_IN_WHITELIST(103,"not in whiteList","不在白名单中"), 052 053 /** 054 * <div class="zh"> 打印机忙 </div> <div class="en"> Printer busy </div> 055 */ 056 PRINTER_ERR_BUSY(1, "busy error", "打印机忙"), 057 /** 058 * <div class="zh"> 打印机缺纸 </div> <div class="en"> Out of paper </div> 059 */ 060 PRINTER_ERR_OUT_OF_PAPER(2, "out of paper error", " 打印机缺纸"), 061 /** 062 * <div class="zh"> 打印数据包格式错 </div> <div class="en"> The format of print data packet error </div> 063 */ 064 PRINTER_ERR_DATA_PACKET_ERROR(3, "data packet error", "打印数据包格式错"), 065 /** 066 * <div class="zh"> 打印机故障 </div> <div class="en"> Printer problems </div> 067 */ 068 PRINTER_ERR_PRINTER_PROBLEMS(4, "printer error", "打印机故障"), 069 /** 070 * <div class="zh"> 打印机过热 </div> <div class="en"> Printer over heating </div> 071 */ 072 PRINTER_ERR_PRINTER_OVER_HEATING(5, "printer over heating", " 打印机过热"), 073 /** 074 * <div class="zh"> 打印未完成 </div> <div class="en"> Print unfinished </div> 075 */ 076 PRINTER_ERR_PRINT_UNFINISHED(6, "print unfinished error", "打印未完成"), 077 /** 078 * <div class="zh"> 打印机未装字库 </div> <div class="en"> Lack of font </div> 079 */ 080 PRINTER_ERR_LACK_OF_FONT(7, "lack of font error", "打印机未装字库"), 081 /** 082 * <div class="zh"> 数据包过长 </div> <div class="en"> Package too long </div> 083 */ 084 PRINTER_ERR_TOO_LONG(8, "too long error", "数据包过长"), 085 /** 086 * <div class="zh"> 打印机电压过低 </div> <div class="en"> voltage is too low </div> 087 */ 088 PRINTER_ERR_VOLTAGE_TOO_LOW(9, "voltage is too low", "打印机电压过低"), 089 090 /** 091 * <div class="zh"> 切纸异常 </div> <div class="en"> cut paper error </div> 092 */ 093 PRINTER_ERR_CUT_PAPER(10, "cut paper error", "切纸异常"), // Neptune添加,处理非0返回值。 094 095 // 20180605添加posapi bug 值:-5,-6,97,21,16, 096 /** 097 * <div class="zh">开盖错误(支持E500 E800) </div> <div class="en"> cover open error </div> 098 */ 099 PRINTER_ERR_COVER_OPEN(11, "cover open error", "开盖错误(支持E500 E800)"), 100 /** 101 * <div class="zh">切刀异常(支持E500 E800)</div> <div class="en">cut jam error</div> 102 */ 103 PRINTER_ERR_CUTTER_JAM(12, "cut jam error", "切刀异常(支持E500 E800)"), 104 /** 105 * <div class="zh">不支持的编码 </div> <div class="en">unsupported encoding error</div> 106 */ 107 PRINTER_ERR_UNSUPPORTED_ENCODING(13, "unsupported encoding error", "不支持的编码"), 108 /** 109 * <div class="zh">字体文件名错误 </div> <div class="en"> font file format error </div> 110 */ 111 PRINTER_ERR_FONT_FORMAT_ERR(14, "font file format error", "字体文件名错误"), 112 /** 113 * <div class="zh">字体不存在 </div> <div class="en">font not exist error </div> 114 */ 115 PRINTER_ERR_FONT_NOT_EXIST(15, "font not exist error", "字体不存在"), 116 117 ; 118 private int errCodeFromBasement; 119 private String errMsgCn; 120 private String errMsgEn; 121 122 private EPrintDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) { 123 this.errCodeFromBasement = errCodeFromBasement; 124 this.errMsgCn = errMsnCn; 125 this.errMsgEn = errMsgEn; 126 } 127 128 public int getErrCodeFromBasement() { 129 return errCodeFromBasement; 130 } 131 132 public String getErrMsg() { 133 if (Utils.isZh()) { 134 return errMsgCn; 135 } else { 136 return errMsgEn; 137 } 138 139 } 140 141}