MFCVerificationViewModel.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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.Threading;
  8. using Aitex.Core.Common.DeviceData;
  9. using MECF.Framework.Common.DataCenter;
  10. using MECF.Framework.Common.DBCore;
  11. using MECF.Framework.Common.OperationCenter;
  12. using Prism.Commands;
  13. using Prism.Mvvm;
  14. using Venus_Core;
  15. using Venus_MainPages.Unity;
  16. using Venus_MainPages.Views;
  17. namespace Venus_MainPages.ViewModels
  18. {
  19. public class MFCVerificationViewModel : BindableBase
  20. {
  21. #region 私有字段
  22. private AITMfcData m_MFCData;
  23. //private AITMfcData m_MFC1Data;
  24. //private AITMfcData m_MFC2Data;
  25. //private AITMfcData m_MFC3Data;
  26. //private AITMfcData m_MFC4Data;
  27. //private AITMfcData m_MFC5Data;
  28. //private AITMfcData m_MFC6Data;
  29. //private AITMfcData m_MFC7Data;
  30. //private AITMfcData m_MFC8Data;
  31. private Dictionary<string, object> m_RtDataValues;
  32. public string ModuleName;
  33. private ObservableCollection<int> m_MFCVerificationPoints = new ObservableCollection<int>();
  34. private int m_GasSelectedIndex;
  35. private int m_PointsSelectedIndex;
  36. DispatcherTimer timer = new DispatcherTimer();
  37. private ObservableCollection<MFCCalibrationData> m_MFCVerificationData=new ObservableCollection<MFCCalibrationData>();
  38. private ObservableCollection<MFCVerificationData> m_VerificationDataRecords = new ObservableCollection<MFCVerificationData>();
  39. private ObservableCollection<MFCVerificationOnePointData> m_VerificationOnePointDataRecords = new ObservableCollection<MFCVerificationOnePointData>();
  40. private ObservableCollection<MFCVerificationTenPointsData> m_VerificationTenPointsDataRecords = new ObservableCollection<MFCVerificationTenPointsData>();
  41. private ObservableCollection<MFCCalibrationTenPointsData> m_MFCCalibrationTenPointsData = new ObservableCollection<MFCCalibrationTenPointsData>();
  42. private PMState m_PMCurrentState;
  43. public PMState PMCurrentState
  44. {
  45. get { return m_PMCurrentState; }
  46. set
  47. {
  48. if ((m_PMCurrentState == PMState.MFCVerification || m_PMCurrentState == PMState.AllMFCVerification) && value == PMState.Idle)
  49. {
  50. InitTable();
  51. }
  52. SetProperty(ref m_PMCurrentState, value);
  53. }
  54. }
  55. #endregion
  56. #region 属性
  57. public ObservableCollection<int> MFCVerificationPoints
  58. {
  59. get { return m_MFCVerificationPoints; }
  60. set
  61. {
  62. SetProperty(ref m_MFCVerificationPoints, value);
  63. }
  64. }
  65. public Dictionary<string, object> RtDataValues
  66. {
  67. get { return m_RtDataValues; }
  68. set { SetProperty(ref m_RtDataValues, value); }
  69. }
  70. public AITMfcData MFCData
  71. {
  72. get { return m_MFCData; }
  73. set { SetProperty(ref m_MFCData, value); }
  74. }
  75. //public AITMfcData MFC1Data
  76. //{
  77. // get { return m_MFC1Data; }
  78. // set { SetProperty(ref m_MFC1Data, value); }
  79. //}
  80. //public AITMfcData MFC2Data
  81. //{
  82. // get { return m_MFC2Data; }
  83. // set { SetProperty(ref m_MFC2Data, value); }
  84. //}
  85. //public AITMfcData MFC3Data
  86. //{
  87. // get { return m_MFC3Data; }
  88. // set { SetProperty(ref m_MFC3Data, value); }
  89. //}
  90. //public AITMfcData MFC4Data
  91. //{
  92. // get { return m_MFC4Data; }
  93. // set { SetProperty(ref m_MFC4Data, value); }
  94. //}
  95. //public AITMfcData MFC5Data
  96. //{
  97. // get { return m_MFC5Data; }
  98. // set { SetProperty(ref m_MFC5Data, value); }
  99. //}
  100. //public AITMfcData MFC6Data
  101. //{
  102. // get { return m_MFC6Data; }
  103. // set { SetProperty(ref m_MFC6Data, value); }
  104. //}
  105. //public AITMfcData MFC7Data
  106. //{
  107. // get { return m_MFC7Data; }
  108. // set { SetProperty(ref m_MFC7Data, value); }
  109. //}
  110. //public AITMfcData MFC8Data
  111. //{
  112. // get { return m_MFC8Data; }
  113. // set { SetProperty(ref m_MFC8Data, value); }
  114. //}
  115. public int GasSelectedIndex
  116. {
  117. get { return m_GasSelectedIndex; }
  118. set { SetProperty(ref m_GasSelectedIndex, value); }
  119. }
  120. public int PointsSelectedIndex
  121. {
  122. get { return m_PointsSelectedIndex; }
  123. set { SetProperty(ref m_PointsSelectedIndex, value); }
  124. }
  125. public ObservableCollection<MFCCalibrationData> MFCCalibrationData
  126. {
  127. get { return m_MFCVerificationData; }
  128. set { SetProperty(ref m_MFCVerificationData, value); }
  129. }
  130. public ObservableCollection<MFCVerificationData> VerificationDataRecords
  131. {
  132. get { return m_VerificationDataRecords; }
  133. set { SetProperty(ref m_VerificationDataRecords, value); }
  134. }
  135. public ObservableCollection<MFCVerificationOnePointData> VerificationDataOnePointRecords
  136. {
  137. get { return m_VerificationOnePointDataRecords; }
  138. set { SetProperty(ref m_VerificationOnePointDataRecords, value); }
  139. }
  140. public ObservableCollection<MFCVerificationTenPointsData> VerificationDataTenPointsRecords
  141. {
  142. get { return m_VerificationTenPointsDataRecords; }
  143. set { SetProperty(ref m_VerificationTenPointsDataRecords, value); }
  144. }
  145. public ObservableCollection<MFCCalibrationTenPointsData> MFCCalibrationTenPointsDataRecords
  146. {
  147. get { return m_MFCCalibrationTenPointsData; }
  148. set { SetProperty(ref m_MFCCalibrationTenPointsData, 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 _SelectGasCommand;
  162. public DelegateCommand SelectGasCommand =>
  163. _SelectGasCommand ?? (_SelectGasCommand = new DelegateCommand(OnSelectGas));
  164. private DelegateCommand _LoadCommand;
  165. public DelegateCommand LoadCommand =>
  166. _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
  167. #endregion
  168. public MFCVerificationViewModel()
  169. {
  170. timer.Interval = TimeSpan.FromSeconds(1);
  171. timer.Tick += Timer_Tick;
  172. timer.Start();
  173. for (int i = 0; i < 10; i++)
  174. {
  175. MFCCalibrationTenPointsDataRecords.Add(new MFCCalibrationTenPointsData());
  176. }
  177. }
  178. #region 命令方法
  179. private void OnStartOnePointVerification(object obj)
  180. {
  181. var values = (object[])obj;
  182. string gasName = values[0].ToString();
  183. float flow = float.Parse(values[1].ToString());
  184. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.MFCVerification}", gasName, flow, 1);
  185. }
  186. private void OnStartTenPointVerification(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, 10);
  192. }
  193. public void OnAbort()
  194. {
  195. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort");
  196. }
  197. private void OnSelectGas()
  198. {
  199. MFCVerificationPoints.Clear();
  200. MFCData = (AITMfcData)QueryDataClient.Instance.Service.GetData($"{ModuleName}.MfcGas{(GasSelectedIndex + 1).ToString()}");
  201. if ( MFCData != null )
  202. {
  203. int delta1 = (int)MFCData.Scale / 10;
  204. for (int i = 0; i < 10; i++)
  205. {
  206. MFCVerificationPoints.Add(delta1 + delta1 * i);
  207. }
  208. PointsSelectedIndex = 0;
  209. }
  210. }
  211. //private void OnQuery()
  212. //{
  213. // var AllLeakCheckDa = QueryDataClient.Instance.Service.GetMFCVerificationData(this.view.wfTimeFrom.Value, this.view.wfTimeTo.Value);
  214. // if (AllLeakCheckDa != null)
  215. // {
  216. // VerificationDataRecords = new ObservableCollection<MFCVerificationData>(AllLeakCheckDa);
  217. // }
  218. //}
  219. private void OnLoad()
  220. {
  221. InitTable();
  222. }
  223. #endregion
  224. #region 私有方法
  225. private void Timer_Tick(object sender, EventArgs e)
  226. {
  227. //MFCCalibrationData =(ObservableCollection<MFCCalibrationData>) QueryDataClient.Instance.Service.GetData($"{ModuleName}.MFCCalibrationDatas");
  228. PMCurrentState = (PMState)QueryDataClient.Instance.Service.GetData($"{ModuleName}.FsmState");
  229. }
  230. public void Init()
  231. {
  232. OnSelectGas();
  233. }
  234. private void InitTable()
  235. {
  236. var onePointData = QueryDataClient.Instance.Service.GetMFCVerificationOnePointData();
  237. if (onePointData != null)
  238. {
  239. VerificationDataOnePointRecords = new ObservableCollection<MFCVerificationOnePointData>(onePointData);
  240. }
  241. var tenPointsData = QueryDataClient.Instance.Service.GetMFCVerificationTenPointsData();
  242. if (tenPointsData != null)
  243. {
  244. VerificationDataTenPointsRecords = new ObservableCollection<MFCVerificationTenPointsData>(tenPointsData);
  245. }
  246. var data1 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas1").FirstOrDefault();
  247. if (data1 != null)
  248. {
  249. MFCCalibrationTenPointsDataRecords[0].Gas1SetPoint = data1.Percent10Setpoint;
  250. MFCCalibrationTenPointsDataRecords[0].Gas1Calculate = data1.Percent10Calculate;
  251. MFCCalibrationTenPointsDataRecords[1].Gas1SetPoint = data1.Percent20Setpoint;
  252. MFCCalibrationTenPointsDataRecords[1].Gas1Calculate = data1.Percent20Calculate;
  253. MFCCalibrationTenPointsDataRecords[2].Gas1SetPoint = data1.Percent30Setpoint;
  254. MFCCalibrationTenPointsDataRecords[2].Gas1Calculate = data1.Percent30Calculate;
  255. MFCCalibrationTenPointsDataRecords[3].Gas1SetPoint = data1.Percent40Setpoint;
  256. MFCCalibrationTenPointsDataRecords[3].Gas1Calculate = data1.Percent40Calculate;
  257. MFCCalibrationTenPointsDataRecords[4].Gas1SetPoint = data1.Percent50Setpoint;
  258. MFCCalibrationTenPointsDataRecords[4].Gas1Calculate = data1.Percent50Calculate;
  259. MFCCalibrationTenPointsDataRecords[5].Gas1SetPoint = data1.Percent60Setpoint;
  260. MFCCalibrationTenPointsDataRecords[5].Gas1Calculate = data1.Percent60Calculate;
  261. MFCCalibrationTenPointsDataRecords[6].Gas1SetPoint = data1.Percent70Setpoint;
  262. MFCCalibrationTenPointsDataRecords[6].Gas1Calculate = data1.Percent70Calculate;
  263. MFCCalibrationTenPointsDataRecords[7].Gas1SetPoint = data1.Percent80Setpoint;
  264. MFCCalibrationTenPointsDataRecords[7].Gas1Calculate = data1.Percent80Calculate;
  265. MFCCalibrationTenPointsDataRecords[8].Gas1SetPoint = data1.Percent90Setpoint;
  266. MFCCalibrationTenPointsDataRecords[8].Gas1Calculate = data1.Percent90Calculate;
  267. MFCCalibrationTenPointsDataRecords[9].Gas1SetPoint = data1.Percent100Setpoint;
  268. MFCCalibrationTenPointsDataRecords[9].Gas1Calculate = data1.Percent100Calculate;
  269. }
  270. var data2 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas2").FirstOrDefault();
  271. if (data2 != null)
  272. {
  273. MFCCalibrationTenPointsDataRecords[0].Gas2SetPoint = data2.Percent10Setpoint;
  274. MFCCalibrationTenPointsDataRecords[0].Gas2Calculate = data2.Percent10Calculate;
  275. MFCCalibrationTenPointsDataRecords[1].Gas2SetPoint = data2.Percent20Setpoint;
  276. MFCCalibrationTenPointsDataRecords[1].Gas2Calculate = data2.Percent20Calculate;
  277. MFCCalibrationTenPointsDataRecords[2].Gas2SetPoint = data2.Percent30Setpoint;
  278. MFCCalibrationTenPointsDataRecords[2].Gas2Calculate = data2.Percent30Calculate;
  279. MFCCalibrationTenPointsDataRecords[3].Gas2SetPoint = data2.Percent40Setpoint;
  280. MFCCalibrationTenPointsDataRecords[3].Gas2Calculate = data2.Percent40Calculate;
  281. MFCCalibrationTenPointsDataRecords[4].Gas2SetPoint = data2.Percent50Setpoint;
  282. MFCCalibrationTenPointsDataRecords[4].Gas2Calculate = data2.Percent50Calculate;
  283. MFCCalibrationTenPointsDataRecords[5].Gas2SetPoint = data2.Percent60Setpoint;
  284. MFCCalibrationTenPointsDataRecords[5].Gas2Calculate = data2.Percent60Calculate;
  285. MFCCalibrationTenPointsDataRecords[6].Gas2SetPoint = data2.Percent70Setpoint;
  286. MFCCalibrationTenPointsDataRecords[6].Gas2Calculate = data2.Percent70Calculate;
  287. MFCCalibrationTenPointsDataRecords[7].Gas2SetPoint = data2.Percent80Setpoint;
  288. MFCCalibrationTenPointsDataRecords[7].Gas2Calculate = data2.Percent80Calculate;
  289. MFCCalibrationTenPointsDataRecords[8].Gas2SetPoint = data2.Percent90Setpoint;
  290. MFCCalibrationTenPointsDataRecords[8].Gas2Calculate = data2.Percent90Calculate;
  291. MFCCalibrationTenPointsDataRecords[9].Gas2SetPoint = data2.Percent100Setpoint;
  292. MFCCalibrationTenPointsDataRecords[9].Gas2Calculate = data2.Percent100Calculate;
  293. }
  294. var data3 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas3").FirstOrDefault();
  295. if (data3 != null)
  296. {
  297. MFCCalibrationTenPointsDataRecords[0].Gas3SetPoint = data3.Percent10Setpoint;
  298. MFCCalibrationTenPointsDataRecords[0].Gas3Calculate = data3.Percent10Calculate;
  299. MFCCalibrationTenPointsDataRecords[1].Gas3SetPoint = data3.Percent20Setpoint;
  300. MFCCalibrationTenPointsDataRecords[1].Gas3Calculate = data3.Percent20Calculate;
  301. MFCCalibrationTenPointsDataRecords[2].Gas3SetPoint = data3.Percent30Setpoint;
  302. MFCCalibrationTenPointsDataRecords[2].Gas3Calculate = data3.Percent30Calculate;
  303. MFCCalibrationTenPointsDataRecords[3].Gas3SetPoint = data3.Percent40Setpoint;
  304. MFCCalibrationTenPointsDataRecords[3].Gas3Calculate = data3.Percent40Calculate;
  305. MFCCalibrationTenPointsDataRecords[4].Gas3SetPoint = data3.Percent50Setpoint;
  306. MFCCalibrationTenPointsDataRecords[4].Gas3Calculate = data3.Percent50Calculate;
  307. MFCCalibrationTenPointsDataRecords[5].Gas3SetPoint = data3.Percent60Setpoint;
  308. MFCCalibrationTenPointsDataRecords[5].Gas3Calculate = data3.Percent60Calculate;
  309. MFCCalibrationTenPointsDataRecords[6].Gas3SetPoint = data3.Percent70Setpoint;
  310. MFCCalibrationTenPointsDataRecords[6].Gas3Calculate = data3.Percent70Calculate;
  311. MFCCalibrationTenPointsDataRecords[7].Gas3SetPoint = data3.Percent80Setpoint;
  312. MFCCalibrationTenPointsDataRecords[7].Gas3Calculate = data3.Percent80Calculate;
  313. MFCCalibrationTenPointsDataRecords[8].Gas3SetPoint = data3.Percent90Setpoint;
  314. MFCCalibrationTenPointsDataRecords[8].Gas3Calculate = data3.Percent90Calculate;
  315. MFCCalibrationTenPointsDataRecords[9].Gas3SetPoint = data3.Percent100Setpoint;
  316. MFCCalibrationTenPointsDataRecords[9].Gas3Calculate = data3.Percent100Calculate;
  317. }
  318. var data4 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas4").FirstOrDefault();
  319. if (data4 != null)
  320. {
  321. MFCCalibrationTenPointsDataRecords[0].Gas4SetPoint = data4.Percent10Setpoint;
  322. MFCCalibrationTenPointsDataRecords[0].Gas4Calculate = data4.Percent10Calculate;
  323. MFCCalibrationTenPointsDataRecords[1].Gas4SetPoint = data4.Percent20Setpoint;
  324. MFCCalibrationTenPointsDataRecords[1].Gas4Calculate = data4.Percent20Calculate;
  325. MFCCalibrationTenPointsDataRecords[2].Gas4SetPoint = data4.Percent30Setpoint;
  326. MFCCalibrationTenPointsDataRecords[2].Gas4Calculate = data4.Percent30Calculate;
  327. MFCCalibrationTenPointsDataRecords[3].Gas4SetPoint = data4.Percent40Setpoint;
  328. MFCCalibrationTenPointsDataRecords[3].Gas4Calculate = data4.Percent40Calculate;
  329. MFCCalibrationTenPointsDataRecords[4].Gas4SetPoint = data4.Percent50Setpoint;
  330. MFCCalibrationTenPointsDataRecords[4].Gas4Calculate = data4.Percent50Calculate;
  331. MFCCalibrationTenPointsDataRecords[5].Gas4SetPoint = data4.Percent60Setpoint;
  332. MFCCalibrationTenPointsDataRecords[5].Gas4Calculate = data4.Percent60Calculate;
  333. MFCCalibrationTenPointsDataRecords[6].Gas4SetPoint = data4.Percent70Setpoint;
  334. MFCCalibrationTenPointsDataRecords[6].Gas4Calculate = data4.Percent70Calculate;
  335. MFCCalibrationTenPointsDataRecords[7].Gas4SetPoint = data4.Percent80Setpoint;
  336. MFCCalibrationTenPointsDataRecords[7].Gas4Calculate = data4.Percent80Calculate;
  337. MFCCalibrationTenPointsDataRecords[8].Gas4SetPoint = data4.Percent90Setpoint;
  338. MFCCalibrationTenPointsDataRecords[8].Gas4Calculate = data4.Percent90Calculate;
  339. MFCCalibrationTenPointsDataRecords[9].Gas4SetPoint = data4.Percent100Setpoint;
  340. MFCCalibrationTenPointsDataRecords[9].Gas4Calculate = data4.Percent100Calculate;
  341. }
  342. var data5= VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas5").FirstOrDefault();
  343. if (data5 != null)
  344. {
  345. MFCCalibrationTenPointsDataRecords[0].Gas5SetPoint = data5.Percent10Setpoint;
  346. MFCCalibrationTenPointsDataRecords[0].Gas5Calculate = data5.Percent10Calculate;
  347. MFCCalibrationTenPointsDataRecords[1].Gas5SetPoint = data5.Percent20Setpoint;
  348. MFCCalibrationTenPointsDataRecords[1].Gas5Calculate = data5.Percent20Calculate;
  349. MFCCalibrationTenPointsDataRecords[2].Gas5SetPoint = data5.Percent30Setpoint;
  350. MFCCalibrationTenPointsDataRecords[2].Gas5Calculate = data5.Percent30Calculate;
  351. MFCCalibrationTenPointsDataRecords[3].Gas5SetPoint = data5.Percent40Setpoint;
  352. MFCCalibrationTenPointsDataRecords[3].Gas5Calculate = data5.Percent40Calculate;
  353. MFCCalibrationTenPointsDataRecords[4].Gas5SetPoint = data5.Percent50Setpoint;
  354. MFCCalibrationTenPointsDataRecords[4].Gas5Calculate = data5.Percent50Calculate;
  355. MFCCalibrationTenPointsDataRecords[5].Gas5SetPoint = data5.Percent60Setpoint;
  356. MFCCalibrationTenPointsDataRecords[5].Gas5Calculate = data5.Percent60Calculate;
  357. MFCCalibrationTenPointsDataRecords[6].Gas5SetPoint = data5.Percent70Setpoint;
  358. MFCCalibrationTenPointsDataRecords[6].Gas5Calculate = data5.Percent70Calculate;
  359. MFCCalibrationTenPointsDataRecords[7].Gas5SetPoint = data5.Percent80Setpoint;
  360. MFCCalibrationTenPointsDataRecords[7].Gas5Calculate = data5.Percent80Calculate;
  361. MFCCalibrationTenPointsDataRecords[8].Gas5SetPoint = data5.Percent90Setpoint;
  362. MFCCalibrationTenPointsDataRecords[8].Gas5Calculate = data5.Percent90Calculate;
  363. MFCCalibrationTenPointsDataRecords[9].Gas5SetPoint = data5.Percent100Setpoint;
  364. MFCCalibrationTenPointsDataRecords[9].Gas5Calculate = data5.Percent100Calculate;
  365. }
  366. var data6 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas6").FirstOrDefault();
  367. if (data6 != null)
  368. {
  369. MFCCalibrationTenPointsDataRecords[0].Gas6SetPoint = data6.Percent10Setpoint;
  370. MFCCalibrationTenPointsDataRecords[0].Gas6Calculate = data6.Percent10Calculate;
  371. MFCCalibrationTenPointsDataRecords[1].Gas6SetPoint = data6.Percent20Setpoint;
  372. MFCCalibrationTenPointsDataRecords[1].Gas6Calculate = data6.Percent20Calculate;
  373. MFCCalibrationTenPointsDataRecords[2].Gas6SetPoint = data6.Percent30Setpoint;
  374. MFCCalibrationTenPointsDataRecords[2].Gas6Calculate = data6.Percent30Calculate;
  375. MFCCalibrationTenPointsDataRecords[3].Gas6SetPoint = data6.Percent40Setpoint;
  376. MFCCalibrationTenPointsDataRecords[3].Gas6Calculate = data6.Percent40Calculate;
  377. MFCCalibrationTenPointsDataRecords[4].Gas6SetPoint = data6.Percent50Setpoint;
  378. MFCCalibrationTenPointsDataRecords[4].Gas6Calculate = data6.Percent50Calculate;
  379. MFCCalibrationTenPointsDataRecords[5].Gas6SetPoint = data6.Percent60Setpoint;
  380. MFCCalibrationTenPointsDataRecords[5].Gas6Calculate = data6.Percent60Calculate;
  381. MFCCalibrationTenPointsDataRecords[6].Gas6SetPoint = data6.Percent70Setpoint;
  382. MFCCalibrationTenPointsDataRecords[6].Gas6Calculate = data6.Percent70Calculate;
  383. MFCCalibrationTenPointsDataRecords[7].Gas6SetPoint = data6.Percent80Setpoint;
  384. MFCCalibrationTenPointsDataRecords[7].Gas6Calculate = data6.Percent80Calculate;
  385. MFCCalibrationTenPointsDataRecords[8].Gas6SetPoint = data6.Percent90Setpoint;
  386. MFCCalibrationTenPointsDataRecords[8].Gas6Calculate = data6.Percent90Calculate;
  387. MFCCalibrationTenPointsDataRecords[9].Gas6SetPoint = data6.Percent100Setpoint;
  388. MFCCalibrationTenPointsDataRecords[9].Gas6Calculate = data6.Percent100Calculate;
  389. }
  390. var data7 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas7").FirstOrDefault();
  391. if (data7 != null)
  392. {
  393. MFCCalibrationTenPointsDataRecords[0].Gas7SetPoint = data7.Percent10Setpoint;
  394. MFCCalibrationTenPointsDataRecords[0].Gas7Calculate = data7.Percent10Calculate;
  395. MFCCalibrationTenPointsDataRecords[1].Gas7SetPoint = data7.Percent20Setpoint;
  396. MFCCalibrationTenPointsDataRecords[1].Gas7Calculate = data7.Percent20Calculate;
  397. MFCCalibrationTenPointsDataRecords[2].Gas7SetPoint = data7.Percent30Setpoint;
  398. MFCCalibrationTenPointsDataRecords[2].Gas7Calculate = data7.Percent30Calculate;
  399. MFCCalibrationTenPointsDataRecords[3].Gas7SetPoint = data7.Percent40Setpoint;
  400. MFCCalibrationTenPointsDataRecords[3].Gas7Calculate = data7.Percent40Calculate;
  401. MFCCalibrationTenPointsDataRecords[4].Gas7SetPoint = data7.Percent50Setpoint;
  402. MFCCalibrationTenPointsDataRecords[4].Gas7Calculate = data7.Percent50Calculate;
  403. MFCCalibrationTenPointsDataRecords[5].Gas7SetPoint = data7.Percent60Setpoint;
  404. MFCCalibrationTenPointsDataRecords[5].Gas7Calculate = data7.Percent60Calculate;
  405. MFCCalibrationTenPointsDataRecords[6].Gas7SetPoint = data7.Percent70Setpoint;
  406. MFCCalibrationTenPointsDataRecords[6].Gas7Calculate = data7.Percent70Calculate;
  407. MFCCalibrationTenPointsDataRecords[7].Gas7SetPoint = data7.Percent80Setpoint;
  408. MFCCalibrationTenPointsDataRecords[7].Gas7Calculate = data7.Percent80Calculate;
  409. MFCCalibrationTenPointsDataRecords[8].Gas7SetPoint = data7.Percent90Setpoint;
  410. MFCCalibrationTenPointsDataRecords[8].Gas7Calculate = data7.Percent90Calculate;
  411. MFCCalibrationTenPointsDataRecords[9].Gas7SetPoint = data7.Percent100Setpoint;
  412. MFCCalibrationTenPointsDataRecords[9].Gas7Calculate = data7.Percent100Calculate;
  413. }
  414. var data8 = VerificationDataTenPointsRecords.Where(x => x.Name == $"MfcGas8").FirstOrDefault();
  415. if (data8 != null)
  416. {
  417. MFCCalibrationTenPointsDataRecords[0].Gas8SetPoint = data8.Percent10Setpoint;
  418. MFCCalibrationTenPointsDataRecords[0].Gas8Calculate = data8.Percent10Calculate;
  419. MFCCalibrationTenPointsDataRecords[1].Gas8SetPoint = data8.Percent20Setpoint;
  420. MFCCalibrationTenPointsDataRecords[1].Gas8Calculate = data8.Percent20Calculate;
  421. MFCCalibrationTenPointsDataRecords[2].Gas8SetPoint = data8.Percent30Setpoint;
  422. MFCCalibrationTenPointsDataRecords[2].Gas8Calculate = data8.Percent30Calculate;
  423. MFCCalibrationTenPointsDataRecords[3].Gas8SetPoint = data8.Percent40Setpoint;
  424. MFCCalibrationTenPointsDataRecords[3].Gas8Calculate = data8.Percent40Calculate;
  425. MFCCalibrationTenPointsDataRecords[4].Gas8SetPoint = data8.Percent50Setpoint;
  426. MFCCalibrationTenPointsDataRecords[4].Gas8Calculate = data8.Percent50Calculate;
  427. MFCCalibrationTenPointsDataRecords[5].Gas8SetPoint = data8.Percent60Setpoint;
  428. MFCCalibrationTenPointsDataRecords[5].Gas8Calculate = data8.Percent60Calculate;
  429. MFCCalibrationTenPointsDataRecords[6].Gas8SetPoint = data8.Percent70Setpoint;
  430. MFCCalibrationTenPointsDataRecords[6].Gas8Calculate = data8.Percent70Calculate;
  431. MFCCalibrationTenPointsDataRecords[7].Gas8SetPoint = data8.Percent80Setpoint;
  432. MFCCalibrationTenPointsDataRecords[7].Gas8Calculate = data8.Percent80Calculate;
  433. MFCCalibrationTenPointsDataRecords[8].Gas8SetPoint = data8.Percent90Setpoint;
  434. MFCCalibrationTenPointsDataRecords[8].Gas8Calculate = data8.Percent90Calculate;
  435. MFCCalibrationTenPointsDataRecords[9].Gas8SetPoint = data8.Percent100Setpoint;
  436. MFCCalibrationTenPointsDataRecords[9].Gas8Calculate = data8.Percent100Calculate;
  437. }
  438. }
  439. #endregion
  440. }
  441. }