Exemplo n.º 1
0
        /// <summary>
        /// 加载耐压试验方案
        /// </summary>
        private void Load()
        {
            listPlan = new List <CLDC_DataCore.Struct.StInsulationParam>();
            string  _ErrString = "";
            XmlNode _XmlNode   = clsXmlControl.LoadXml(_FAPath, out _ErrString);

            if (_ErrString != "")
            {
                return;
            }
            for (int i = 0; i < _XmlNode.ChildNodes.Count; i++)
            {
                CLDC_DataCore.Struct.StInsulationParam item = new CLDC_DataCore.Struct.StInsulationParam();
                int type          = (int)item.InsulationType;
                int voltage       = item.Voltage;
                int time          = item.Time;
                int current       = item.Current;
                int currentDevice = item.CurrentDevice;
                int.TryParse(_XmlNode.ChildNodes[i].Attributes["Type"].Value, out type);
                int.TryParse(_XmlNode.ChildNodes[i].Attributes["Voltage"].Value, out voltage);
                int.TryParse(_XmlNode.ChildNodes[i].Attributes["Current"].Value, out current);
                int.TryParse(_XmlNode.ChildNodes[i].Attributes["Time"].Value, out time);
                int.TryParse(_XmlNode.ChildNodes[i].Attributes["CurrentDevice"].Value, out currentDevice);

                item.Time           = time;
                item.Voltage        = voltage;
                item.Current        = current;
                item.CurrentDevice  = currentDevice;
                item.InsulationType = (CLDC_DataCore.Struct.StInsulationParam.EnumInsulationType)type;

                listPlan.Add(item);
            }
            return;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获取耐压试验方案
 /// </summary>
 /// <returns></returns>
 public CLDC_DataCore.Struct.StInsulationParam GetPlan(int index)
 {
     if (index > listPlan.Count - 1)
     {
         CLDC_DataCore.Struct.StInsulationParam st = null;
         return(st);
     }
     return(listPlan[index]);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加耐压试验
 /// </summary>
 public void Add(CLDC_DataCore.Struct.StInsulationParam insulationParam)
 {
     listPlan.Add(insulationParam);
 }