Пример #1
0
        private void AddChannels(IEditorPlugIn plugIn, ISymbol device)
        {
            IEnumerable <ISymbol> channels = device.ChildrenOfType(SymbolType.Channel);

            foreach (ISymbol channel in channels)
            {
                plugIn.System.DataAcquisition.Channels.Add(channel);
            }
        }
Пример #2
0
        private ISymbol FindPump(ISymbol mainDev)
        {
            //At first get all symbols of type IDevice.
            var devices = mainDev.ChildrenOfType(SymbolType.Device);

            if (devices != null)
            {
                //A pump is a device with a symbol called Flow and %A
                return(devices.FirstOrDefault(elem => elem.Child("Flow") != null && elem.Child("%A") != null));
            }
            return(null);
        }
Пример #3
0
        private ISymbol FindSampler(ISymbol mainDev)
        {
            //At first get all symbols of type IDevice.
            var devices = mainDev.ChildrenOfType(SymbolType.Device);

            if (devices != null)
            {
                //A sampler is a device with an inject command
                return(devices.FirstOrDefault(elem => elem.Child("Inject") != null));
            }
            return(null);
        }