GetEventCategories() public method

Gets the event categories.
public GetEventCategories ( int eventType, int &categories, string &descriptions ) : void
eventType int Type of the event.
categories int The categories.
descriptions string The descriptions.
return void
コード例 #1
0
        /// <summary>
        /// Fetches the event categories for the specified event type.
        /// </summary>
        public void LoadEventType(ComAeClient client, int eventTypeId)
        {
            int[]    ids          = null;
            string[] descriptions = null;

            try
            {
                client.GetEventCategories(eventTypeId, out ids, out descriptions);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error fetching event categories.");
            }

            if (ids != null)
            {
                for (int ii = 0; ii < ids.Length; ii++)
                {
                    List <EventAttribute> attributes = LoadEventAttributes(client, eventTypeId, ids[ii]);

                    if (eventTypeId == OpcRcw.Ae.Constants.CONDITION_EVENT)
                    {
                        LoadConditionEvent(client, eventTypeId, ids[ii], descriptions[ii], attributes);
                        continue;
                    }

                    EventType eventType = new EventType();
                    eventType.EventTypeId       = eventTypeId;
                    eventType.CategoryId        = ids[ii];
                    eventType.Description       = descriptions[ii];
                    eventType.ConditionName     = null;
                    eventType.SubConditionNames = null;
                    eventType.Attributes        = attributes;
                    DetermineMapping(eventType);
                    EventTypes.Add(eventType);
                }
            }
        }
コード例 #2
0
ファイル: AeTypeCache.cs プロジェクト: OPCFoundation/UA-.NET
        /// <summary>
        /// Fetches the event categories for the specified event type.
        /// </summary>
        public void LoadEventType(ComAeClient client, int eventTypeId)
        {
            int[] ids = null;
            string[] descriptions = null;

            try
            {
                client.GetEventCategories(eventTypeId, out ids, out descriptions);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error fetching event categories.");
            }

            if (ids != null)
            {
                for (int ii = 0; ii < ids.Length; ii++)
                {
                    List<EventAttribute> attributes = LoadEventAttributes(client, eventTypeId, ids[ii]);

                    if (eventTypeId == OpcRcw.Ae.Constants.CONDITION_EVENT)
                    {
                        LoadConditionEvent(client, eventTypeId, ids[ii], descriptions[ii], attributes);
                        continue;
                    }

                    EventType eventType = new EventType();
                    eventType.EventTypeId = eventTypeId;
                    eventType.CategoryId = ids[ii];
                    eventType.Description = descriptions[ii];
                    eventType.ConditionName = null;
                    eventType.SubConditionNames = null;
                    eventType.Attributes = attributes;
                    DetermineMapping(eventType);
                    EventTypes.Add(eventType);
                }
            }
        }