using System.Collections.Generic;

namespace MECF.Framework.Common.Aitex.Core.Common.DeviceData.IoDevice
{
    /// <summary>
    /// 单个MFC测试对象数据对象，传递UI使用
    /// </summary>
    /// 
    public class MfcTestData
    {
        /// <summary>
        /// PM模块
        /// </summary>
        public string Module { get; set; }

        /// <summary>
        /// 测试MFC名称
        /// </summary>
        public string MfcName { get; set; }

        /// <summary>
        /// 测试是否通过
        /// </summary>
        public string IsPass { get; set; }

        /// <summary>
        /// 数据计算结果
        /// </summary>
        public string Result { get; set; }

        /// <summary>
        /// 数据采集结果
        /// </summary>
        public string Values { get; set; }

        /// <summary>
        /// MFC使用的量程
        /// </summary>
        public string BaseValue { get; set; }

        /// <summary>
        /// 测试气路操作
        /// </summary>
        public string Infor { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public string Time { get; set; }

        /// <summary>
        /// 更新数据对象
        /// </summary>
        /// <param name="mfcTestData"></param>
        public void Update(MfcTestData mfcTestData)
        {
            Module = mfcTestData.Module;
            MfcName = mfcTestData.MfcName;
            IsPass = mfcTestData.IsPass;
            Result = mfcTestData.Result;
            Values = mfcTestData.Values;
            BaseValue = mfcTestData.BaseValue;
            Infor = mfcTestData.Infor;
            Time = mfcTestData.Time;
        }

        /// <summary>
        /// 删除数据对象
        /// </summary>
        public void Delect()
        {
            Module = "";
            IsPass = "";
            Result = "";
            Values = "";
            BaseValue = "";
            Infor = "";
            Time = "";
        }
    }

    /// <summary>
    /// 单个硬件的测试结果，传递UI用
    /// </summary>
    public class ControlNameData
    {
        /// <summary>
        /// 所属PM模块名称
        /// </summary>
        public string Module { get; set; }

        /// <summary>
        /// 测试气路单个硬件名称
        /// </summary>
        public string ControlName { get; set; }

        /// <summary>
        /// 测试气路单个硬件状态
        /// </summary>
        public string State { get; set; }

        /// <summary>
        /// 测试时间记录
        /// </summary>
        public string Time { get; set; }

        /// <summary>
        /// 更新硬件内容
        /// </summary>
        /// <param name="controlNameData"></param>
        public void Update(ControlNameData controlNameData)
        {
            Module = controlNameData.Module;
            ControlName = controlNameData.ControlName;
            State = controlNameData.State;
            Time = controlNameData.Time;
        }

        /// <summary>
        /// 删除硬件测试结果
        /// </summary>
        public void Delect()
        {
            Module = "";
            State = "";
            Time = "";
        }
    }
    /// <summary>
    /// XML解析使用的数据对象
    /// </summary>
    public class NameValue
    {
        /// <summary>
        /// 硬件ID名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 硬件设置的状态
        /// </summary>
        public double Value { get; set; }

        /// <summary>
        /// 硬件实际控制使用名称
        /// </summary>
        public string ControlName { get; set; }
    }

    /// <summary>
    /// MFC测试条件XML配置对象
    /// </summary>
    public class MfcTestCondition
    {
        /// <summary>
        /// 测试时选项名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// XML配置的条件项集合
        /// </summary>
        public List<NameValue> StateList { get; set; } = new List<NameValue>();

        /// <summary>
        /// XML配置的MFC测试项
        /// </summary>
        public NameValue CarryOut { get; set; } = new NameValue();
    }


    
}
