using Aitex.Core.RT.Device;
using Aitex.Core.RT.IOCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace MECF.Framework.Simulator.Core
{
    public class SimulatorPressure : SimulatorMFC
    {
        public SimulatorPressure(string module, XmlElement node, string ioModule) : base(module, node, ioModule)
        {

        }

        /// <summary>
        /// 根据XML配置创建PC控制对象
        /// </summary>
        /// <param name="node"></param>
        protected override void InitializeIValve(XmlElement node)
        {
            XmlNodeList valveNodes = node.GetElementsByTagName("IoPressure");
            foreach (XmlElement xmlElement in valveNodes)
            {
                string aiValue = xmlElement.GetAttribute("aiValue");
                string aoValue = xmlElement.GetAttribute("aoValue");

                if (!String.IsNullOrWhiteSpace(aoValue))
                    if (!AI_AOList.ContainsKey(aiValue) && !AI_AOList.ContainsKey(aoValue))
                        AI_AOList.Add(aiValue, aoValue);

            }
        }
    }
}
