package kr.co.icontrols.ilp300_700.global;

import android.content.Context;
import android.util.Log;

import java.util.ArrayList;

public final class DataClasses {
    // 로비폰에서 공통으로 사용하는 함수 및 변수를 정의합니다.
    static String TAG = "DataClasses";

    static boolean bLOG = true;   // true, false
    static boolean bLOG_DEBUG = false;   // true, false
    static boolean bLOG_INFO = true;   // true, false
    static Context mContext;

    private static void LOG(String log) {
        if (bLOG) Log.v(TAG, log);
    }

    private static void LOG_DEBUG(String log) {
        if (bLOG_DEBUG) Log.d(TAG, log);
    }

    private static void LOG_INFO(String log) {
        if (bLOG_INFO) Log.i(TAG, log);
    }

    // 세대통화 및 비밀번호 출입을 위한 클래스
    public static class RemoteIDInfo {
        public static boolean bAutoCall = false;
        public static int n1stNumforResicall = 0;
        public static String strSIPID = "";
        public static String strName = "";
        public static String strIP = "";
        public static String strDong = "";
        public static String strHo = "";
        public static int nDong = 0;
        public static int nHo = 0;
        public static boolean bRentRoomSelected = false;   // 분리세대 호출시 설정
        public static int nHo_Extension = 0;   // 분리세대 일련번호 정보 Ex) "101-1"의 "-"뒤의 "1"입력

        public static void InitVariables() {
            bAutoCall = false;
            n1stNumforResicall = 0;
            strSIPID = "";
            strName = "";
            strIP = "";
            strDong = "";
            strHo = "";
            nDong = 0;
            nHo = 0;
            bRentRoomSelected = false;
            nHo_Extension = 0;
        }

        public static void InitVariablesforResi() {
            strSIPID = "";
            strName = "";
            strIP = "";
            strDong = "";
            strHo = "";
            nDong = 0;
            nHo = 0;
            bRentRoomSelected = false;
            nHo_Extension = 0;
        }
    }

    // 좌표제공을 위한 클래스
    public static class POSITION {
        public int X;
        public int Y;
        public int W;
        public int H;

        public POSITION() {
            X = 0;
            Y = 0;
            W = 0;
            H = 0;
        }

        public void SetPosition(int x, int y, int w, int h) {
            this.X = x;
            this.Y = y;
            this.W = w;
            this.H = h;
        }
    }

    // 시스템 업그레이드 관련 클래스
    public static class SystemUpgradeInfo {
        public String strType = "";
        public int nModuleCnt = 0;
        public String strUserID = "";
        public String strPassword = "";
        public String[] aModule_Type;
        public String[] aModule_FileName;
        public String[] aModule_Path;
        public String[] aModule_FileSize;

        public void setArray() {
            aModule_Type = new String[nModuleCnt];
            aModule_FileName = new String[nModuleCnt];
            aModule_Path = new String[nModuleCnt];
            aModule_FileSize = new String[nModuleCnt];
        }
    }

    // FTP Upload 관련 클래스
    public static class FTPUploadInfo {
        public String strTargetIP = "";
        public String strUserID = "";
        public String strPassword = "";
        public String strFilePath = "";
        public String strUploadPath = "";
        public String strMessage = "";

        public void printValue() {
            LOG("[FTPUploadInfo.printValue()] strTargetIP [" + strTargetIP + "], strUserID [" + strUserID + "], strPassword [" + strPassword + "], strFilePath [" + strFilePath + "], strUploadPath [" + strUploadPath + "], strMessage [" + strMessage + "]");
        }
    }

    // MultiReader DataClasses
    public static class MultiReaderKeyInfo {
        private byte CMD = (byte) 0x00;
        private String UID = "";
        private String SN = "";
        private String Sitecode = "";
        private String Dong = "";
        private String Ho = "";
        private String KeyNo = "";
        private String IssueCnt = "";
        private byte IDType = (byte) 0x00;   // 0x00 : 입주자 카드, 0x01 : 마스터 카드, 0x02 : 방문자 카드
        private byte Direction = (byte) 0x00;   // 스마트키 출입방향

        public void setKeyInfo(byte hCMD, String sUID, String sSN, String sSitecode, String sDong, String sHo, String sKeyNo, String sIssueCnt, byte hIDType, byte hDirection) {
            CMD = hCMD;
            UID = sUID;
            SN = sSN;
            Sitecode = sSitecode;
            Dong = sDong;
            Ho = sHo;
            KeyNo = sKeyNo;
            IssueCnt = sIssueCnt;
            IDType = (byte) hIDType;
            Direction = (byte) hDirection;
        }

        public byte getCMD() {
            return CMD;
        }

        public String getUID() {
            return UID;
        }

        public String getSN() {
            return SN;
        }

        public String getSitecode() {
            return Sitecode;
        }

        public String getDong() {
            return Dong;
        }

        public String getHo() {
            return Ho;
        }

        public String getKeyNo() {
            return KeyNo;
        }

        public String getIssueCnt() {
            return IssueCnt;
        }

        public byte getIDType() {
            return IDType;
        }

        public byte getDirection() {
            return Direction;
        }

        public void printValue() {
            LOG("[MultiReaderKeyInfo.printValue()] CMD [" + getCMD() + "], UID [" + getUID() + "], SN [" + getSN() + "], Sitecode [" + getSitecode() + "], Dong [" + getDong() + "], " +
                    "Ho [" + getHo() + "], KeyNo [" + getKeyNo() + "], IssueCnt [" + getIssueCnt() + "], IDType [" + getIDType() + "], Direction [" + getDirection() + "]");
        }

        public void clear() {
            CMD = (byte) 0x00;
            UID = "";
            SN = "";
            Sitecode = "";
            Dong = "";
            Ho = "";
            KeyNo = "";
            IssueCnt = "";
            IDType = (byte) 0x00;   // 0x00 : 입주자 카드, 0x01 : 마스터 카드, 0x02 : 방문자 카드
            Direction = (byte) 0x00;   // 스마트키 출입방향
        }
    }

    // Multireader I-Park NFC Info
    public static class IPARKNFCInfo {
        private String Name = "";
        private String PhoneID = "";
        private String Password = "";

        public void setIPARKNFCInfo(String sName, String sPhoneID, String sPassword) {
            Name = sName;
            PhoneID = sPhoneID;
            Password = sPassword;
        }

        public String getNFCInfo_Name() {
            return Name;
        }

        public String getNFCInfo_PhoneID() {
            return PhoneID;
        }

        public String getNFCInfo_Password() {
            return Password;
        }

        public void clear() {
            Name = "";
            PhoneID = "";
            Password = "";
        }
    }

    // StandardReader DataClass
    public static class STDReaderKeyInfo {
        private static String Sitecode = null;
        private static String Dong = null;
        private static String Ho = null;
        private static String KeyNo = null;
        private static String IssueCnt = null;
        private static byte IDType = (byte) 0x00;   // 0x00 : 입주자 카드, 0x01 : 마스터 카드, 0x02 : 방문자 카드

        public void setInfo(String sSitecode, String sDong, String sHo, String sKeyNo, String sIssueCnt, byte hIDType) {
            Sitecode = sSitecode;
            Dong = sDong;
            Ho = sHo;
            KeyNo = sKeyNo;
            IssueCnt = sIssueCnt;
            IDType = (byte) hIDType;
        }

        public String getSitecode() {
            return Sitecode;
        }

        public String getDong() {
            return Dong;
        }

        public String getHo() {
            return Ho;
        }

        public String getKeyNo() {
            return KeyNo;
        }

        public String getIssueCnt() {
            return IssueCnt;
        }

        public byte getIDType() {
            return IDType;
        }

        public void printValue() {
            LOG("[STDReaderKeyInfo.printValue()] Sitecode [" + getSitecode() + "], Dong [" + getDong() + "], Ho [" + getHo() + "], KeyNo [" + getKeyNo() + "], IssueCnt [" + getIssueCnt() + "], IDType [" + getIDType() + "]");
        }

        public void clear() {
            Sitecode = "";
            Dong = "";
            Ho = "";
            KeyNo = "";
            IssueCnt = "";
            IDType = (byte) 0x00;   // 0x00 : 입주자 카드, 0x01 : 마스터 카드, 0x02 : 방문자 카드
        }
    }

    // 설정정보 송수신을 위한 클래스 (set_setup_info, get_setup_info)
    public static class DeviceSettingInfo {
        public boolean bValidity = false;
        public String strDeviceType = "";
        public int nModuleCnt = 0;
        public String[] aName;
        public String[] aCount;
        public String[] aValue;
        public String[] aListItem;

        public void setArray() {
            aName = new String[nModuleCnt];
            aCount = new String[nModuleCnt];
            aValue = new String[nModuleCnt];
            aListItem = new String[nModuleCnt];
        }

        public void clearClass() {
            bValidity = false;
            strDeviceType = "";
            nModuleCnt = 0;
        }
    }

    // 설정정보 송수신을 위한 클래스 (set_setup_info, get_setup_info)
    public static class DeviceSetting_LineInfo {
        public boolean bValidity = false;
        public int nLineCnt = 0;
        public String[] aName;
        public String[] aFloors;

        public void setArray() {
            aName = new String[nLineCnt];
            aFloors = new String[nLineCnt];
        }

        public void clearClass() {
            bValidity = false;
            nLineCnt = 0;
        }
    }

    // 기기의 설정정보 송수신을 위한 클래스
    public static class ConfigValueTable {
        private ArrayList<ConfigValue> ValueTable = new ArrayList<ConfigValue>();

        public void addConfigValue(String name, String cnt, String value, Object list, String etc) {
            ConfigValue NewSetupInfo = new ConfigValue(name, cnt, value, list, etc);
            ValueTable.add(NewSetupInfo);
        }

        public ConfigValue getConfigValue(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (ConfigValue) ValueTable.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < ValueTable.size(); i++) {
                LOG("[ConfigValueTable] Name [" + getConfigValue(i).NAME() + "], Count [" + getConfigValue(i).CNT() + "], Value [" + getConfigValue(i).VALUE() + "], ETC [" + getConfigValue(i).ETC() + "]");
            }
        }

        public int getCnt() {
            return ValueTable.size();
        }

        public void clearTable() {
            ValueTable.clear();
        }

        ;

        public class ConfigValue {
            private String Name = "";
            private String Cnt = "";
            private String Value = "";
            private Object List = null;
            private String ETC = "";

            public ConfigValue(String name, String cnt, String value, Object list, String etc) {
                Name = name;
                Cnt = cnt;
                Value = value;
                List = list;
                ETC = etc;
            }

            public String NAME() {
                return Name;
            }

            public String CNT() {
                return Cnt;
            }

            public String VALUE() {
                return Value;
            }

            public Object LIST() {
                return List;
            }

            public String ETC() {
                return ETC;
            }
        }
    }

    // 라인정보를 다루기 위한 클래스
    public static class LineInfoTable {
        private ArrayList<LineInfo> LineTable = new ArrayList<LineInfo>();

        public void addLineTable(int name, int low, int high, String etc) {
            LineInfo NewLineTable = new LineInfo(name, low, high, etc);
            LineTable.add(NewLineTable);
        }

        public LineInfo getLineInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (LineInfo) LineTable.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < LineTable.size(); i++) {
                LOG("[LineInfoTable] Name [" + getLineInfo(i).NAME() + "], Low [" + getLineInfo(i).LOW() + "], High [" + getLineInfo(i).HIGH() + "], ETC [" + getLineInfo(i).ETC() + "]");
            }
        }

        public int getCnt() {
            return LineTable.size();
        }

        public void clearTable() {
            LineTable.clear();
        }

        ;

        public class LineInfo {
            private int Name = 0;
            private int Low = 0;
            private int High = 0;
            private String ETC = "";

            public LineInfo(int name, int low, int high, String etc) {
                Name = name;
                Low = low;
                High = high;
                ETC = etc;
            }

            public int NAME() {
                return Name;
            }

            public int LOW() {
                return Low;
            }

            public int HIGH() {
                return High;
            }

            public String ETC() {
                return ETC;
            }
        }
    }

    // 서브로비폰 정보를 다루기 위한 클래스
    public static class SubInfoTable {
        private ArrayList<SubInfo> SubTable = new ArrayList<SubInfo>();

        public void addSubTable(int id, String ip, String etc) {
            SubInfo NewSubTable = new SubInfo(id, ip, etc);
            SubTable.add(NewSubTable);
        }

        public SubInfo getSubInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (SubInfo) SubTable.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < SubTable.size(); i++) {
                LOG("[SubInfoTable] ID [" + getSubInfo(i).ID() + "], IP [" + getSubInfo(i).IP() + "], ETC [" + getSubInfo(i).ETC() + "]");
            }
        }

        public int getCnt() {
            return SubTable.size();
        }

        public void clearTable() {
            SubTable.clear();
        }

        ;

        public class SubInfo {
            private int ID = 0;
            private String IP = "";
            private String ETC = "";

            public SubInfo(int id, String ip, String etc) {
                ID = id;
                IP = ip;
                ETC = etc;
            }

            public int ID() {
                return ID;
            }

            public String IP() {
                return IP;
            }

            public String ETC() {
                return ETC;
            }
        }
    }

    // 엘리베이터 비연동층 정보를 다루기 위한 클래스
    public static class ElevDisableFloorTable {
        private ArrayList<ElevDisableFloor> ElevDisableTable = new ArrayList<ElevDisableFloor>();

        public void addElevDisableFloorTable(int floor, String etc) {
            ElevDisableFloor NewElevDisableFloorTable = new ElevDisableFloor(floor, etc);
            ElevDisableTable.add(NewElevDisableFloorTable);
        }

        public ElevDisableFloor getElevDisableInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (ElevDisableFloor) ElevDisableTable.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < ElevDisableTable.size(); i++) {
                LOG("[ElevDisableFloorTable] Floor [" + getElevDisableInfo(i).FLOOR() + "], ETC [" + getElevDisableInfo(i).ETC() + "]");
            }
        }

        public int getCnt() {
            return ElevDisableTable.size();
        }

        public void clearTable() {
            ElevDisableTable.clear();
        }

        ;

        public class ElevDisableFloor {
            private int Floor = 0;
            private String ETC = "";

            public ElevDisableFloor(int floor, String etc) {
                Floor = floor;
                ETC = etc;
            }

            public int FLOOR() {
                return Floor;
            }

            public String ETC() {
                return ETC;
            }
        }
    }

    // 경비실 목록을 관리하기 위한 클래스
    public static class GuardListTable {
        private ArrayList<GuardList> GuardTable = new ArrayList<GuardList>();

        public void addGuardTable(String name, String value, String etc) {
            GuardList NewGuardTable = new GuardList(name, value, etc);
            GuardTable.add(NewGuardTable);
        }

        public GuardList getGuardInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (GuardList) GuardTable.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < GuardTable.size(); i++) {
                LOG("[GuardListTable] Name [" + getGuardInfo(i).NAME() + "], Value [" + getGuardInfo(i).VALUE() + "], ETC [" + getGuardInfo(i).ETC() + "]");
            }
        }

        public int getCnt() {
            return GuardTable.size();
        }

        public void clearTable() {
            GuardTable.clear();
        }

        ;

        public class GuardList {
            private String Name = "";
            private String Value = "";
            private String ETC = "";

            public GuardList(String name, String value, String etc) {
                Name = name;
                Value = value;
                ETC = etc;
            }

            public String NAME() {
                return Name;
            }

            public String VALUE() {
                return Value;
            }

            public String ETC() {
                return ETC;
            }
        }
    }

    // 로비폰 출입내역 송신을 위한 클래스 (save_lobby_access)
    public static class AccessInfo_STD {
        private String strAction = "";
        private String strTryby = "";
        private String strWhereFrom = "";
        private String strMCardInfo = "";
        private String strMCnt = "";
        private String strHCardInfo = "";
        private String strDong = "";
        private String strHo = "";
        private String strHNo = "";
        private String strHCnt = "";
        private String strMessage = "";
        private String strAdd = "";

        public void setValue(String sAction, String sTryby, String sWhereFrom, String sMCardInfo, String sMCnt, String sHCardInfo, String sDong, String sHo, String sHNo, String sHCnt, String sMessage, String sAdd) {
            strAction = sAction;
            strTryby = sTryby;
            strWhereFrom = sWhereFrom;
            strMCardInfo = sMCardInfo;
            strMCnt = sMCnt;
            strHCardInfo = sHCardInfo;
            strDong = sDong;
            strHo = sHo;
            strHNo = sHNo;
            strHCnt = sHCnt;
            strMessage = sMessage;
            strAdd = sAdd;
        }

        public String getAction() {
            return strAction;
        }

        public String getTryby() {
            return strTryby;
        }

        public String getWhereFrom() {
            return strWhereFrom;
        }

        public String getMCardInfo() {
            return strMCardInfo;
        }

        public String getMCnt() {
            return strMCnt;
        }

        public String getHCardInfo() {
            return strHCardInfo;
        }

        public String getDong() {
            return strDong;
        }

        public String getHo() {
            return strHo;
        }

        public String getHNo() {
            return strHNo;
        }

        public String getHCnt() {
            return strHCnt;
        }

        public String getMessage() {
            return strMessage;
        }

        public String getAdd() {
            return strAdd;
        }
    }

    // 로비폰 출입내역 송신을 위한 클래스 (save_vcard_access)
    public static class AccessInfo_V {
        private String strAction = "";
        private String strDistinct = "";
        private String strID_High = "";
        private String strID_Low = "";
        private String strVIDNo = "";
        private String strVIDCnt = "";
        private String strMessage = "";

        public void setValue(String sAction, String sDistinct, String sID_High, String sID_Low, String sVIDNo, String sVIDCnt, String sMessage) {
            strAction = sAction;
            strDistinct = sDistinct;
            strID_High = sID_High;
            strID_Low = sID_Low;
            strVIDNo = sVIDNo;
            strVIDCnt = sVIDCnt;
            strMessage = sMessage;
        }

        public String getAction() {
            return strAction;
        }

        public String getDistinct() {
            return strDistinct;
        }

        public String getID_High() {
            return strID_High;
        }

        public String getID_Low() {
            return strID_Low;
        }

        public String getVIDNo() {
            return strVIDNo;
        }

        public String getVIDCnt() {
            return strVIDCnt;
        }

        public String getMessage() {
            return strMessage;
        }
    }

    // 로비폰 출입내역 송신을 위한 클래스 (save_uidcard_access)
    public static class AccessInfo_UID {
        private String strAction = "";
        private String strDistinct = "";
        private String strID_High = "";
        private String strID_Low = "";
        private String strCardType = "";
        private String strSN = "";
        private String strUID = "";
        private String strMessage = "";

        public void setValue(String sAction, String sDistinct, String sID_High, String sID_Low, String sCardType, String sSN, String sUID, String sMessage) {
            strAction = sAction;
            strDistinct = sDistinct;
            strID_High = sID_High;
            strID_Low = sID_Low;
            strCardType = sCardType;
            strSN = sSN;
            strUID = sUID;
            strMessage = sMessage;
        }

        public String getAction() {
            return strAction;
        }

        public String getDistinct() {
            return strDistinct;
        }

        public String getID_High() {
            return strID_High;
        }

        public String getID_Low() {
            return strID_Low;
        }

        public String getCardType() {
            return strCardType;
        }

        public String getSN() {
            return strSN;
        }

        public String getUID() {
            return strUID;
        }

        public String getMessage() {
            return strMessage;
        }

    }

    // UID Key 저장을 위한 클래스
    public static class AccessKeyInfo {
        private String strSitecode = "";
        private String strDong = "";
        private String strHo = "";
        private String strKeyType = "";
        private String strUID = "";
        private String strCID = "";
        private String strSN = "";
        private String strKeyNo = "";
        private String strIssueCnt = "";
        private String strIssuedDate = "";
        private String strExpireDate = "";
        private String strLastUseDate = "";
        private String strName = "";
        private String strMessage = "";
        private String strETC = "";

        public void setValue(String sSitecode, String sDong, String sHo, String sKeyType, String sUID, String sCID, String sSN, String sKeyNo, String sIssueCnt,
                             String sIssuedDate, String sExpireDate, String sLastUseDate, String sName, String sMessage, String sETC) {
            strSitecode = sSitecode;
            strDong = sDong;
            strHo = sHo;
            strKeyType = sKeyType;
            strUID = sUID;
            strCID = sCID;
            strSN = sSN;
            strKeyNo = sKeyNo;
            strIssueCnt = sIssueCnt;
            strIssuedDate = sIssuedDate;
            strExpireDate = sExpireDate;
            strLastUseDate = sLastUseDate;
            strName = sName;
            strMessage = sMessage;
            strETC = sETC;
        }

        public String getSitecode() {
            return strSitecode;
        }

        public String getDong() {
            return strDong;
        }

        public String getHo() {
            return strHo;
        }

        public String getKeyType() {
            return strKeyType;
        }

        public String getUID() {
            return strUID;
        }

        public String getCID() {
            return strCID;
        }

        public String getSN() {
            return strSN;
        }

        public String getKeyNo() {
            return strKeyNo;
        }

        public String getIssueCnt() {
            return strIssueCnt;
        }

        public String getIssuedDate() {
            return strIssuedDate;
        }

        public String getExpireDate() {
            return strExpireDate;
        }

        public String getLastUseDate() {
            return strLastUseDate;
        }

        public String getName() {
            return strMessage;
        }

        public String getMessage() {
            return strMessage;
        }

        public String getETC() {
            return strETC;
        }

        public String[] getValueArray() {
            return new String[]{strUID, strKeyType, strUID, strCID, strSN, strSitecode, strDong, strHo, strKeyNo, strIssueCnt, strIssuedDate, strExpireDate, strLastUseDate, strName, strMessage, strETC};
        }

        public void printValue() {
            LOG("[AccessKeyInfo.printValue()] strUID [" + strUID + "], strKeyType [" + strKeyType + "], strUID [" + strUID + "], strCID [" + strCID + "], strSN [" + strSN + "], " +
                    "strSitecode [" + strSitecode + "], strDong [" + strDong + "], strHo [" + strHo + "], strKeyNo [" + strKeyNo + "], strKeyType [" + strKeyType + "], " +
                    "strIssueCnt [" + strIssueCnt + "], strIssuedDate [" + strIssuedDate + "], strExpireDate [" + strExpireDate + "], strLastUseDate [" + strLastUseDate + "], " +
                    "strName [" + strName + "], strMessage [" + strMessage + "], strETC [" + strETC + "]");
        }

        public void clear() {
            strSitecode = "";
            strDong = "";
            strHo = "";
            strKeyType = "";
            strUID = "";
            strCID = "";
            strSN = "";
            strKeyNo = "";
            strIssueCnt = "";
            strIssuedDate = "";
            strExpireDate = "";
            strLastUseDate = "";
            strName = "";
            strMessage = "";
            strETC = "";
        }
    }

    // iMAP 프로토콜에서 출입키 정보를 다루기 위한 카드정보 테이블
    public static class AccessKeyInfoTable {
        private ArrayList<KeyInfo> AccessKeyTables = new ArrayList<KeyInfo>();

        public void addKeyInfo(String sIndex, String sSN, String sUID, String sType, String sSiteCode, String sDong, String sHo, String sKeyNum, String sIssueCnt, String sIssuedDate, String sLastUseDate, String sMessage) {
            KeyInfo NewKeyInfo = new KeyInfo(sIndex, sSN, sUID, sType, sSiteCode, sDong, sHo, sKeyNum, sIssueCnt, sIssuedDate, sLastUseDate, sMessage);
            AccessKeyTables.add(NewKeyInfo);
        }

        public KeyInfo getKeyInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (KeyInfo) AccessKeyTables.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < AccessKeyTables.size(); i++) {
                LOG("[AccessKeyInfoTable] Index [" + getKeyInfo(i).getIndex() + "], SN [" + getKeyInfo(i).getSN() + "], UID [" + getKeyInfo(i).getUID() + "], Type [" + getKeyInfo(i).getType() + "], " +
                        "SiteCode [" + getKeyInfo(i).getSitecode() + "], Dong [" + getKeyInfo(i).getDong() + "], Ho [" + getKeyInfo(i).getHo() + "], KeyNum [" + getKeyInfo(i).getKeyNo() + "], " +
                        "IssueCnt [" + getKeyInfo(i).getIssueCnt() + "], IssuedDate [" + getKeyInfo(i).getIssuedDate() + "], LastUseDate [" + getKeyInfo(i).getLastUseDate() + "], " +
                        "Message [" + getKeyInfo(i).getMessage() + "]");
            }
        }

        public int getCnt() {
            return AccessKeyTables.size();
        }

        public void clearTable() {
            AccessKeyTables.clear();
        }

        public class KeyInfo {
            private String strIndex = "";
            private String strSN = "";
            private String strUID = "";
            private String strType = "";
            private String strSiteCode = "";
            private String strDong = "";
            private String strHo = "";
            private String strKeyNum = "";
            private String strIssueCnt = "";
            private String strIssuedDate = "";
            private String strLastUseDate = "";
            private String strMessage = "";

            public KeyInfo(String sIndex, String sSN, String sUID, String sType, String sSiteCode, String sDong, String sHo, String sKeyNum, String sIssueCnt, String sIssuedDate, String sLastUseDate, String sMessage) {
                strIndex = sIndex;
                strSN = sSN;
                strUID = sUID;
                strType = sType;
                strSiteCode = sSiteCode;
                strDong = sDong;
                strHo = sHo;
                strKeyNum = sKeyNum;
                strIssueCnt = sIssueCnt;
                strIssuedDate = sIssuedDate;
                strLastUseDate = sLastUseDate;
                strMessage = sMessage;
            }

            public String getIndex() {
                return strIndex;
            }

            public String getSN() {
                return strSN;
            }

            public String getUID() {
                return strUID;
            }

            public String getType() {
                return strType;
            }

            public String getSitecode() {
                return strSiteCode;
            }

            public String getDong() {
                return strDong;
            }

            public String getHo() {
                return strHo;
            }

            public String getKeyNo() {
                return strKeyNum;
            }

            public String getIssueCnt() {
                return strIssueCnt;
            }

            public String getIssuedDate() {
                return strIssuedDate;
            }

            public String getLastUseDate() {
                return strLastUseDate;
            }

            public String getMessage() {
                return strMessage;
            }
        }
    }

    // 원패스 정보를 전송하기 위한 정보 테이블
    public static class OnePassInfoTable {
        private ArrayList<OnePassInfo> OnePassTables = new ArrayList<OnePassInfo>();

        public void addOnePassInfo(String sIndex, String sAction, String sWallPadIP, String sDong, String sHo, String sName, String sMessage) {
            OnePassInfo NewOnePassInfo = new OnePassInfo(sIndex, sAction, sWallPadIP, sDong, sHo, sName, sMessage);
            OnePassTables.add(NewOnePassInfo);
        }

        public OnePassInfo getOnePassInfo(int nIndex) {
            if (getCnt() < nIndex) return null;
            return (OnePassInfo) OnePassTables.get(nIndex);
        }

        public void printValue() {
            for (int i = 0; i < OnePassTables.size(); i++) {
                Log.v(TAG, "[OnePassTables] Index [" + getOnePassInfo(i).getIndex() + "], Action [" + getOnePassInfo(i).getAction() + "], WallPadIP [" + getOnePassInfo(i).getWallPadIP() + "], " +
                                                 "Dong [" + getOnePassInfo(i).getDong() + "], Ho [" + getOnePassInfo(i).getHo() + "], Name [" + getOnePassInfo(i).getName() + "], Message [" + getOnePassInfo(i).getMessage() + "]");
            }
        }

        public int getCnt() {
            return OnePassTables.size();
        }

        public void clearTable() {
            OnePassTables.clear();
        }

        public class OnePassInfo {
            private String strIndex = "";
            private String strActoin = "";
            private String strWallPadIP = "";
            private String strDong = "";
            private String strHo = "";
            private String strName = "";
            private String strMessage = "";

            public OnePassInfo(String index, String action, String wallpadip, String dong, String ho, String name, String msg) {
                strIndex = index;
                strActoin = action;
                strWallPadIP = wallpadip;
                strDong = dong;
                strHo = ho;
                strName = name;
                strMessage = msg;
            }

            public String getIndex() {
                return strIndex;
            }

            public String getAction() {
                return strActoin;
            }

            public String getWallPadIP() {
                return strWallPadIP;
            }

            public String getDong() {
                return strDong;
            }

            public String getHo() {
                return strHo;
            }

            public String getName() {
                return strName;
            }

            public String getMessage() {
                return strMessage;
            }
        }
    }



}