MFCVerificationViewModel.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Threading;
  9. using Aitex.Core.Common.DeviceData;
  10. using MECF.Framework.Common.DataCenter;
  11. using MECF.Framework.Common.DBCore;
  12. using MECF.Framework.Common.OperationCenter;
  13. using Prism.Commands;
  14. using Prism.Mvvm;
  15. using Venus_Core;
  16. using Venus_MainPages.Unity;
  17. using Venus_MainPages.Views;
  18. namespace Venus_MainPages.ViewModels
  19. {
  20. public class MFCVerificationViewModel : BindableBase
  21. {
  22. #region 私有字段
  23. private AITMfcData m_MFCData;
  24. private Dictionary<string, object> m_RtDataValues;
  25. public string ModuleName;
  26. private ObservableCollection<int> m_MFCVerificationPoints = new ObservableCollection<int>();
  27. private int m_GasSelectedIndex;
  28. private int m_PointsSelectedIndex;
  29. DispatcherTimer timer = new DispatcherTimer();
  30. private ObservableCollection<MFCCalibrationData> m_MFCVerificationData=new ObservableCollection<MFCCalibrationData>();
  31. private ObservableCollection<MFCVerificationData> m_VerificationDataRecords = new ObservableCollection<MFCVerificationData>();
  32. private ObservableCollection<MFCVerificationOnePointData> m_VerificationOnePointDataRecords = new ObservableCollection<MFCVerificationOnePointData>();
  33. private ObservableCollection<MFCVerificationTenPointsData> m_VerificationTenPointsDataRecords = new ObservableCollection<MFCVerificationTenPointsData>();
  34. private ObservableCollection<MFCCalibrationTenPointsData> m_MFCCalibrationTenPointsData = new ObservableCollection<MFCCalibrationTenPointsData>();
  35. private ObservableCollection<MFCCalibrationTenPointsData> m_MFCCalibrationOnePointData = new ObservableCollection<MFCCalibrationTenPointsData>();
  36. private PMState m_PMCurrentState;
  37. private JetChamber ChamberType;
  38. private bool m_MFC7IsEnable;
  39. private bool m_MFC8IsEnable;
  40. private bool m_MFC9IsEnable;
  41. private bool m_MFC10IsEnable;
  42. private bool m_MFC11IsEnable;
  43. private bool m_MFC12IsEnable;
  44. private MFCVerificationView m_MFCVerificationView;
  45. #endregion
  46. #region 属性
  47. public PMState PMCurrentState
  48. {
  49. get { return m_PMCurrentState; }
  50. set
  51. {
  52. if ((m_PMCurrentState == PMState.MFCVerification || m_PMCurrentState == PMState.AllMFCVerification) && value == PMState.Idle)
  53. {
  54. InitTable();
  55. }
  56. SetProperty(ref m_PMCurrentState, value);
  57. }
  58. }
  59. public ObservableCollection<int> MFCVerificationPoints
  60. {
  61. get { return m_MFCVerificationPoints; }
  62. set
  63. {
  64. SetProperty(ref m_MFCVerificationPoints, value);
  65. }
  66. }
  67. public Dictionary<string, object> RtDataValues
  68. {
  69. get { return m_RtDataValues; }
  70. set { SetProperty(ref m_RtDataValues, value); }
  71. }
  72. public AITMfcData MFCData
  73. {
  74. get { return m_MFCData; }
  75. set { SetProperty(ref m_MFCData, value); }
  76. }
  77. public int GasSelectedIndex
  78. {
  79. get { return m_GasSelectedIndex; }
  80. set { SetProperty(ref m_GasSelectedIndex, value); }
  81. }
  82. public int PointsSelectedIndex
  83. {
  84. get { return m_PointsSelectedIndex; }
  85. set { SetProperty(ref m_PointsSelectedIndex, value); }
  86. }
  87. private DelegateCommand<object> _DataGridSelectionChangedCommand;
  88. public DelegateCommand<object> DataGridSelectionChangedCommand =>
  89. _DataGridSelectionChangedCommand ?? (_DataGridSelectionChangedCommand = new DelegateCommand<object>(OnDataGridSelectionChanged));
  90. public ObservableCollection<MFCCalibrationData> MFCCalibrationData
  91. {
  92. get { return m_MFCVerificationData; }
  93. set { SetProperty(ref m_MFCVerificationData, value); }
  94. }
  95. public ObservableCollection<MFCVerificationData> VerificationDataRecords
  96. {
  97. get { return m_VerificationDataRecords; }
  98. set { SetProperty(ref m_VerificationDataRecords, value); }
  99. }
  100. public ObservableCollection<MFCVerificationOnePointData> VerificationDataOnePointRecords
  101. {
  102. get { return m_VerificationOnePointDataRecords; }
  103. set { SetProperty(ref m_VerificationOnePointDataRecords, value); }
  104. }
  105. public ObservableCollection<MFCVerificationTenPointsData> VerificationDataTenPointsRecords
  106. {
  107. get { return m_VerificationTenPointsDataRecords; }
  108. set { SetProperty(ref m_VerificationTenPointsDataRecords, value); }
  109. }
  110. public ObservableCollection<MFCCalibrationTenPointsData> MFCCalibrationTenPointsDataRecords
  111. {
  112. get { return m_MFCCalibrationTenPointsData; }
  113. set { SetProperty(ref m_MFCCalibrationTenPointsData, value); }
  114. }
  115. public ObservableCollection<MFCCalibrationTenPointsData> MFCCalibrationOnePointDataRecords
  116. {
  117. get { return m_MFCCalibrationOnePointData; }
  118. set { SetProperty(ref m_MFCCalibrationOnePointData, value); }
  119. }
  120. public bool MFC7IsEnable
  121. {
  122. get { return m_MFC7IsEnable; }
  123. set { SetProperty(ref m_MFC7IsEnable, value); }
  124. }
  125. public bool MFC8IsEnable
  126. {
  127. get { return m_MFC8IsEnable; }
  128. set { SetProperty(ref m_MFC8IsEnable, value); }
  129. }
  130. public bool MFC9IsEnable
  131. {
  132. get { return m_MFC9IsEnable; }
  133. set { SetProperty(ref m_MFC9IsEnable, value); }
  134. }
  135. public bool MFC10IsEnable
  136. {
  137. get { return m_MFC10IsEnable; }
  138. set { SetProperty(ref m_MFC10IsEnable, value); }
  139. }
  140. public bool MFC11IsEnable
  141. {
  142. get { return m_MFC11IsEnable; }
  143. set { SetProperty(ref m_MFC11IsEnable, value); }
  144. }
  145. public bool MFC12IsEnable
  146. {
  147. get { return m_MFC12IsEnable; }
  148. set { SetProperty(ref m_MFC12IsEnable, value); }
  149. }
  150. #endregion
  151. #region 命令
  152. private DelegateCommand<object> _StartOnePointVerificationCommand;
  153. public DelegateCommand<object> StartOnePointVerificationCommand =>
  154. _StartOnePointVerificationCommand ?? (_StartOnePointVerificationCommand = new DelegateCommand<object>(OnStartOnePointVerification));
  155. private DelegateCommand<object> _StartTenPointVerificationCommand;
  156. public DelegateCommand<object> StartTenPointVerificationCommand =>
  157. _StartTenPointVerificationCommand ?? (_StartTenPointVerificationCommand = new DelegateCommand<object>(OnStartTenPointVerification));
  158. private DelegateCommand _AbortCommand;
  159. public DelegateCommand AbortCommand =>
  160. _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
  161. private DelegateCommand _FlashCommand;
  162. public DelegateCommand FlashCommand =>
  163. _FlashCommand ?? (_FlashCommand = new DelegateCommand(OnFlash));
  164. private DelegateCommand _SelectGasCommand;
  165. public DelegateCommand SelectGasCommand =>
  166. _SelectGasCommand ?? (_SelectGasCommand = new DelegateCommand(OnSelectGas));
  167. private DelegateCommand<object> _LoadCommand;
  168. public DelegateCommand<object> LoadCommand =>
  169. _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
  170. #endregion
  171. public MFCVerificationViewModel()
  172. {
  173. timer.Interval = TimeSpan.FromSeconds(1);
  174. timer.Tick += Timer_Tick;
  175. timer.Start();
  176. for (int i = 0; i < 10; i++)
  177. {
  178. MFCCalibrationTenPointsDataRecords.Add(new MFCCalibrationTenPointsData());
  179. }
  180. for (int i = 0; i < 1; i++)
  181. {
  182. MFCCalibrationOnePointDataRecords.Add(new MFCCalibrationTenPointsData());
  183. }
  184. }
  185. #region 命令方法
  186. private void OnStartOnePointVerification(object obj)
  187. {
  188. var values = (object[])obj;
  189. string gasName = values[0].ToString();
  190. float flow = float.Parse(values[1].ToString());
  191. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.MFCVerification}", gasName, flow, 1);
  192. }
  193. private void OnStartTenPointVerification(object obj)
  194. {
  195. var values = (object[])obj;
  196. string gasName = values[0].ToString();
  197. float flow = float.Parse(values[1].ToString());
  198. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.MFCVerification}", gasName, flow, 10);
  199. }
  200. public void OnAbort()
  201. {
  202. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort");
  203. }
  204. public void OnFlash()
  205. {
  206. InitTable();
  207. }
  208. private void OnSelectGas()
  209. {
  210. MFCVerificationPoints.Clear();
  211. MFCData = (AITMfcData)QueryDataClient.Instance.Service.GetData($"{ModuleName}.MfcGas{(GasSelectedIndex + 1).ToString()}");
  212. if ( MFCData != null )
  213. {
  214. int delta1 = (int)MFCData.Scale / 10;
  215. for (int i = 0; i < 10; i++)
  216. {
  217. MFCVerificationPoints.Add(delta1 + delta1 * i);
  218. }
  219. PointsSelectedIndex = 0;
  220. }
  221. }
  222. //private void OnQuery()
  223. //{
  224. // var AllLeakCheckDa = QueryDataClient.Instance.Service.GetMFCVerificationData(this.view.wfTimeFrom.Value, this.view.wfTimeTo.Value);
  225. // if (AllLeakCheckDa != null)
  226. // {
  227. // VerificationDataRecords = new ObservableCollection<MFCVerificationData>(AllLeakCheckDa);
  228. // }
  229. //}
  230. private void OnLoad(object mFCVerificationView)
  231. {
  232. ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
  233. InitTable();
  234. if (ChamberType != JetChamber.Kepler2200A && ChamberType != JetChamber.Kepler2200B)
  235. {
  236. MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
  237. MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
  238. }
  239. if (ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE || ChamberType == JetChamber.Kepler2300)
  240. {
  241. MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
  242. MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
  243. }
  244. if (ChamberType==JetChamber.VenusSE || ChamberType == JetChamber.VenusDE)
  245. {
  246. MFC9IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable");
  247. MFC10IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable");
  248. MFC11IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable");
  249. MFC12IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable");
  250. }
  251. m_MFCVerificationView = mFCVerificationView as MFCVerificationView;
  252. if ( m_MFCVerificationView == null ) { return; }
  253. if (MFC7IsEnable == false)
  254. {
  255. m_MFCVerificationView.DataGridTemplateColumn7.Visibility = Visibility.Hidden;
  256. m_MFCVerificationView.OnePointDataGridTemplateColumn7.Visibility = Visibility.Hidden;
  257. }
  258. else
  259. {
  260. m_MFCVerificationView.DataGridTemplateColumn7.Visibility = Visibility.Visible;
  261. m_MFCVerificationView.OnePointDataGridTemplateColumn7.Visibility = Visibility.Visible;
  262. }
  263. if (MFC8IsEnable == false)
  264. {
  265. m_MFCVerificationView.DataGridTemplateColumn8.Visibility = Visibility.Hidden;
  266. m_MFCVerificationView.OnePointDataGridTemplateColumn8.Visibility = Visibility.Hidden;
  267. }
  268. else
  269. {
  270. m_MFCVerificationView.DataGridTemplateColumn8.Visibility = Visibility.Visible;
  271. m_MFCVerificationView.OnePointDataGridTemplateColumn8.Visibility = Visibility.Visible;
  272. }
  273. }
  274. #endregion
  275. #region 私有方法
  276. private void Timer_Tick(object sender, EventArgs e)
  277. {
  278. PMCurrentState = (PMState)QueryDataClient.Instance.Service.GetData($"{ModuleName}.FsmState");
  279. }
  280. public void Init()
  281. {
  282. OnSelectGas();
  283. }
  284. public void OnDataGridSelectionChanged(object obj)
  285. {
  286. if (obj == null)
  287. {
  288. return;
  289. }
  290. else
  291. {
  292. MFCVerificationOnePointData item = obj as MFCVerificationOnePointData;
  293. string name=item.Name.Substring(6,1);
  294. switch (name)
  295. {
  296. case "1":
  297. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas1Calculate = item.Calculate, Gas1SetPoint = item.Setpoint };
  298. break;
  299. case "2":
  300. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas2Calculate = item.Calculate, Gas2SetPoint = item.Setpoint };
  301. break;
  302. case "3":
  303. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas3Calculate = item.Calculate, Gas3SetPoint = item.Setpoint };
  304. break;
  305. case "4":
  306. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas4Calculate = item.Calculate, Gas4SetPoint = item.Setpoint };
  307. break;
  308. case "5":
  309. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas5Calculate = item.Calculate, Gas5SetPoint = item.Setpoint };
  310. break;
  311. case "6":
  312. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas6Calculate = item.Calculate, Gas6SetPoint = item.Setpoint };
  313. break;
  314. case "7":
  315. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas7Calculate = item.Calculate, Gas7SetPoint = item.Setpoint };
  316. break;
  317. case "8":
  318. MFCCalibrationOnePointDataRecords[0] = new MFCCalibrationTenPointsData { Gas8Calculate = item.Calculate, Gas8SetPoint = item.Setpoint };
  319. break;
  320. }
  321. }
  322. }
  323. private void InitTable()
  324. {
  325. var onePointData = QueryDataClient.Instance.Service.GetMFCVerificationOnePointData();
  326. if (onePointData != null)
  327. {
  328. var _onePointData = onePointData.Where(x => x.Module == ModuleName);
  329. VerificationDataOnePointRecords = new ObservableCollection<MFCVerificationOnePointData>(_onePointData);
  330. }
  331. var tenPointsData = QueryDataClient.Instance.Service.GetMFCVerificationTenPointsData();
  332. if (tenPointsData != null)
  333. {
  334. var _tenPointsData = tenPointsData.Where(x => x.Module == ModuleName);
  335. VerificationDataTenPointsRecords = new ObservableCollection<MFCVerificationTenPointsData>(_tenPointsData);
  336. }
  337. var data1 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas1").FirstOrDefault();
  338. if (data1 != null)
  339. {
  340. MFCCalibrationTenPointsDataRecords[0].Gas1SetPoint = data1.Percent10Setpoint;
  341. MFCCalibrationTenPointsDataRecords[0].Gas1Calculate = data1.Percent10Calculate;
  342. MFCCalibrationTenPointsDataRecords[1].Gas1SetPoint = data1.Percent20Setpoint;
  343. MFCCalibrationTenPointsDataRecords[1].Gas1Calculate = data1.Percent20Calculate;
  344. MFCCalibrationTenPointsDataRecords[2].Gas1SetPoint = data1.Percent30Setpoint;
  345. MFCCalibrationTenPointsDataRecords[2].Gas1Calculate = data1.Percent30Calculate;
  346. MFCCalibrationTenPointsDataRecords[3].Gas1SetPoint = data1.Percent40Setpoint;
  347. MFCCalibrationTenPointsDataRecords[3].Gas1Calculate = data1.Percent40Calculate;
  348. MFCCalibrationTenPointsDataRecords[4].Gas1SetPoint = data1.Percent50Setpoint;
  349. MFCCalibrationTenPointsDataRecords[4].Gas1Calculate = data1.Percent50Calculate;
  350. MFCCalibrationTenPointsDataRecords[5].Gas1SetPoint = data1.Percent60Setpoint;
  351. MFCCalibrationTenPointsDataRecords[5].Gas1Calculate = data1.Percent60Calculate;
  352. MFCCalibrationTenPointsDataRecords[6].Gas1SetPoint = data1.Percent70Setpoint;
  353. MFCCalibrationTenPointsDataRecords[6].Gas1Calculate = data1.Percent70Calculate;
  354. MFCCalibrationTenPointsDataRecords[7].Gas1SetPoint = data1.Percent80Setpoint;
  355. MFCCalibrationTenPointsDataRecords[7].Gas1Calculate = data1.Percent80Calculate;
  356. MFCCalibrationTenPointsDataRecords[8].Gas1SetPoint = data1.Percent90Setpoint;
  357. MFCCalibrationTenPointsDataRecords[8].Gas1Calculate = data1.Percent90Calculate;
  358. MFCCalibrationTenPointsDataRecords[9].Gas1SetPoint = data1.Percent100Setpoint;
  359. MFCCalibrationTenPointsDataRecords[9].Gas1Calculate = data1.Percent100Calculate;
  360. }
  361. var data2 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas2").FirstOrDefault();
  362. if (data2 != null)
  363. {
  364. MFCCalibrationTenPointsDataRecords[0].Gas2SetPoint = data2.Percent10Setpoint;
  365. MFCCalibrationTenPointsDataRecords[0].Gas2Calculate = data2.Percent10Calculate;
  366. MFCCalibrationTenPointsDataRecords[1].Gas2SetPoint = data2.Percent20Setpoint;
  367. MFCCalibrationTenPointsDataRecords[1].Gas2Calculate = data2.Percent20Calculate;
  368. MFCCalibrationTenPointsDataRecords[2].Gas2SetPoint = data2.Percent30Setpoint;
  369. MFCCalibrationTenPointsDataRecords[2].Gas2Calculate = data2.Percent30Calculate;
  370. MFCCalibrationTenPointsDataRecords[3].Gas2SetPoint = data2.Percent40Setpoint;
  371. MFCCalibrationTenPointsDataRecords[3].Gas2Calculate = data2.Percent40Calculate;
  372. MFCCalibrationTenPointsDataRecords[4].Gas2SetPoint = data2.Percent50Setpoint;
  373. MFCCalibrationTenPointsDataRecords[4].Gas2Calculate = data2.Percent50Calculate;
  374. MFCCalibrationTenPointsDataRecords[5].Gas2SetPoint = data2.Percent60Setpoint;
  375. MFCCalibrationTenPointsDataRecords[5].Gas2Calculate = data2.Percent60Calculate;
  376. MFCCalibrationTenPointsDataRecords[6].Gas2SetPoint = data2.Percent70Setpoint;
  377. MFCCalibrationTenPointsDataRecords[6].Gas2Calculate = data2.Percent70Calculate;
  378. MFCCalibrationTenPointsDataRecords[7].Gas2SetPoint = data2.Percent80Setpoint;
  379. MFCCalibrationTenPointsDataRecords[7].Gas2Calculate = data2.Percent80Calculate;
  380. MFCCalibrationTenPointsDataRecords[8].Gas2SetPoint = data2.Percent90Setpoint;
  381. MFCCalibrationTenPointsDataRecords[8].Gas2Calculate = data2.Percent90Calculate;
  382. MFCCalibrationTenPointsDataRecords[9].Gas2SetPoint = data2.Percent100Setpoint;
  383. MFCCalibrationTenPointsDataRecords[9].Gas2Calculate = data2.Percent100Calculate;
  384. }
  385. var data3 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas3").FirstOrDefault();
  386. if (data3 != null)
  387. {
  388. MFCCalibrationTenPointsDataRecords[0].Gas3SetPoint = data3.Percent10Setpoint;
  389. MFCCalibrationTenPointsDataRecords[0].Gas3Calculate = data3.Percent10Calculate;
  390. MFCCalibrationTenPointsDataRecords[1].Gas3SetPoint = data3.Percent20Setpoint;
  391. MFCCalibrationTenPointsDataRecords[1].Gas3Calculate = data3.Percent20Calculate;
  392. MFCCalibrationTenPointsDataRecords[2].Gas3SetPoint = data3.Percent30Setpoint;
  393. MFCCalibrationTenPointsDataRecords[2].Gas3Calculate = data3.Percent30Calculate;
  394. MFCCalibrationTenPointsDataRecords[3].Gas3SetPoint = data3.Percent40Setpoint;
  395. MFCCalibrationTenPointsDataRecords[3].Gas3Calculate = data3.Percent40Calculate;
  396. MFCCalibrationTenPointsDataRecords[4].Gas3SetPoint = data3.Percent50Setpoint;
  397. MFCCalibrationTenPointsDataRecords[4].Gas3Calculate = data3.Percent50Calculate;
  398. MFCCalibrationTenPointsDataRecords[5].Gas3SetPoint = data3.Percent60Setpoint;
  399. MFCCalibrationTenPointsDataRecords[5].Gas3Calculate = data3.Percent60Calculate;
  400. MFCCalibrationTenPointsDataRecords[6].Gas3SetPoint = data3.Percent70Setpoint;
  401. MFCCalibrationTenPointsDataRecords[6].Gas3Calculate = data3.Percent70Calculate;
  402. MFCCalibrationTenPointsDataRecords[7].Gas3SetPoint = data3.Percent80Setpoint;
  403. MFCCalibrationTenPointsDataRecords[7].Gas3Calculate = data3.Percent80Calculate;
  404. MFCCalibrationTenPointsDataRecords[8].Gas3SetPoint = data3.Percent90Setpoint;
  405. MFCCalibrationTenPointsDataRecords[8].Gas3Calculate = data3.Percent90Calculate;
  406. MFCCalibrationTenPointsDataRecords[9].Gas3SetPoint = data3.Percent100Setpoint;
  407. MFCCalibrationTenPointsDataRecords[9].Gas3Calculate = data3.Percent100Calculate;
  408. }
  409. var data4 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas4").FirstOrDefault();
  410. if (data4 != null)
  411. {
  412. MFCCalibrationTenPointsDataRecords[0].Gas4SetPoint = data4.Percent10Setpoint;
  413. MFCCalibrationTenPointsDataRecords[0].Gas4Calculate = data4.Percent10Calculate;
  414. MFCCalibrationTenPointsDataRecords[1].Gas4SetPoint = data4.Percent20Setpoint;
  415. MFCCalibrationTenPointsDataRecords[1].Gas4Calculate = data4.Percent20Calculate;
  416. MFCCalibrationTenPointsDataRecords[2].Gas4SetPoint = data4.Percent30Setpoint;
  417. MFCCalibrationTenPointsDataRecords[2].Gas4Calculate = data4.Percent30Calculate;
  418. MFCCalibrationTenPointsDataRecords[3].Gas4SetPoint = data4.Percent40Setpoint;
  419. MFCCalibrationTenPointsDataRecords[3].Gas4Calculate = data4.Percent40Calculate;
  420. MFCCalibrationTenPointsDataRecords[4].Gas4SetPoint = data4.Percent50Setpoint;
  421. MFCCalibrationTenPointsDataRecords[4].Gas4Calculate = data4.Percent50Calculate;
  422. MFCCalibrationTenPointsDataRecords[5].Gas4SetPoint = data4.Percent60Setpoint;
  423. MFCCalibrationTenPointsDataRecords[5].Gas4Calculate = data4.Percent60Calculate;
  424. MFCCalibrationTenPointsDataRecords[6].Gas4SetPoint = data4.Percent70Setpoint;
  425. MFCCalibrationTenPointsDataRecords[6].Gas4Calculate = data4.Percent70Calculate;
  426. MFCCalibrationTenPointsDataRecords[7].Gas4SetPoint = data4.Percent80Setpoint;
  427. MFCCalibrationTenPointsDataRecords[7].Gas4Calculate = data4.Percent80Calculate;
  428. MFCCalibrationTenPointsDataRecords[8].Gas4SetPoint = data4.Percent90Setpoint;
  429. MFCCalibrationTenPointsDataRecords[8].Gas4Calculate = data4.Percent90Calculate;
  430. MFCCalibrationTenPointsDataRecords[9].Gas4SetPoint = data4.Percent100Setpoint;
  431. MFCCalibrationTenPointsDataRecords[9].Gas4Calculate = data4.Percent100Calculate;
  432. }
  433. var data5= VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas5").FirstOrDefault();
  434. if (data5 != null)
  435. {
  436. MFCCalibrationTenPointsDataRecords[0].Gas5SetPoint = data5.Percent10Setpoint;
  437. MFCCalibrationTenPointsDataRecords[0].Gas5Calculate = data5.Percent10Calculate;
  438. MFCCalibrationTenPointsDataRecords[1].Gas5SetPoint = data5.Percent20Setpoint;
  439. MFCCalibrationTenPointsDataRecords[1].Gas5Calculate = data5.Percent20Calculate;
  440. MFCCalibrationTenPointsDataRecords[2].Gas5SetPoint = data5.Percent30Setpoint;
  441. MFCCalibrationTenPointsDataRecords[2].Gas5Calculate = data5.Percent30Calculate;
  442. MFCCalibrationTenPointsDataRecords[3].Gas5SetPoint = data5.Percent40Setpoint;
  443. MFCCalibrationTenPointsDataRecords[3].Gas5Calculate = data5.Percent40Calculate;
  444. MFCCalibrationTenPointsDataRecords[4].Gas5SetPoint = data5.Percent50Setpoint;
  445. MFCCalibrationTenPointsDataRecords[4].Gas5Calculate = data5.Percent50Calculate;
  446. MFCCalibrationTenPointsDataRecords[5].Gas5SetPoint = data5.Percent60Setpoint;
  447. MFCCalibrationTenPointsDataRecords[5].Gas5Calculate = data5.Percent60Calculate;
  448. MFCCalibrationTenPointsDataRecords[6].Gas5SetPoint = data5.Percent70Setpoint;
  449. MFCCalibrationTenPointsDataRecords[6].Gas5Calculate = data5.Percent70Calculate;
  450. MFCCalibrationTenPointsDataRecords[7].Gas5SetPoint = data5.Percent80Setpoint;
  451. MFCCalibrationTenPointsDataRecords[7].Gas5Calculate = data5.Percent80Calculate;
  452. MFCCalibrationTenPointsDataRecords[8].Gas5SetPoint = data5.Percent90Setpoint;
  453. MFCCalibrationTenPointsDataRecords[8].Gas5Calculate = data5.Percent90Calculate;
  454. MFCCalibrationTenPointsDataRecords[9].Gas5SetPoint = data5.Percent100Setpoint;
  455. MFCCalibrationTenPointsDataRecords[9].Gas5Calculate = data5.Percent100Calculate;
  456. }
  457. var data6 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas6").FirstOrDefault();
  458. if (data6 != null)
  459. {
  460. MFCCalibrationTenPointsDataRecords[0].Gas6SetPoint = data6.Percent10Setpoint;
  461. MFCCalibrationTenPointsDataRecords[0].Gas6Calculate = data6.Percent10Calculate;
  462. MFCCalibrationTenPointsDataRecords[1].Gas6SetPoint = data6.Percent20Setpoint;
  463. MFCCalibrationTenPointsDataRecords[1].Gas6Calculate = data6.Percent20Calculate;
  464. MFCCalibrationTenPointsDataRecords[2].Gas6SetPoint = data6.Percent30Setpoint;
  465. MFCCalibrationTenPointsDataRecords[2].Gas6Calculate = data6.Percent30Calculate;
  466. MFCCalibrationTenPointsDataRecords[3].Gas6SetPoint = data6.Percent40Setpoint;
  467. MFCCalibrationTenPointsDataRecords[3].Gas6Calculate = data6.Percent40Calculate;
  468. MFCCalibrationTenPointsDataRecords[4].Gas6SetPoint = data6.Percent50Setpoint;
  469. MFCCalibrationTenPointsDataRecords[4].Gas6Calculate = data6.Percent50Calculate;
  470. MFCCalibrationTenPointsDataRecords[5].Gas6SetPoint = data6.Percent60Setpoint;
  471. MFCCalibrationTenPointsDataRecords[5].Gas6Calculate = data6.Percent60Calculate;
  472. MFCCalibrationTenPointsDataRecords[6].Gas6SetPoint = data6.Percent70Setpoint;
  473. MFCCalibrationTenPointsDataRecords[6].Gas6Calculate = data6.Percent70Calculate;
  474. MFCCalibrationTenPointsDataRecords[7].Gas6SetPoint = data6.Percent80Setpoint;
  475. MFCCalibrationTenPointsDataRecords[7].Gas6Calculate = data6.Percent80Calculate;
  476. MFCCalibrationTenPointsDataRecords[8].Gas6SetPoint = data6.Percent90Setpoint;
  477. MFCCalibrationTenPointsDataRecords[8].Gas6Calculate = data6.Percent90Calculate;
  478. MFCCalibrationTenPointsDataRecords[9].Gas6SetPoint = data6.Percent100Setpoint;
  479. MFCCalibrationTenPointsDataRecords[9].Gas6Calculate = data6.Percent100Calculate;
  480. }
  481. var data7 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas7").FirstOrDefault();
  482. if (data7 != null)
  483. {
  484. MFCCalibrationTenPointsDataRecords[0].Gas7SetPoint = data7.Percent10Setpoint;
  485. MFCCalibrationTenPointsDataRecords[0].Gas7Calculate = data7.Percent10Calculate;
  486. MFCCalibrationTenPointsDataRecords[1].Gas7SetPoint = data7.Percent20Setpoint;
  487. MFCCalibrationTenPointsDataRecords[1].Gas7Calculate = data7.Percent20Calculate;
  488. MFCCalibrationTenPointsDataRecords[2].Gas7SetPoint = data7.Percent30Setpoint;
  489. MFCCalibrationTenPointsDataRecords[2].Gas7Calculate = data7.Percent30Calculate;
  490. MFCCalibrationTenPointsDataRecords[3].Gas7SetPoint = data7.Percent40Setpoint;
  491. MFCCalibrationTenPointsDataRecords[3].Gas7Calculate = data7.Percent40Calculate;
  492. MFCCalibrationTenPointsDataRecords[4].Gas7SetPoint = data7.Percent50Setpoint;
  493. MFCCalibrationTenPointsDataRecords[4].Gas7Calculate = data7.Percent50Calculate;
  494. MFCCalibrationTenPointsDataRecords[5].Gas7SetPoint = data7.Percent60Setpoint;
  495. MFCCalibrationTenPointsDataRecords[5].Gas7Calculate = data7.Percent60Calculate;
  496. MFCCalibrationTenPointsDataRecords[6].Gas7SetPoint = data7.Percent70Setpoint;
  497. MFCCalibrationTenPointsDataRecords[6].Gas7Calculate = data7.Percent70Calculate;
  498. MFCCalibrationTenPointsDataRecords[7].Gas7SetPoint = data7.Percent80Setpoint;
  499. MFCCalibrationTenPointsDataRecords[7].Gas7Calculate = data7.Percent80Calculate;
  500. MFCCalibrationTenPointsDataRecords[8].Gas7SetPoint = data7.Percent90Setpoint;
  501. MFCCalibrationTenPointsDataRecords[8].Gas7Calculate = data7.Percent90Calculate;
  502. MFCCalibrationTenPointsDataRecords[9].Gas7SetPoint = data7.Percent100Setpoint;
  503. MFCCalibrationTenPointsDataRecords[9].Gas7Calculate = data7.Percent100Calculate;
  504. }
  505. var data8 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas8").FirstOrDefault();
  506. if (data8 != null)
  507. {
  508. MFCCalibrationTenPointsDataRecords[0].Gas8SetPoint = data8.Percent10Setpoint;
  509. MFCCalibrationTenPointsDataRecords[0].Gas8Calculate = data8.Percent10Calculate;
  510. MFCCalibrationTenPointsDataRecords[1].Gas8SetPoint = data8.Percent20Setpoint;
  511. MFCCalibrationTenPointsDataRecords[1].Gas8Calculate = data8.Percent20Calculate;
  512. MFCCalibrationTenPointsDataRecords[2].Gas8SetPoint = data8.Percent30Setpoint;
  513. MFCCalibrationTenPointsDataRecords[2].Gas8Calculate = data8.Percent30Calculate;
  514. MFCCalibrationTenPointsDataRecords[3].Gas8SetPoint = data8.Percent40Setpoint;
  515. MFCCalibrationTenPointsDataRecords[3].Gas8Calculate = data8.Percent40Calculate;
  516. MFCCalibrationTenPointsDataRecords[4].Gas8SetPoint = data8.Percent50Setpoint;
  517. MFCCalibrationTenPointsDataRecords[4].Gas8Calculate = data8.Percent50Calculate;
  518. MFCCalibrationTenPointsDataRecords[5].Gas8SetPoint = data8.Percent60Setpoint;
  519. MFCCalibrationTenPointsDataRecords[5].Gas8Calculate = data8.Percent60Calculate;
  520. MFCCalibrationTenPointsDataRecords[6].Gas8SetPoint = data8.Percent70Setpoint;
  521. MFCCalibrationTenPointsDataRecords[6].Gas8Calculate = data8.Percent70Calculate;
  522. MFCCalibrationTenPointsDataRecords[7].Gas8SetPoint = data8.Percent80Setpoint;
  523. MFCCalibrationTenPointsDataRecords[7].Gas8Calculate = data8.Percent80Calculate;
  524. MFCCalibrationTenPointsDataRecords[8].Gas8SetPoint = data8.Percent90Setpoint;
  525. MFCCalibrationTenPointsDataRecords[8].Gas8Calculate = data8.Percent90Calculate;
  526. MFCCalibrationTenPointsDataRecords[9].Gas8SetPoint = data8.Percent100Setpoint;
  527. MFCCalibrationTenPointsDataRecords[9].Gas8Calculate = data8.Percent100Calculate;
  528. }
  529. var onePointdata1 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas1").FirstOrDefault();
  530. if (onePointdata1 != null)
  531. {
  532. MFCCalibrationOnePointDataRecords[0].Gas1SetPoint = onePointdata1.Setpoint;
  533. MFCCalibrationOnePointDataRecords[0].Gas1Calculate = onePointdata1.Calculate;
  534. }
  535. var onePointdata2 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas2").FirstOrDefault();
  536. if (onePointdata2 != null)
  537. {
  538. MFCCalibrationOnePointDataRecords[0].Gas2SetPoint = onePointdata2.Setpoint;
  539. MFCCalibrationOnePointDataRecords[0].Gas2Calculate = onePointdata2.Calculate;
  540. }
  541. var onePointdata3 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas3").FirstOrDefault();
  542. if (onePointdata3 != null)
  543. {
  544. MFCCalibrationOnePointDataRecords[0].Gas3SetPoint = onePointdata3.Setpoint;
  545. MFCCalibrationOnePointDataRecords[0].Gas3Calculate = onePointdata3.Calculate;
  546. }
  547. var onePointdata4 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas4").FirstOrDefault();
  548. if (onePointdata4 != null)
  549. {
  550. MFCCalibrationOnePointDataRecords[0].Gas4SetPoint = onePointdata4.Setpoint;
  551. MFCCalibrationOnePointDataRecords[0].Gas4Calculate = onePointdata4.Calculate;
  552. }
  553. var onePointdata5 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas5").FirstOrDefault();
  554. if (onePointdata5 != null)
  555. {
  556. MFCCalibrationOnePointDataRecords[0].Gas5SetPoint = onePointdata5.Setpoint;
  557. MFCCalibrationOnePointDataRecords[0].Gas5Calculate = onePointdata5.Calculate;
  558. }
  559. var onePointdata6 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas6").FirstOrDefault();
  560. if (onePointdata6 != null)
  561. {
  562. MFCCalibrationOnePointDataRecords[0].Gas6SetPoint = onePointdata6.Setpoint;
  563. MFCCalibrationOnePointDataRecords[0].Gas6Calculate = onePointdata6.Calculate;
  564. }
  565. var onePointdata7 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas7").FirstOrDefault();
  566. if (onePointdata7 != null)
  567. {
  568. MFCCalibrationOnePointDataRecords[0].Gas7SetPoint = onePointdata7.Setpoint;
  569. MFCCalibrationOnePointDataRecords[0].Gas7Calculate = onePointdata7.Calculate;
  570. }
  571. var onePointdata8 = VerificationDataOnePointRecords.Where(x => x.Name == $"MfcGas8").FirstOrDefault();
  572. if (onePointdata8 != null)
  573. {
  574. MFCCalibrationOnePointDataRecords[0].Gas8SetPoint = onePointdata8.Setpoint;
  575. MFCCalibrationOnePointDataRecords[0].Gas8Calculate = onePointdata8.Calculate;
  576. }
  577. }
  578. #endregion
  579. }
  580. }