ucTemperature.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Windows.Forms;
  6. using Infragistics.Win;
  7. using Infragistics.Win.Misc;
  8. namespace Core.StlMes.Client.LgCommon
  9. {
  10. public partial class ucTemperature : UserControl
  11. {
  12. private string _Caption = ""; //显示标题
  13. private bool _ExPanded = true; //是否展开
  14. private bool _Expandable = false; //是否可收缩
  15. private int _ExPandedHeight = 0; //展开高度
  16. private UIElementBorderStyle _BorderStyle = UIElementBorderStyle.InsetSoft;
  17. #region 属性
  18. /// <summary>
  19. /// 显示标题
  20. /// </summary>
  21. [Description("显示标题")]
  22. public string Caption
  23. {
  24. get { return _Caption; }
  25. set
  26. {
  27. if (!value.Equals(_Caption))
  28. {
  29. _Caption = value;
  30. MainContainer.Text = value;
  31. MainContainer.HeaderBorderStyle = (string.IsNullOrEmpty(value) ? UIElementBorderStyle.None : UIElementBorderStyle.Etched);
  32. }
  33. }
  34. }
  35. /// <summary>
  36. /// 展开状态
  37. /// </summary>
  38. [Description("展开状态")]
  39. public bool ExPanded
  40. {
  41. get { return _ExPanded; }
  42. set
  43. {
  44. if (!value && !_Expandable) value = true;
  45. if (value != _ExPanded)
  46. {
  47. _ExPanded = value;
  48. MainContainer.Expanded = value;
  49. }
  50. }
  51. }
  52. /// <summary>
  53. /// 是否可收缩
  54. /// </summary>
  55. [Description("是否可收缩")]
  56. public bool Expandable
  57. {
  58. get { return _Expandable; }
  59. set
  60. {
  61. if (value != _Expandable)
  62. {
  63. _Expandable = value;
  64. if (!value)
  65. {
  66. MainContainer.ExpansionIndicator = GroupBoxExpansionIndicator.None;
  67. MainContainer.HeaderClickAction = GroupBoxHeaderClickAction.None;
  68. ExPanded = true;
  69. }
  70. else
  71. {
  72. MainContainer.ExpansionIndicator = GroupBoxExpansionIndicator.Far;
  73. MainContainer.HeaderClickAction = GroupBoxHeaderClickAction.ToggleExpansion;
  74. if (string.IsNullOrEmpty(_Caption)) Caption = "温度(单位:℃)";
  75. if (value) _ExPanded = MainContainer.Expanded;
  76. }
  77. MainContainer.Invalidate();
  78. }
  79. }
  80. }
  81. [Description("展开高度")]
  82. public int ExPandedHeight
  83. {
  84. get { return _ExPandedHeight; }
  85. }
  86. [Description("边框样式")]
  87. public new UIElementBorderStyle BorderStyle
  88. {
  89. get { return _BorderStyle; }
  90. set
  91. {
  92. if (value != _BorderStyle)
  93. {
  94. _BorderStyle = value;
  95. MidContainer.BorderStyle = value;
  96. }
  97. }
  98. }
  99. #endregion
  100. #region 构造函数
  101. public ucTemperature()
  102. {
  103. InitializeComponent();
  104. try
  105. {
  106. this.Caption = "温度(单位:℃)";
  107. ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.FontData.ResetBold();
  108. ultraGrid1.DisplayLayout.Override.RowSelectors = DefaultableBoolean.False;
  109. }
  110. catch { }
  111. }
  112. #endregion
  113. #region 生成框架
  114. #endregion
  115. #region 窗体公共调用
  116. public void ResetData()
  117. {
  118. if (dataTable1 != null && dataTable1.Rows.Count > 0) dataTable1.Rows.Clear();
  119. }
  120. private string TruncSampleTime(string strTime)
  121. {
  122. strTime = strTime.Trim();
  123. try
  124. {
  125. if (!string.IsNullOrEmpty(strTime) && strTime.Length >= 12)
  126. return strTime.Substring(10);
  127. }
  128. catch { }
  129. return strTime;
  130. }
  131. /// <summary>
  132. /// 填充温度信息界面数据
  133. /// </summary>
  134. public void FillTemperatureData_BOF(Hashtable htOptInfo, DataTable dtSample, DataTable dtStandard)
  135. {
  136. int iCurr = 0;
  137. if (ultraGrid1.ActiveRow != null) iCurr = ultraGrid1.ActiveRow.Index;
  138. ultraGrid1.BeginUpdate();
  139. try
  140. {
  141. lock (this)
  142. {
  143. int iRows = 2; // 加一条铁水温度、铸机要温
  144. DataRow[] dr = null;
  145. if (dtSample != null && dtSample.Rows.Count > 0)
  146. dr = dtSample.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE");
  147. if (dr != null && dr.Length > 0)
  148. iRows += dr.Length;
  149. try
  150. {
  151. dataTable1.Rows.Clear();
  152. DataRow row = null;
  153. for (int i = 0; i < iRows; i++)
  154. {
  155. row = dataTable1.NewRow();
  156. dataTable1.Rows.Add(row);
  157. }
  158. }
  159. catch { }
  160. int idx = 0;
  161. #region " 铁水温度 "
  162. string strValue = "", strTime = "";
  163. if (htOptInfo != null && htOptInfo.Contains("IRONTEMPERATURE"))
  164. strValue = htOptInfo["IRONTEMPERATURE"].ToString();
  165. ClsBusinessPack.SetGridTemperature(this.dataTable1, "铁水温度", "", strValue, TruncSampleTime(strTime), idx);
  166. idx++;
  167. #endregion
  168. #region "铸机要温"
  169. strValue = "";
  170. strTime = "";
  171. if (htOptInfo != null && htOptInfo.Contains("CCMPLANTEMPT"))
  172. strValue = htOptInfo["CCMPLANTEMPT"].ToString();
  173. if (htOptInfo != null && htOptInfo.Contains("CCMPLANTEMPTTIME"))
  174. strTime = htOptInfo["CCMPLANTEMPTTIME"].ToString();
  175. ClsBusinessPack.SetGridTemperature(dataTable1, "铸机要温", "", strValue, TruncSampleTime(strTime), idx);
  176. idx++;
  177. #endregion
  178. #region " 实时值 "
  179. if (dr != null && dr.Length > 0)
  180. {
  181. string str = "";
  182. for (int i = 0; i < dr.Length; i++, idx++)
  183. {
  184. if (i == 0)
  185. str = "转炉一倒温度";
  186. else if (i == dr.Length - 1)
  187. str = "转炉终点温度";
  188. else
  189. str = "转炉过程温度";
  190. ClsBusinessPack.SetGridTemperature(dataTable1, str, "", dr[i]["SAMPLINGVALUE"].ToString(), TruncSampleTime(dr[i]["SAMPLINGDATE"].ToString()), idx);
  191. }
  192. }
  193. #endregion
  194. #region " 与标准进行比对 "
  195. if (dr != null && dr.Length > 0)
  196. {
  197. // 一倒温度
  198. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 2);
  199. //二倒温度
  200. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02004", ultraGrid1, dr.Length + 1);
  201. }
  202. #endregion
  203. }
  204. }
  205. catch { }
  206. finally
  207. {
  208. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  209. if (iCurr > 0 && ultraGrid1.Rows.Count >= iCurr + 1)
  210. {
  211. ultraGrid1.Rows[iCurr].Activated = true;
  212. ultraGrid1.Rows[iCurr].Selected = false;
  213. }
  214. ultraGrid1.EndUpdate();
  215. }
  216. }
  217. /// <summary>
  218. /// 填充温度信息界面数据
  219. /// </summary>
  220. public void FillTemperatureData_CAS(Hashtable htOptInfo, DataTable dtSampleBOF, DataTable dtSampleCAS, DataTable dtStandard)
  221. {
  222. int iCurr = 0;
  223. if (ultraGrid1.ActiveRow != null) iCurr = ultraGrid1.ActiveRow.Index;
  224. ultraGrid1.BeginUpdate();
  225. try
  226. {
  227. lock (this)
  228. {
  229. int iRows = 1; // 加一条转炉出钢温度
  230. DataRow[] dr1 = null, dr2 = null;
  231. if (dtSampleBOF != null && dtSampleBOF.Rows.Count > 0)
  232. dr1 = dtSampleBOF.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE DESC");
  233. if (dtSampleCAS != null && dtSampleCAS.Rows.Count > 0)
  234. dr2 = dtSampleCAS.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE");
  235. if (dr2 != null && dr2.Length > 0)
  236. iRows += dr2.Length;
  237. try
  238. {
  239. dataTable1.Rows.Clear();
  240. DataRow row = null;
  241. for (int i = 0; i < iRows; i++)
  242. {
  243. row = dataTable1.NewRow();
  244. dataTable1.Rows.Add(row);
  245. }
  246. }
  247. catch { }
  248. int idx = 0;
  249. #region " 转炉出钢温度 "
  250. string strValue = "", strTime = "";
  251. if (dr1 != null && dr1.Length > 0)
  252. {
  253. strValue = dr1[0]["SAMPLINGVALUE"].ToString();
  254. strTime = dr1[0]["SAMPLINGDATE"].ToString();
  255. }
  256. ClsBusinessPack.SetGridTemperature(this.dataTable1, "转炉终点温度", "", strValue, TruncSampleTime(strTime), idx);
  257. idx++;
  258. #endregion
  259. #region " 实时值 "
  260. if (dr2 != null && dr2.Length > 0)
  261. {
  262. string str = "";
  263. for (int i = 0; i < dr2.Length; i++, idx++)
  264. {
  265. if (i == 0)
  266. str = "吹氩进站温度";
  267. else if (i == dr2.Length - 1)
  268. str = "吹氩出站温度";
  269. else
  270. str = "吹氩过程温度";
  271. ClsBusinessPack.SetGridTemperature(this.dataTable1, str, "", dr2[i]["SAMPLINGVALUE"].ToString(), TruncSampleTime(dr2[i]["SAMPLINGDATE"].ToString()), idx);
  272. }
  273. }
  274. #endregion
  275. #region " 与标准进行比对 "
  276. //出钢终点温度
  277. if (dr1 != null && dr1.Length > 0)
  278. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 0);
  279. //吹氩站温度
  280. if (dr2 != null && dr2.Length > 0)
  281. {
  282. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 1);
  283. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, dr2.Length);
  284. }
  285. #endregion
  286. }
  287. }
  288. catch { }
  289. finally
  290. {
  291. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  292. if (iCurr > 0 && ultraGrid1.Rows.Count >= iCurr + 1)
  293. {
  294. ultraGrid1.Rows[iCurr].Activated = true;
  295. ultraGrid1.Rows[iCurr].Selected = false;
  296. }
  297. ultraGrid1.EndUpdate();
  298. }
  299. }
  300. /// <summary>
  301. /// 填充温度信息界面数据精炼炉
  302. /// </summary>
  303. public void FillTemperatureData_LFS(Hashtable htOptInfo, DataTable dtSampleBOF, DataTable dtSampleCAS, DataTable dtSampleLFS, DataTable dtStandard)
  304. {
  305. int iCurr = 0;
  306. if (ultraGrid1.ActiveRow != null) iCurr = ultraGrid1.ActiveRow.Index;
  307. ultraGrid1.BeginUpdate();
  308. try
  309. {
  310. lock (this)
  311. {
  312. int iRows = 2; //加一条转炉出钢温度 和 吹氩站出站温度
  313. DataRow[] dr1 = null, dr2 = null, dr3 = null;
  314. if (dtSampleBOF != null && dtSampleBOF.Rows.Count > 0)
  315. dr1 = dtSampleBOF.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE DESC");
  316. if (dtSampleCAS != null && dtSampleCAS.Rows.Count > 0)
  317. dr2 = dtSampleCAS.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE DESC");
  318. if (dtSampleLFS != null && dtSampleLFS.Rows.Count > 0)
  319. dr3 = dtSampleLFS.Select("SAMPLINGNAME = 'TEMPERATURE1' or SAMPLINGNAME = 'TEMPERATURE2'", " SAMPLINGDATE ASC");
  320. if (dr3 != null && dr3.Length > 0)
  321. iRows += dr3.Length;
  322. try
  323. {
  324. dataTable1.Rows.Clear();
  325. DataRow row = null;
  326. for (int i = 0; i < iRows; i++)
  327. {
  328. row = dataTable1.NewRow();
  329. dataTable1.Rows.Add(row);
  330. }
  331. }
  332. catch { }
  333. int idx = 0;
  334. #region " 转炉出钢温度 "
  335. string strValue = "", strTime = "";
  336. if (dr1 != null && dr1.Length > 0)
  337. {
  338. strValue = dr1[0]["SAMPLINGVALUE"].ToString();
  339. strTime = dr1[0]["SAMPLINGDATE"].ToString();
  340. }
  341. ClsBusinessPack.SetGridTemperature(this.dataTable1, "转炉终点温度", "", strValue, TruncSampleTime(strTime), idx);
  342. idx++;
  343. #endregion
  344. #region " 吹氩站温度 "
  345. strValue = "";
  346. strTime = "";
  347. if (dr2 != null && dr2.Length > 0)
  348. {
  349. strValue = dr2[0]["SAMPLINGVALUE"].ToString();
  350. strTime = dr2[0]["SAMPLINGDATE"].ToString();
  351. }
  352. ClsBusinessPack.SetGridTemperature(this.dataTable1, "吹氩出站温度", "", strValue, TruncSampleTime(strTime), idx);
  353. idx++;
  354. #endregion
  355. #region " 实时值 "
  356. if (dr3 != null && dr3.Length > 0)
  357. {
  358. string str = "";
  359. for (int i = 0; i < dr3.Length; i++, idx++)
  360. {
  361. if (i == 0)
  362. str = "精炼炉进站温度";
  363. else if (idx == dr3.Length - 1)
  364. str = "精炼炉出站温度";
  365. else
  366. str = "精炼炉过程温度";
  367. ClsBusinessPack.SetGridTemperature(this.dataTable1, str, "", dr3[i]["SAMPLINGVALUE"].ToString(), TruncSampleTime(dr3[i]["SAMPLINGDATE"].ToString()), idx);
  368. }
  369. }
  370. #endregion
  371. #region " 与标准进行比对 "
  372. // 转炉终点温度
  373. if (dr1 != null && dr1.Length > 0)
  374. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 0);
  375. // 吹氩站终点温度
  376. if (dr2 != null && dr2.Length > 0)
  377. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 1);
  378. // 精炼炉温度
  379. if (dr3 != null && dr3.Length > 0)
  380. {
  381. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 2);
  382. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, dr3.Length + 1);
  383. }
  384. #endregion
  385. }
  386. }
  387. catch { }
  388. finally
  389. {
  390. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  391. if (iCurr > 0 && ultraGrid1.Rows.Count >= iCurr + 1)
  392. {
  393. ultraGrid1.Rows[iCurr].Activated = true;
  394. ultraGrid1.Rows[iCurr].Selected = false;
  395. }
  396. ultraGrid1.EndUpdate();
  397. }
  398. }
  399. /// <summary>
  400. /// 填充温度信息界面数据
  401. /// </summary>
  402. public void FillTemperatureData_CCM(Hashtable htOptInfo, DataTable dtSampleBOF, DataTable dtSampleCAS, DataTable dtSampleLFS, DataTable dtSampleCCM, DataTable dtStandard)
  403. {
  404. int iCurr = 0;
  405. if (ultraGrid1.ActiveRow != null) iCurr = ultraGrid1.ActiveRow.Index;
  406. ultraGrid1.BeginUpdate();
  407. try
  408. {
  409. lock (this)
  410. {
  411. int iRows = 3; //加一条转炉出钢温度 吹氩站出站温度 精炼炉温度
  412. DataRow[] dr1 = null, dr2 = null, dr3 = null, dr4 = null;
  413. if (dtSampleBOF != null && dtSampleBOF.Rows.Count > 0)
  414. dr1 = dtSampleBOF.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE DESC");
  415. if (dtSampleCAS != null && dtSampleCAS.Rows.Count > 0)
  416. dr2 = dtSampleCAS.Select("SAMPLINGNAME = 'TEMPERATURE'", " SAMPLINGDATE DESC");
  417. if (dtSampleLFS != null && dtSampleLFS.Rows.Count > 0)
  418. dr3 = dtSampleLFS.Select("SAMPLINGNAME = 'TEMPERATURE1' or SAMPLINGNAME = 'TEMPERATURE2'", " SAMPLINGDATE DESC");
  419. if (dtSampleCCM != null && dtSampleCCM.Rows.Count > 0)
  420. dr4 = dtSampleCCM.Select("SAMPLINGNAME = 'TUNDISHTEMP1' or SAMPLINGNAME = 'TUNDISHTEMP2' or SAMPLINGNAME = 'TUNDISHTEMP_H'", " SAMPLINGDATE ASC");
  421. if (dr4 != null && dr4.Length > 0)
  422. iRows += dr4.Length;
  423. try
  424. {
  425. dataTable1.Rows.Clear();
  426. DataRow row = null;
  427. for (int i = 0; i < iRows; i++)
  428. {
  429. row = dataTable1.NewRow();
  430. dataTable1.Rows.Add(row);
  431. }
  432. }
  433. catch { }
  434. int idx = 0;
  435. #region " 转炉出钢温度 "
  436. string strValue = "", strTime = "";
  437. if (dr1 != null && dr1.Length > 0)
  438. {
  439. strValue = dr1[0]["SAMPLINGVALUE"].ToString();
  440. strTime = dr1[0]["SAMPLINGDATE"].ToString();
  441. }
  442. ClsBusinessPack.SetGridTemperature(this.dataTable1, "转炉终点温度", "", strValue, TruncSampleTime(strTime), idx);
  443. idx++;
  444. #endregion
  445. #region " 吹氩站温度 "
  446. strValue = "";
  447. strTime = "";
  448. if (dr2 != null && dr2.Length > 0)
  449. {
  450. strValue = dr2[0]["SAMPLINGVALUE"].ToString();
  451. strTime = dr2[0]["SAMPLINGDATE"].ToString();
  452. }
  453. ClsBusinessPack.SetGridTemperature(this.dataTable1, "吹氩出站温度", "", strValue, TruncSampleTime(strTime), idx);
  454. idx++;
  455. #endregion
  456. #region " 精炼炉温度 "
  457. strValue = "";
  458. strTime = "";
  459. if (dr3 != null && dr3.Length > 0)
  460. {
  461. strValue = dr3[0]["SAMPLINGVALUE"].ToString();
  462. strTime = dr3[0]["SAMPLINGDATE"].ToString();
  463. }
  464. ClsBusinessPack.SetGridTemperature(this.dataTable1, "精炼炉出站温度", "", strValue, TruncSampleTime(strTime), idx);
  465. idx++;
  466. #endregion
  467. #region " 实时值 "
  468. if (dr4 != null && dr4.Length > 0)
  469. {
  470. string str = "连铸中包温度";
  471. for (int i = 0; i < dr4.Length; i++, idx++)
  472. {
  473. ClsBusinessPack.SetGridTemperature(this.dataTable1, str, "", dr4[i]["SAMPLINGVALUE"].ToString(), TruncSampleTime(dr4[i]["SAMPLINGDATE"].ToString()), idx);
  474. }
  475. }
  476. #endregion
  477. #region " 与标准进行比对 "
  478. // 转炉终点温度
  479. if (dr1 != null && dr1.Length > 0)
  480. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 0);
  481. // 吹氩站终点温度
  482. if (dr2 != null && dr2.Length > 0)
  483. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 1);
  484. // 精炼炉终点温度
  485. if (dr3 != null && dr3.Length > 0)
  486. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, 2);
  487. // 中包温度标准
  488. if (dr4 != null && dr4.Length > 0)
  489. {
  490. for (int i = 0; i < dr4.Length; i++)
  491. {
  492. ClsBusinessPack.CompareStandard(dtStandard, dataTable1, "L02001", ultraGrid1, i + 3);
  493. }
  494. }
  495. #endregion
  496. }
  497. }
  498. catch { }
  499. finally
  500. {
  501. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  502. if (iCurr > 0 && ultraGrid1.Rows.Count >= iCurr + 1)
  503. {
  504. ultraGrid1.Rows[iCurr].Activated = true;
  505. ultraGrid1.Rows[iCurr].Selected = false;
  506. }
  507. ultraGrid1.EndUpdate();
  508. }
  509. }
  510. /// <summary>
  511. /// 填充温度信息界面数据(实绩)
  512. /// </summary>
  513. public void FillTemperatureData_RES(LG_PROCESS PROCESS, DataTable dtSample)
  514. {
  515. ultraGrid1.BeginUpdate();
  516. try
  517. {
  518. lock (this)
  519. {
  520. DataRow[] dr = null;
  521. DataRow[] drC = null;
  522. DataRow[] drD = null;
  523. if (dtSample != null && dtSample.Rows.Count > 0)
  524. {
  525. dr = dtSample.Select("SAMPLINGNAME LIKE 'TEMPERATURE%' OR SAMPLINGNAME LIKE 'TUNDISHTEMP%' ", " SAMPLINGDATE");
  526. drC = dtSample.Select("(SAMPLINGNAME LIKE 'TEMPERATURE%' OR SAMPLINGNAME LIKE 'TUNDISHTEMP%') AND STATIONCODE LIKE 'C%' ", " SAMPLINGDATE");
  527. drD = dtSample.Select("(SAMPLINGNAME LIKE 'TEMPERATURE%' OR SAMPLINGNAME LIKE 'TUNDISHTEMP%') AND STATIONCODE LIKE 'D%' ", " SAMPLINGDATE");
  528. }
  529. int iRows = 0;
  530. if (dr != null && dr.Length > 0) iRows = dr.Length;
  531. try
  532. {
  533. dataTable1.Rows.Clear();
  534. DataRow row = null;
  535. for (int i = 0; i < iRows; i++)
  536. {
  537. row = dataTable1.NewRow();
  538. dataTable1.Rows.Add(row);
  539. }
  540. }
  541. catch { }
  542. #region " 实时值 "
  543. if (dr != null && dr.Length > 0)
  544. {
  545. string str = "";
  546. string station = "";
  547. int indexC = 0;
  548. int indexD = 0;
  549. for (int idx = 0; idx < dr.Length; idx++)
  550. {
  551. station = dr[idx]["STATIONCODE"].ToString();
  552. if (station.Substring(0, 1) == "C")
  553. {
  554. if (indexC == 0 && drC.Length > 1)
  555. {
  556. str = "电炉一倒温度";
  557. }
  558. else if (indexC == drC.Length - 1)
  559. {
  560. str = "电炉终点温度";
  561. }
  562. else
  563. {
  564. str = "电炉过程温度";
  565. }
  566. indexC++;
  567. }
  568. if (station.Substring(0, 1) == "D")
  569. {
  570. if (indexD == 0 && drD.Length > 1)
  571. {
  572. str = "进站温度";
  573. }
  574. else if (indexD == drD.Length - 1)
  575. {
  576. str = "出站温度";
  577. }
  578. else
  579. {
  580. str = "过程温度";
  581. }
  582. indexD++;
  583. }
  584. //if (idx == 0)
  585. //{
  586. // if (PROCESS == LG_PROCESS.BOF) str = "转炉一倒温度";
  587. // else if (PROCESS == LG_PROCESS.CCM) str = "中包第" + Convert.ToString(idx + 1) + "次测温";
  588. // else str = "进站温度";
  589. //}
  590. //else if (idx == dr.Length - 1)
  591. //{
  592. // if (PROCESS == LG_PROCESS.BOF) str = "转炉终点温度";
  593. // else if (PROCESS == LG_PROCESS.CCM) str = "中包第" + Convert.ToString(idx + 1) + "次测温";
  594. // else str = "出站温度";
  595. //}
  596. //else
  597. //{
  598. // if (PROCESS == LG_PROCESS.BOF) str = "转炉过程温度";
  599. // else if (PROCESS == LG_PROCESS.CCM) str = "中包第" + Convert.ToString(idx + 1) + "次测温";
  600. // else str = "过程温度";
  601. //}
  602. ClsBusinessPack.SetGridTemperature(dataTable1, str, "", dr[idx]["SAMPLINGVALUE"].ToString(), dr[idx]["SAMPLINGDATE"].ToString(), idx);
  603. }
  604. }
  605. #endregion
  606. }
  607. }
  608. catch { }
  609. finally
  610. {
  611. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  612. ultraGrid1.EndUpdate();
  613. }
  614. }
  615. /// <summary>
  616. /// 填充温度信息界面数据
  617. /// </summary>
  618. public void FillTemperatureData_Result(DataTable dtSample, DataTable dtStandard)
  619. {
  620. int iCurr = 0;
  621. if (ultraGrid1.ActiveRow != null) iCurr = ultraGrid1.ActiveRow.Index;
  622. ultraGrid1.BeginUpdate();
  623. try
  624. {
  625. lock (this)
  626. {
  627. //int iRows = 3; //加一条转炉出钢温度 吹氩站出站温度 精炼炉温度
  628. //try
  629. //{
  630. // dataTable1.Rows.Clear();
  631. // DataRow row = null;
  632. // for (int i = 0; i < iRows; i++)
  633. // {
  634. // row = dataTable1.NewRow();
  635. // dataTable1.Rows.Add(row);
  636. // }
  637. //}
  638. //catch { }
  639. dataTable1.Rows.Clear();
  640. DataRow row = null;
  641. int idx = 0;
  642. string strValue = "", strTime = "", strStation = "", strName = "";
  643. for (int i = 0; i < dtSample.Rows.Count; i++)
  644. {
  645. row = dataTable1.NewRow();
  646. dataTable1.Rows.Add(row);
  647. strStation = dtSample.Rows[i]["STATIONCODE"].ToString().Substring(0, 1);
  648. if (strStation == "C")
  649. {
  650. strName = "电炉终点温度";
  651. }
  652. else if (strStation == "D")
  653. {
  654. strName = "氩后大包温度";
  655. }
  656. else if (strStation == "E")
  657. {
  658. strName = "精炼终点温度";
  659. }
  660. else if (strStation == "F")
  661. {
  662. strName = "RH炉终点温度";
  663. }
  664. else if (strStation == "I")
  665. {
  666. strName = "VD炉终点温度";
  667. }
  668. else
  669. {
  670. strName = "连铸中包温度";
  671. }
  672. strValue = dtSample.Rows[i]["SAMPLINGVALUE"].ToString();
  673. strTime = dtSample.Rows[i]["SAMPLINGDATE"].ToString();
  674. ClsBusinessPack.SetGridTemperature(this.dataTable1, strName, "", strValue, TruncSampleTime(strTime), idx);
  675. idx++;
  676. }
  677. }
  678. }
  679. catch { }
  680. finally
  681. {
  682. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  683. ultraGrid1.EndUpdate();
  684. }
  685. }
  686. #endregion
  687. #region 事件
  688. private void SetDelegate()
  689. {
  690. this.Resize += new System.EventHandler(this.ucAdditive_Resize);
  691. this.MainContainer.ExpandedStateChanged += new System.EventHandler(this.ExpandedStateChanged);
  692. }
  693. private void ucAdditive_Resize(object sender, EventArgs e)
  694. {
  695. try
  696. {
  697. if (_Expandable && !_ExPanded)
  698. {
  699. this.Height = MainContainer.Height; //可收缩,处于收缩状态,不允许修改大小
  700. if (_ExPandedHeight == 0 && this.Parent != null) _ExPandedHeight = this.Parent.Height;
  701. }
  702. else if (_Expandable && _ExPanded) _ExPandedHeight = this.Height; //可收缩,处于展开状态,记录高度变化
  703. else if (!Expandable) _ExPandedHeight = this.Height; //不可收缩,记录高度变化
  704. }
  705. catch { }
  706. }
  707. private void ExpandedStateChanged(object sender, EventArgs e)
  708. {
  709. try
  710. {
  711. ExPanded = MainContainer.Expanded;
  712. if (MainContainer.Expanded) this.Height = _ExPandedHeight;
  713. else this.Height = MainContainer.Height;
  714. }
  715. catch { }
  716. }
  717. #endregion
  718. internal void FillTemperatureData_LFS()
  719. {
  720. throw new NotImplementedException();
  721. }
  722. }
  723. }