MFCVerificationViewModel.cs 30 KB

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