using MECF.Framework.Common.CommonData;
using System;
using System.Runtime.Serialization;

namespace Aitex.Core.Common.DeviceData
{
    [Serializable]
    [DataContract]
    public class MfcRorData : NotifiableItem
    {
        /// <summary>
        /// 操作的MFC对象名称
        /// </summary>
        [DataMember]
        public string Name { get; set; }


        /// <summary>
        /// 开始时间
        /// </summary>
        [DataMember]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [DataMember]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 所属模块
        /// </summary>
        [DataMember]
        public string Module { get; set; }

        /// <summary>
        /// MFC的量程
        /// </summary>
        [DataMember]
        public double Scale { get; set; }

        /// <summary>
        /// 反应腔温度(外部提供)
        /// </summary>
        [DataMember]
        public double Temperature { get; set; }

        /// <summary>
        /// 压力记录时间间隔(外部提供)
        /// </summary>
        [DataMember]
        public double Interval { get; set; }

        /// <summary>
        /// MFC设定流量(外部提供)
        /// </summary>
        [DataMember]
        public double SetFlow { get; set; }

        /// <summary>
        /// 是否是基准MFC(外部提供)
        /// </summary>
        [DataMember]
        public bool IsStandardMfc { get; set; }

        /// <summary>
        /// 保压压力1
        /// </summary>
        [DataMember]
        public double MaintainPressure1 { get; set; }

        /// <summary>
        /// 保压压力2
        /// </summary>
        [DataMember]
        public double MaintainPressure2 { get; set; }

        /// <summary>
        /// 保压压差
        /// </summary>
        [DataMember]
        public double MaintainPressureDifference { get; set; }

        /// <summary>
        /// 反应腔体积
        /// </summary>
        [DataMember]
        public double Volume { get; set; }

        /// <summary>
        /// 压力1
        /// </summary>
        [DataMember]
        public double Pressure1 { get; set; }

        /// <summary>
        /// 压力2
        /// </summary>
        [DataMember]
        public double Pressure2 { get; set; }

        /// <summary>
        /// 压力3
        /// </summary>
        [DataMember]
        public double Pressure3 { get; set; }

        /// <summary>
        /// 压力4
        /// </summary>
        [DataMember]
        public double Pressure4 { get; set; }

        /// <summary>
        /// 反应腔平均压差
        /// </summary>
        [DataMember]
        public double MeanDifferencePressure { get; set; }

        /// <summary>
        /// MFC实际流量
        /// </summary>
        [DataMember]
        public double ActualFlow { get; set; }

        /// <summary>
        /// 实际流量偏差值(百分比)
        /// </summary>
        [DataMember]
        public double Deviation { get; set; }

        /// <summary>
        /// 基准压力
        /// </summary>
        [DataMember]
        public double BasePressure { get; set; }

        /// <summary>
        /// 结果
        /// </summary>
        [DataMember]
        public string Result { get; set; }

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="data"></param>
        public void Update(MfcRorData data)
        {
            Name = data.Name;
            StartTime = data.StartTime;
            EndTime = data.EndTime;
            Module = data.Module;
            Scale = data.Scale;
            Temperature = data.Temperature;
            Interval = data.Interval;
            SetFlow = data.SetFlow;
            IsStandardMfc = data.IsStandardMfc; 
            MaintainPressure1 = data.MaintainPressure1;
            MaintainPressure2 = data.MaintainPressure2;
            MaintainPressureDifference = data.MaintainPressureDifference;
            Volume = data.Volume;
            Pressure1 = data.Pressure1;
            Pressure2 = data.Pressure2;
            Pressure3 = data.Pressure3;
            Pressure4 = data.Pressure4;
            MeanDifferencePressure = data.MeanDifferencePressure;
            ActualFlow = data.ActualFlow;
            Deviation = data.Deviation;
            BasePressure = data.BasePressure;
            Result = data.Result;
        }
    }
}
