Ejemplo n.º 1
0
        public static PARAM_ReaderEventNotificationData FromXmlNode(XmlNode node)
        {
            string val;
            PARAM_ReaderEventNotificationData param = new PARAM_ReaderEventNotificationData();


            {

                param.Timestamp = new UNION_Timestamp();

                try
                {

                    {
                        XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "UTCTimestamp");
                        if (xnl.Count != 0)
                        {
                            for (int i = 0; i < xnl.Count; i++)
                                param.Timestamp.Add(PARAM_UTCTimestamp.FromXmlNode(xnl[i]));
                        }
                    }

                    {
                        XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "Uptime");
                        if (xnl.Count != 0)
                        {
                            for (int i = 0; i < xnl.Count; i++)
                                param.Timestamp.Add(PARAM_Uptime.FromXmlNode(xnl[i]));
                        }
                    }

                }
                catch { }

            }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "HoppingEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.HoppingEvent = PARAM_HoppingEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "GPIEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.GPIEvent = PARAM_GPIEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ROSpecEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ROSpecEvent = PARAM_ROSpecEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ReportBufferLevelWarningEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ReportBufferLevelWarningEvent = PARAM_ReportBufferLevelWarningEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ReportBufferOverflowErrorEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ReportBufferOverflowErrorEvent = PARAM_ReportBufferOverflowErrorEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ReaderExceptionEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ReaderExceptionEvent = PARAM_ReaderExceptionEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "RFSurveyEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.RFSurveyEvent = PARAM_RFSurveyEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "AISpecEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.AISpecEvent = PARAM_AISpecEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "AntennaEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.AntennaEvent = PARAM_AntennaEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ConnectionAttemptEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ConnectionAttemptEvent = PARAM_ConnectionAttemptEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "ConnectionCloseEvent");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.ConnectionCloseEvent = PARAM_ConnectionCloseEvent.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            try
            {

                ArrayList xnl = XmlUtil.GetXmlNodeCustomChildren(node);
                if (xnl != null)
                {
                    if (xnl.Count != 0)
                    {
                        for (int i = 0; i < xnl.Count; i++)
                        {
                            ICustom_Parameter custom = CustomParamDecodeFactory.DecodeXmlNodeToCustomParameter((XmlNode)xnl[i]);
                            if (custom != null) param.AddCustomParameter(custom);
                        }
                    }
                }

            }
            catch { }

            return param;
        }
Ejemplo n.º 2
0
        public new static PARAM_ReaderEventNotificationData FromBitArray(ref BitArray bit_array, ref int cursor, int length)
        {
            if (cursor >= length) return null;

            int field_len = 0;
            object obj_val;
            int parameter_len = 0;
            ArrayList param_list = new ArrayList();

            PARAM_ReaderEventNotificationData param = new PARAM_ReaderEventNotificationData();

            int param_type = 0;

            if (bit_array[cursor]) param.tvCoding = true;
            if (param.tvCoding)
            {
                cursor++;
                param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 7);

                if (param_type != param.TypeID)
                {
                    cursor -= 8;
                    return null;
                }
            }
            else
            {
                cursor += 6;
                param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 10);

                if (param_type != param.TypeID)
                {
                    cursor -= 16;
                    return null;
                }
                param.length = (UInt16)(int)Util.DetermineFieldLength(ref bit_array, ref cursor);
            }


            PARAM_UTCTimestamp _param_UTCTimestamp = PARAM_UTCTimestamp.FromBitArray(ref bit_array, ref cursor, length);
            if (_param_UTCTimestamp != null)
            {
                param.Timestamp.Add(_param_UTCTimestamp);
                while ((_param_UTCTimestamp = PARAM_UTCTimestamp.FromBitArray(ref bit_array, ref cursor, length)) != null)
                    param.Timestamp.Add(_param_UTCTimestamp);
            }

            PARAM_Uptime _param_Uptime = PARAM_Uptime.FromBitArray(ref bit_array, ref cursor, length);
            if (_param_Uptime != null)
            {
                param.Timestamp.Add(_param_Uptime);
                while ((_param_Uptime = PARAM_Uptime.FromBitArray(ref bit_array, ref cursor, length)) != null)
                    param.Timestamp.Add(_param_Uptime);
            }

            param.HoppingEvent = PARAM_HoppingEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.GPIEvent = PARAM_GPIEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ROSpecEvent = PARAM_ROSpecEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ReportBufferLevelWarningEvent = PARAM_ReportBufferLevelWarningEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ReportBufferOverflowErrorEvent = PARAM_ReportBufferOverflowErrorEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ReaderExceptionEvent = PARAM_ReaderExceptionEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.RFSurveyEvent = PARAM_RFSurveyEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.AISpecEvent = PARAM_AISpecEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.AntennaEvent = PARAM_AntennaEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ConnectionAttemptEvent = PARAM_ConnectionAttemptEvent.FromBitArray(ref bit_array, ref cursor, length);

            param.ConnectionCloseEvent = PARAM_ConnectionCloseEvent.FromBitArray(ref bit_array, ref cursor, length);

            ICustom_Parameter custom = CustomParamDecodeFactory.DecodeCustomParameter(ref bit_array, ref cursor, length);
            if (custom != null)
            {
                param.Custom.Add(custom);
                while ((custom = CustomParamDecodeFactory.DecodeCustomParameter(ref bit_array, ref cursor, length)) != null) param.Custom.Add(custom);
            }

            return param;
        }