Esempio n. 1
0
        private void Done(XmppClient Client, XmlElement Element, string From, string To)
        {
            SensorDataEventArgs e = this.GetReceiver(Element, true);

            if (e == null)
            {
                return;
            }

            e.Receiving();
            e.DoCallback(this);
        }
Esempio n. 2
0
        private void Fields(XmppClient Client, XmlElement Element, string From, string To)
        {
            SensorDataEventArgs e = this.GetReceiver(Element, true);

            if (e == null)
            {
                return;
            }

            e.Receiving();

            bool Done;

            Field[] Fields = Import.Parse(Element, out Done);
            foreach (Field Field in Fields)
            {
                e.AddField(Field);
            }

            e.DoCallback(this);
        }
Esempio n. 3
0
        private void Failure(XmppClient Client, XmlElement Element, string From, string To)
        {
            SensorDataEventArgs e = this.GetReceiver(Element, false);

            if (e == null)
            {
                return;
            }

            e.Receiving();

            XmlElement ErrorElement;
            DateTime   Timestamp;

            foreach (XmlNode N in Element.ChildNodes)
            {
                ErrorElement = N as XmlElement;
                if (ErrorElement == null || ErrorElement.LocalName != "error")
                {
                    continue;
                }

                Timestamp = XmlUtilities.GetAttribute(ErrorElement, "timestamp", DateTime.MinValue);
                if (Timestamp == DateTime.MinValue)
                {
                    continue;
                }

                string NodeId    = XmlUtilities.GetAttribute(ErrorElement, "nodeId", string.Empty);
                string SourceId  = XmlUtilities.GetAttribute(ErrorElement, "sourceId", string.Empty);
                string CacheType = XmlUtilities.GetAttribute(ErrorElement, "cacheType", string.Empty);

                e.AddReadoutError(new ReadoutError(Timestamp, ErrorElement.InnerText.Trim(), NodeId, CacheType, SourceId));
            }

            e.DoCallback(this);
        }