Exemplo n.º 1
0
        public IObservable <ReadData> DirectAsyncRead(IAccessItemRegistration reg)
        {
            var readData = new ReadData
            {
                ClientAlias = reg.ClientAlias,
                Value       = Server.Tags[reg.ClientAlias].Value.Convert(reg.Config)
            };

            return(Observable.Return(readData));
        }
Exemplo n.º 2
0
        public ReadData DirectRead(IAccessItemRegistration reg)
        {
            var clientAlias  = reg.ClientAlias;
            var readDirectly = new ReadData
            {
                Value       = Server.Tags[clientAlias].Value.Convert(reg.Config),
                ClientAlias = clientAlias
            };

            return(readDirectly);
        }
Exemplo n.º 3
0
        public IObservable <Unit> AsyncRead(IAccessItemRegistration registration)
        {
            var reg = _registrations[registration.ClientAlias];

            var readData = new ReadData
            {
                ClientAlias = registration.ClientAlias,
                Value       = Server.Tags[registration.ClientAlias].Value.Convert(reg.Config),
            };

            reg.OnNext(readData);
            return(Observable.Return(new Unit()));
        }
Exemplo n.º 4
0
        public IObservable <IEnumerable <ReadData> > DirectAsyncRead(
            IEnumerable <IAccessItemRegistration> Regs)
        {
            var readDatas = new List <ReadData>();

            foreach (var reg in Regs)
            {
                var readData = new ReadData
                {
                    Value       = Server.Tags[reg.ClientAlias].Value.Convert(reg.Config),
                    ClientAlias = reg.ClientAlias
                };
                readDatas.Add(readData);
            }

            return(Observable.Return(readDatas));
        }
Exemplo n.º 5
0
        public IObservable <Unit> AsyncRead(IEnumerable <IAccessItemRegistration> accessItemIdentifiers)
        {
            foreach (var accessItemIdentifier in accessItemIdentifiers)
            {
                var reg = _registrations[accessItemIdentifier.ClientAlias];

                var readData = new ReadData
                {
                    ClientAlias = reg.ClientAlias,
                    Value       = Server.Tags[accessItemIdentifier.ClientAlias].Value.Convert(reg.Config)
                };

                reg.OnNext(readData);
            }

            return(Observable.Return(new Unit()));
        }
 public void OnNext(ReadData value)
 {
     _subject.OnNext(value);
 }