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 EScannerHwDevException {
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     * <div class="zh"> 服务不可用 </div> <div class="en"> service not available </div>
044     */
045    SERVICE_NOT_AVAILABLE(1, "service not available", "服务不可用"),
046    /**
047     * <div class="zh"> 无模块错误</div> <div class="en"> No module error </div>
048     */
049    SCANNER_HW_ERR_NO_MODULE(2, "No module error", "无模块错误"),
050    /**
051     * <div class="zh"> 执行错误</div> <div class="en"> Execution error </div>
052     */
053    SCANNER_HW_ERR_EXECUTE(3, "Execution error", "执行错误"),
054    /**
055     * <div class="zh"> 执行超时 </div> <div class="en"> Execution timeout </div>
056     */
057    SCANNER_HW_ERR_OUT_OF_TIME(4, "Execution timeout", "执行超时"),
058    /**
059     * <div class="zh"> 解码触发信号发送失败 </div> <div class="en"> Decoding trigger signal transmission failure</div>
060     */
061    SCANNER_HW_ERR_SEND_SIGNAL(5, "Decoding trigger signal transmission failure", "解码触发信号发送失败"),
062    /**
063     * <div class="zh"> 解码串口设备通讯失败 </div> <div class="en"> Communication failure of decoding serial device </div>
064     */
065    SCANNER_HW_ERR_COMMUNICATION(6, "Communication failure of decoding serial device", "解码串口设备通讯失败"),
066    /**
067     * <div class="zh">用户停止扫描操作 </div> <div class="en"> User Stops Scanning Operation </div>
068     */
069    SCANNER_HW_ERR_USER_STOP_OP(7, "User Stops Scanning Operation", "用户停止扫描操作"),
070    /**
071     * <div class="zh">扫描头已休眠 </div> <div class="en"> The scanner is sleeped </div>
072     */
073    SCANNER_HW_ERR_SCAN_SLEEP(8, "The scanner is sleeped", "扫描头已休眠"),;
074
075    private int errCodeFromBasement;
076    private String errMsgCn;
077    private String errMsgEn;
078
079    private EScannerHwDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
080        this.errCodeFromBasement = errCodeFromBasement;
081        this.errMsgCn = errMsnCn;
082        this.errMsgEn = errMsgEn;
083    }
084
085    public int getErrCodeFromBasement() {
086        return errCodeFromBasement;
087    }
088
089    public String getErrMsg() {
090        if (Utils.isZh()) {
091            return errMsgCn;
092        } else {
093            return errMsgEn;
094        }
095    }
096}