예제 #1
0
 public bool RegisterEvent(cdeP property, string nodeId, TheEventSubscription subscriptionInfo)
 {
     if (property.GetThing()?.GetBaseThing() == null)
     {
         return(false);
     }
     return(_EventRegistrations.TryAdd(property.Name, new EventRegistration
     {
         PropertyName = property.Name,
         EventInfo = new MsgOPCUACreateTags.EventInfo
         {
             DisplayName = property.Name,
             NodeId = nodeId,
             Subscription = subscriptionInfo.Clone(),
             HostThing = property.GetThing().GetBaseThing(),
         },
         Error = "Not subscribed",
     }));
 }
예제 #2
0
        //public static void Browse() { }

        //public async Task<string> RegisterAndReadTagAsync(cdeP property, string nodeId, int samplingInterval = 1000, ChangeTrigger changeTrigger = ChangeTrigger.Value, double deadbandvalue = 0) { return false; }

        public bool RegisterTag(cdeP property, string nodeId, int samplingInterval = 1000, ChangeTrigger changeTrigger = ChangeTrigger.Value, double deadbandvalue = 0)
        {
            if (property.GetThing()?.GetBaseThing() == null)
            {
                return(false);
            }
            return(_TagRegistrations.TryAdd(property.Name, new TagRegistration
            {
                PropertyName = property.Name,
                TagInfo = new MsgOPCUACreateTags.TagInfo
                {
                    DisplayName = property.Name,
                    NodeId = nodeId,
                    SamplingInterval = samplingInterval,
                    ChangeTrigger = changeTrigger,
                    DeadbandValue = deadbandvalue,
                    HostThingAddress = property.GetThing().GetBaseThing(),
                },
                Error = "Not subscribed",
            }));
        }