using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Threading; using Aitex.Core.Common.DeviceData; using MECF.Framework.Common.DataCenter; using MECF.Framework.Common.DBCore; using MECF.Framework.Common.OperationCenter; using Prism.Commands; using Prism.Mvvm; using Venus_Core; using Venus_MainPages.Unity; using Venus_MainPages.Views; using Xceed.Wpf.Toolkit; namespace Venus_MainPages.ViewModels { public class VenusMFCVerificationViewModel : BindableBase { #region 私有字段 private AITMfcData m_MFCData; private Dictionary m_RtDataValues; public string ModuleName; private ObservableCollection m_MFCVerificationPoints = new ObservableCollection(); private int m_GasSelectedIndex; private int m_PointsSelectedIndex; DispatcherTimer timer = new DispatcherTimer(); private ObservableCollection m_MFCVerificationData=new ObservableCollection(); private ObservableCollection m_VerificationDataRecords = new ObservableCollection(); private ObservableCollection m_VerificationOnePointDataRecords = new ObservableCollection(); private ObservableCollection m_VenusVerificationOnePointDataRecords = new ObservableCollection(); private ObservableCollection m_VerificationTenPointsDataRecords = new ObservableCollection(); private ObservableCollection m_VenusVerificationTenPointsDataRecords = new ObservableCollection(); private ObservableCollection m_MFCCalibrationTenPointsData = new ObservableCollection(); private ObservableCollection m_MFCCalibrationOnePointData = new ObservableCollection(); private PMState m_PMCurrentState; private JetChamber ChamberType; private bool m_MFC7IsEnable; private bool m_MFC8IsEnable; private bool m_MFC9IsEnable; private bool m_MFC10IsEnable; private bool m_MFC11IsEnable; private bool m_MFC12IsEnable; private MFCVerificationView m_MFCVerificationView; #endregion #region 属性 public PMState PMCurrentState { get { return m_PMCurrentState; } set { if ((m_PMCurrentState == PMState.MFCVerification || m_PMCurrentState == PMState.AllMFCVerification) && value == PMState.Idle) { InitTable(); } SetProperty(ref m_PMCurrentState, value); } } public ObservableCollection MFCVerificationPoints { get { return m_MFCVerificationPoints; } set { SetProperty(ref m_MFCVerificationPoints, value); } } public Dictionary RtDataValues { get { return m_RtDataValues; } set { SetProperty(ref m_RtDataValues, value); } } public AITMfcData MFCData { get { return m_MFCData; } set { SetProperty(ref m_MFCData, value); } } public int GasSelectedIndex { get { return m_GasSelectedIndex; } set { SetProperty(ref m_GasSelectedIndex, value); } } public int PointsSelectedIndex { get { return m_PointsSelectedIndex; } set { SetProperty(ref m_PointsSelectedIndex, value); } } private DelegateCommand _DataGridSelectionChangedCommand; public DelegateCommand DataGridSelectionChangedCommand => _DataGridSelectionChangedCommand ?? (_DataGridSelectionChangedCommand = new DelegateCommand(OnDataGridSelectionChanged)); public ObservableCollection MFCCalibrationData { get { return m_MFCVerificationData; } set { SetProperty(ref m_MFCVerificationData, value); } } public ObservableCollection VerificationDataRecords { get { return m_VerificationDataRecords; } set { SetProperty(ref m_VerificationDataRecords, value); } } public ObservableCollection VerificationDataOnePointRecords { get { return m_VerificationOnePointDataRecords; } set { SetProperty(ref m_VerificationOnePointDataRecords, value); } } public ObservableCollection VenusVerificationDataOnePointRecords { get { return m_VenusVerificationOnePointDataRecords; } set { SetProperty(ref m_VenusVerificationOnePointDataRecords, value); } } public ObservableCollection VenusVerificationDataTenPointsRecords { get { return m_VenusVerificationTenPointsDataRecords; } set { SetProperty(ref m_VenusVerificationTenPointsDataRecords, value); } } public ObservableCollection VerificationDataTenPointsRecords { get { return m_VerificationTenPointsDataRecords; } set { SetProperty(ref m_VerificationTenPointsDataRecords, value); } } public ObservableCollection MFCCalibrationTenPointsDataRecords { get { return m_MFCCalibrationTenPointsData; } set { SetProperty(ref m_MFCCalibrationTenPointsData, value); } } public ObservableCollection MFCCalibrationOnePointDataRecords { get { return m_MFCCalibrationOnePointData; } set { SetProperty(ref m_MFCCalibrationOnePointData, value); } } public bool MFC7IsEnable { get { return m_MFC7IsEnable; } set { SetProperty(ref m_MFC7IsEnable, value); } } public bool MFC8IsEnable { get { return m_MFC8IsEnable; } set { SetProperty(ref m_MFC8IsEnable, value); } } public bool MFC9IsEnable { get { return m_MFC9IsEnable; } set { SetProperty(ref m_MFC9IsEnable, value); } } public bool MFC10IsEnable { get { return m_MFC10IsEnable; } set { SetProperty(ref m_MFC10IsEnable, value); } } public bool MFC11IsEnable { get { return m_MFC11IsEnable; } set { SetProperty(ref m_MFC11IsEnable, value); } } public bool MFC12IsEnable { get { return m_MFC12IsEnable; } set { SetProperty(ref m_MFC12IsEnable, value); } } #endregion #region 命令 private DelegateCommand _StartOnePointVerificationCommand; public DelegateCommand StartOnePointVerificationCommand => _StartOnePointVerificationCommand ?? (_StartOnePointVerificationCommand = new DelegateCommand(OnStartOnePointVerification)); private DelegateCommand _StartTenPointVerificationCommand; public DelegateCommand StartTenPointVerificationCommand => _StartTenPointVerificationCommand ?? (_StartTenPointVerificationCommand = new DelegateCommand(OnStartTenPointVerification)); private DelegateCommand _AbortCommand; public DelegateCommand AbortCommand => _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort)); private DelegateCommand _FlashCommand; public DelegateCommand FlashCommand => _FlashCommand ?? (_FlashCommand = new DelegateCommand(OnFlash)); private DelegateCommand _SelectGasCommand; public DelegateCommand SelectGasCommand => _SelectGasCommand ?? (_SelectGasCommand = new DelegateCommand(OnSelectGas)); private DelegateCommand _LoadCommand; public DelegateCommand LoadCommand => _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad)); #endregion public VenusMFCVerificationViewModel() { timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += Timer_Tick; timer.Start(); for (int i = 0; i < 10; i++) { MFCCalibrationTenPointsDataRecords.Add(new MFCCalibrationTenPointsData()); } for (int i = 0; i < 1; i++) { MFCCalibrationOnePointDataRecords.Add(new MFCCalibrationTenPointsData()); } } #region 命令方法 private void OnStartOnePointVerification(object obj) { var values = (object[])obj; string gasName = values[0].ToString(); float flow = float.Parse(values[1].ToString()); InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.MFCVerification}", gasName, flow, 1); } private void OnStartTenPointVerification(object obj) { var values = (object[])obj; string gasName = values[0].ToString(); float flow = float.Parse(values[1].ToString()); InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.MFCVerification}", gasName, flow, 10); } public void OnAbort() { InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort"); } public void OnFlash() { InitTable(); } private void OnSelectGas() { MFCVerificationPoints.Clear(); MFCData = (AITMfcData)QueryDataClient.Instance.Service.GetData($"{ModuleName}.MfcGas{(GasSelectedIndex + 1).ToString()}"); if ( MFCData != null ) { int delta1 = (int)MFCData.Scale / 10; for (int i = 0; i < 10; i++) { MFCVerificationPoints.Add(delta1 + delta1 * i); } PointsSelectedIndex = 0; } } //private void OnQuery() //{ // var AllLeakCheckDa = QueryDataClient.Instance.Service.GetMFCVerificationData(this.view.wfTimeFrom.Value, this.view.wfTimeTo.Value); // if (AllLeakCheckDa != null) // { // VerificationDataRecords = new ObservableCollection(AllLeakCheckDa); // } //} private void OnLoad(object mFCVerificationView) { ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString()); if (ChamberType != JetChamber.Kepler2200A && ChamberType != JetChamber.Kepler2200B) { MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable"); MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable"); } if (ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE || ChamberType == JetChamber.Kepler2300) { MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable"); MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable"); } if (ChamberType==JetChamber.VenusSE || ChamberType == JetChamber.VenusDE) { MFC9IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable"); MFC10IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable"); MFC11IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable"); MFC12IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable"); } //m_MFCVerificationView = mFCVerificationView as MFCVerificationView; ////if ( m_MFCVerificationView == null ) { return; } //if (MFC7IsEnable == false) //{ // m_MFCVerificationView.DataGridTemplateColumn7.Visibility = Visibility.Hidden; // m_MFCVerificationView.OnePointDataGridTemplateColumn7.Visibility = Visibility.Hidden; //} //else //{ // m_MFCVerificationView.DataGridTemplateColumn7.Visibility = Visibility.Visible; // m_MFCVerificationView.OnePointDataGridTemplateColumn7.Visibility = Visibility.Visible; //} //if (MFC8IsEnable == false) //{ // m_MFCVerificationView.DataGridTemplateColumn8.Visibility = Visibility.Hidden; // m_MFCVerificationView.OnePointDataGridTemplateColumn8.Visibility = Visibility.Hidden; //} //else //{ // m_MFCVerificationView.DataGridTemplateColumn8.Visibility = Visibility.Visible; // m_MFCVerificationView.OnePointDataGridTemplateColumn8.Visibility = Visibility.Visible; //} VenusVerificationDataOnePointRecords = new ObservableCollection(); VenusVerificationDataTenPointsRecords= new ObservableCollection(); for ( int i = 1; i <= 12; i++) { bool gasenable= (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas{i}.Enable"); if (gasenable) { AITMfcData S =(AITMfcData)QueryDataClient.Instance.Service.GetData($"{ModuleName}.MfcGas{i}"); VenusVerificationDataOnePointRecords.Add(new VenusMFCVerificationOnePointData() { Name = $"MfcGas{i}", Select= false, Module=ModuleName, GasName= S.DisplayName, OperateTime="" }); VenusVerificationDataTenPointsRecords.Add(new VenusMFCVerificationTenPointsData() { Name = $"MfcGas{i}", Select = false, Module = ModuleName, GasName = S.DisplayName, OperateTime = "" }); } } InitTable(); } #endregion #region 私有方法 private void Timer_Tick(object sender, EventArgs e) { PMCurrentState = (PMState)QueryDataClient.Instance.Service.GetData($"{ModuleName}.FsmState"); } public void Init() { OnSelectGas(); } public void OnDataGridSelectionChanged(object obj) { if (obj == null) { return; } else { MFCVerificationOnePointData item = obj as MFCVerificationOnePointData; string name=item.Name.Substring(6,1); switch (name) { case "1": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas1Calculate = item.Calculate, Gas1SetPoint = item.Setpoint }; break; case "2": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas2Calculate = item.Calculate, Gas2SetPoint = item.Setpoint }; break; case "3": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas3Calculate = item.Calculate, Gas3SetPoint = item.Setpoint }; break; case "4": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas4Calculate = item.Calculate, Gas4SetPoint = item.Setpoint }; break; case "5": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas5Calculate = item.Calculate, Gas5SetPoint = item.Setpoint }; break; case "6": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas6Calculate = item.Calculate, Gas6SetPoint = item.Setpoint }; break; case "7": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas7Calculate = item.Calculate, Gas7SetPoint = item.Setpoint }; break; case "8": MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas8Calculate = item.Calculate, Gas8SetPoint = item.Setpoint }; break; } } } private void InitTable() { var onePointData = QueryDataClient.Instance.Service.GetMFCVerificationOnePointData(); if (onePointData != null) { var _onePointData = onePointData.Where(x => x.Module == ModuleName); //VerificationDataOnePointRecords = new ObservableCollection(_onePointData); //VenusVerificationDataOnePointRecords = new ObservableCollection(); foreach (var item in _onePointData) { for (var i = 0;i x.Module == ModuleName); //VerificationDataTenPointsRecords = new ObservableCollection(_tenPointsData); foreach (var item in _tenPointsData) { for (var i = 0; i < VenusVerificationDataTenPointsRecords.Count(); i++) { if (VenusVerificationDataTenPointsRecords[i].Name == item.Name) { VenusVerificationDataTenPointsRecords[i].OperateTime = item.OperateTime; VenusVerificationDataTenPointsRecords[i].Percent10Setpoint = item.Percent10Setpoint; VenusVerificationDataTenPointsRecords[i].Percent10Setpoint = item.Percent10Setpoint; VenusVerificationDataTenPointsRecords[i].Percent10Error = (Math.Abs(item.Percent10Calculate) - Math.Abs(item.Percent10Setpoint)) / Math.Abs(item.Percent10Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent20Setpoint = item.Percent20Setpoint; VenusVerificationDataTenPointsRecords[i].Percent20Setpoint = item.Percent20Setpoint; VenusVerificationDataTenPointsRecords[i].Percent20Error = (Math.Abs(item.Percent20Calculate) - Math.Abs(item.Percent20Setpoint)) / Math.Abs(item.Percent20Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent30Setpoint = item.Percent30Setpoint; VenusVerificationDataTenPointsRecords[i].Percent30Setpoint = item.Percent30Setpoint; VenusVerificationDataTenPointsRecords[i].Percent30Error = (Math.Abs(item.Percent30Calculate) - Math.Abs(item.Percent30Setpoint)) / Math.Abs(item.Percent30Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent40Setpoint = item.Percent40Setpoint; VenusVerificationDataTenPointsRecords[i].Percent40Setpoint = item.Percent40Setpoint; VenusVerificationDataTenPointsRecords[i].Percent40Error = (Math.Abs(item.Percent40Calculate) - Math.Abs(item.Percent40Setpoint)) / Math.Abs(item.Percent40Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent50Setpoint = item.Percent50Setpoint; VenusVerificationDataTenPointsRecords[i].Percent50Setpoint = item.Percent50Setpoint; VenusVerificationDataTenPointsRecords[i].Percent50Error = (Math.Abs(item.Percent50Calculate) - Math.Abs(item.Percent50Setpoint)) / Math.Abs(item.Percent50Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent60Setpoint = item.Percent60Setpoint; VenusVerificationDataTenPointsRecords[i].Percent60Setpoint = item.Percent60Setpoint; VenusVerificationDataTenPointsRecords[i].Percent60Error = (Math.Abs(item.Percent60Calculate) - Math.Abs(item.Percent60Setpoint)) / Math.Abs(item.Percent60Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent70Setpoint = item.Percent70Setpoint; VenusVerificationDataTenPointsRecords[i].Percent70Setpoint = item.Percent70Setpoint; VenusVerificationDataTenPointsRecords[i].Percent70Error = (Math.Abs(item.Percent70Calculate) - Math.Abs(item.Percent70Setpoint)) / Math.Abs(item.Percent70Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent80Setpoint = item.Percent80Setpoint; VenusVerificationDataTenPointsRecords[i].Percent80Setpoint = item.Percent80Setpoint; VenusVerificationDataTenPointsRecords[i].Percent80Error = (Math.Abs(item.Percent80Calculate) - Math.Abs(item.Percent80Setpoint)) / Math.Abs(item.Percent80Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent90Setpoint = item.Percent90Setpoint; VenusVerificationDataTenPointsRecords[i].Percent90Setpoint = item.Percent90Setpoint; VenusVerificationDataTenPointsRecords[i].Percent90Error = (Math.Abs(item.Percent90Calculate) - Math.Abs(item.Percent90Setpoint)) / Math.Abs(item.Percent90Setpoint) * 100; VenusVerificationDataTenPointsRecords[i].Percent100Setpoint = item.Percent100Setpoint; VenusVerificationDataTenPointsRecords[i].Percent100Setpoint = item.Percent100Setpoint; VenusVerificationDataTenPointsRecords[i].Percent100Error = (Math.Abs(item.Percent100Calculate) - Math.Abs(item.Percent100Setpoint)) / Math.Abs(item.Percent100Setpoint) * 100; } } } } var data1 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas1").FirstOrDefault(); if (data1 != null) { MFCCalibrationTenPointsDataRecords[0].Gas1SetPoint = data1.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas1Calculate = data1.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas1SetPoint = data1.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas1Calculate = data1.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas1SetPoint = data1.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas1Calculate = data1.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas1SetPoint = data1.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas1Calculate = data1.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas1SetPoint = data1.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas1Calculate = data1.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas1SetPoint = data1.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas1Calculate = data1.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas1SetPoint = data1.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas1Calculate = data1.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas1SetPoint = data1.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas1Calculate = data1.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas1SetPoint = data1.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas1Calculate = data1.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas1SetPoint = data1.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas1Calculate = data1.Percent100Calculate; } var data2 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas2").FirstOrDefault(); if (data2 != null) { MFCCalibrationTenPointsDataRecords[0].Gas2SetPoint = data2.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas2Calculate = data2.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas2SetPoint = data2.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas2Calculate = data2.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas2SetPoint = data2.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas2Calculate = data2.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas2SetPoint = data2.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas2Calculate = data2.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas2SetPoint = data2.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas2Calculate = data2.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas2SetPoint = data2.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas2Calculate = data2.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas2SetPoint = data2.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas2Calculate = data2.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas2SetPoint = data2.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas2Calculate = data2.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas2SetPoint = data2.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas2Calculate = data2.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas2SetPoint = data2.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas2Calculate = data2.Percent100Calculate; } var data3 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas3").FirstOrDefault(); if (data3 != null) { MFCCalibrationTenPointsDataRecords[0].Gas3SetPoint = data3.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas3Calculate = data3.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas3SetPoint = data3.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas3Calculate = data3.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas3SetPoint = data3.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas3Calculate = data3.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas3SetPoint = data3.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas3Calculate = data3.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas3SetPoint = data3.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas3Calculate = data3.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas3SetPoint = data3.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas3Calculate = data3.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas3SetPoint = data3.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas3Calculate = data3.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas3SetPoint = data3.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas3Calculate = data3.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas3SetPoint = data3.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas3Calculate = data3.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas3SetPoint = data3.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas3Calculate = data3.Percent100Calculate; } var data4 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas4").FirstOrDefault(); if (data4 != null) { MFCCalibrationTenPointsDataRecords[0].Gas4SetPoint = data4.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas4Calculate = data4.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas4SetPoint = data4.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas4Calculate = data4.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas4SetPoint = data4.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas4Calculate = data4.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas4SetPoint = data4.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas4Calculate = data4.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas4SetPoint = data4.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas4Calculate = data4.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas4SetPoint = data4.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas4Calculate = data4.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas4SetPoint = data4.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas4Calculate = data4.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas4SetPoint = data4.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas4Calculate = data4.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas4SetPoint = data4.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas4Calculate = data4.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas4SetPoint = data4.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas4Calculate = data4.Percent100Calculate; } var data5= VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas5").FirstOrDefault(); if (data5 != null) { MFCCalibrationTenPointsDataRecords[0].Gas5SetPoint = data5.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas5Calculate = data5.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas5SetPoint = data5.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas5Calculate = data5.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas5SetPoint = data5.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas5Calculate = data5.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas5SetPoint = data5.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas5Calculate = data5.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas5SetPoint = data5.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas5Calculate = data5.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas5SetPoint = data5.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas5Calculate = data5.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas5SetPoint = data5.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas5Calculate = data5.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas5SetPoint = data5.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas5Calculate = data5.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas5SetPoint = data5.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas5Calculate = data5.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas5SetPoint = data5.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas5Calculate = data5.Percent100Calculate; } var data6 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas6").FirstOrDefault(); if (data6 != null) { MFCCalibrationTenPointsDataRecords[0].Gas6SetPoint = data6.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas6Calculate = data6.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas6SetPoint = data6.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas6Calculate = data6.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas6SetPoint = data6.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas6Calculate = data6.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas6SetPoint = data6.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas6Calculate = data6.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas6SetPoint = data6.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas6Calculate = data6.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas6SetPoint = data6.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas6Calculate = data6.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas6SetPoint = data6.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas6Calculate = data6.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas6SetPoint = data6.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas6Calculate = data6.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas6SetPoint = data6.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas6Calculate = data6.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas6SetPoint = data6.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas6Calculate = data6.Percent100Calculate; } var data7 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas7").FirstOrDefault(); if (data7 != null) { MFCCalibrationTenPointsDataRecords[0].Gas7SetPoint = data7.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas7Calculate = data7.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas7SetPoint = data7.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas7Calculate = data7.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas7SetPoint = data7.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas7Calculate = data7.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas7SetPoint = data7.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas7Calculate = data7.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas7SetPoint = data7.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas7Calculate = data7.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas7SetPoint = data7.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas7Calculate = data7.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas7SetPoint = data7.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas7Calculate = data7.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas7SetPoint = data7.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas7Calculate = data7.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas7SetPoint = data7.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas7Calculate = data7.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas7SetPoint = data7.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas7Calculate = data7.Percent100Calculate; } var data8 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas8").FirstOrDefault(); if (data8 != null) { MFCCalibrationTenPointsDataRecords[0].Gas8SetPoint = data8.Percent10Setpoint; MFCCalibrationTenPointsDataRecords[0].Gas8Calculate = data8.Percent10Calculate; MFCCalibrationTenPointsDataRecords[1].Gas8SetPoint = data8.Percent20Setpoint; MFCCalibrationTenPointsDataRecords[1].Gas8Calculate = data8.Percent20Calculate; MFCCalibrationTenPointsDataRecords[2].Gas8SetPoint = data8.Percent30Setpoint; MFCCalibrationTenPointsDataRecords[2].Gas8Calculate = data8.Percent30Calculate; MFCCalibrationTenPointsDataRecords[3].Gas8SetPoint = data8.Percent40Setpoint; MFCCalibrationTenPointsDataRecords[3].Gas8Calculate = data8.Percent40Calculate; MFCCalibrationTenPointsDataRecords[4].Gas8SetPoint = data8.Percent50Setpoint; MFCCalibrationTenPointsDataRecords[4].Gas8Calculate = data8.Percent50Calculate; MFCCalibrationTenPointsDataRecords[5].Gas8SetPoint = data8.Percent60Setpoint; MFCCalibrationTenPointsDataRecords[5].Gas8Calculate = data8.Percent60Calculate; MFCCalibrationTenPointsDataRecords[6].Gas8SetPoint = data8.Percent70Setpoint; MFCCalibrationTenPointsDataRecords[6].Gas8Calculate = data8.Percent70Calculate; MFCCalibrationTenPointsDataRecords[7].Gas8SetPoint = data8.Percent80Setpoint; MFCCalibrationTenPointsDataRecords[7].Gas8Calculate = data8.Percent80Calculate; MFCCalibrationTenPointsDataRecords[8].Gas8SetPoint = data8.Percent90Setpoint; MFCCalibrationTenPointsDataRecords[8].Gas8Calculate = data8.Percent90Calculate; MFCCalibrationTenPointsDataRecords[9].Gas8SetPoint = data8.Percent100Setpoint; MFCCalibrationTenPointsDataRecords[9].Gas8Calculate = data8.Percent100Calculate; } var onePointdata1 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas1").FirstOrDefault(); if (onePointdata1 != null) { MFCCalibrationOnePointDataRecords[0].Gas1SetPoint = onePointdata1.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas1Calculate = onePointdata1.Calculate; } var onePointdata2 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas2").FirstOrDefault(); if (onePointdata2 != null) { MFCCalibrationOnePointDataRecords[0].Gas2SetPoint = onePointdata2.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas2Calculate = onePointdata2.Calculate; } var onePointdata3 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas3").FirstOrDefault(); if (onePointdata3 != null) { MFCCalibrationOnePointDataRecords[0].Gas3SetPoint = onePointdata3.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas3Calculate = onePointdata3.Calculate; } var onePointdata4 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas4").FirstOrDefault(); if (onePointdata4 != null) { MFCCalibrationOnePointDataRecords[0].Gas4SetPoint = onePointdata4.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas4Calculate = onePointdata4.Calculate; } var onePointdata5 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas5").FirstOrDefault(); if (onePointdata5 != null) { MFCCalibrationOnePointDataRecords[0].Gas5SetPoint = onePointdata5.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas5Calculate = onePointdata5.Calculate; } var onePointdata6 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas6").FirstOrDefault(); if (onePointdata6 != null) { MFCCalibrationOnePointDataRecords[0].Gas6SetPoint = onePointdata6.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas6Calculate = onePointdata6.Calculate; } var onePointdata7 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas7").FirstOrDefault(); if (onePointdata7 != null) { MFCCalibrationOnePointDataRecords[0].Gas7SetPoint = onePointdata7.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas7Calculate = onePointdata7.Calculate; } var onePointdata8 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas8").FirstOrDefault(); if (onePointdata8 != null) { MFCCalibrationOnePointDataRecords[0].Gas8SetPoint = onePointdata8.Setpoint; MFCCalibrationOnePointDataRecords[0].Gas8Calculate = onePointdata8.Calculate; } } #endregion } }