예제 #1
0
        /// <summary>
        /// Загрузить конфигурацию OPC-тегов из XML файла.
        /// </summary>
        /// <param name="aXmlFile">Имя файла.</param>
        public void LoadOpcItemsConfiguration(string aXmlFile)
        {
            WagstaffCurdataConfiguration = new DataReaderConfiguration();
            MixerCurrdataConfiguration = new DataReaderConfiguration();

            var document = new XmlDocument();
            document.Load(aXmlFile);

            var root = document.DocumentElement;
            var nodes = root.ChildNodes;
            for (var nodeIndex = 0; nodeIndex < nodes.Count; ++nodeIndex) {
                switch (nodes[nodeIndex].Name) {
                    case NODE_WAGSTAFF_CURDATA:
                        WagstaffCurdataConfiguration.LoadFromXmlNode(nodes[nodeIndex]);
                        break;
                    case NODE_MIXER_CURDATA:
                        MixerCurrdataConfiguration.LoadFromXmlNode(nodes[nodeIndex]);
                        break;
                }
            }

            DataInfo = new List<DataReadInfo>(WagstaffCurdataConfiguration.DataInfo);
            DataInfo.AddRange(MixerCurrdataConfiguration.DataInfo);
        }
예제 #2
0
파일: DataReader.cs 프로젝트: desla/AS
 /// <summary>
 /// Установить конфигурацию.
 /// </summary>
 /// <param name="aConfiguration">Конфигурация.</param>
 public void SetConfiguration(DataReaderConfiguration aConfiguration)
 {
     SetData(aConfiguration.DataInfo.ToArray());
     SetReadInterval(aConfiguration.ReadInterval);
 }