MFCVerificationViewModel.cs 26 KB

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