MFCVerificationViewModel.cs 31 KB

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