frmSetHopper.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;
  9. using Core.LgMes.Client.lgClassModel;
  10. using Core.Mes.Client.Common;
  11. using System.Collections;
  12. namespace Core.LgMes.Client.LgJobMgt
  13. {
  14. public partial class frmSetHopper : frmStyleBase
  15. {
  16. public OpeBase ob=null;
  17. public frmSetHopper(string szDeviceName)
  18. {
  19. InitializeComponent();
  20. this.devicePos = szDeviceName;
  21. }
  22. #region " Member Variable"
  23. // private string m_szDeviceName = "";
  24. private DataTable m_dtMain = null;
  25. private DataTable m_dtStationconMaterial = null;
  26. private DataTable _dtHopper;
  27. private string sCraftPos = ""; //LG02
  28. private string devicePos = ""; //CVT01
  29. private string _curMaterType = ""; //FL
  30. private PictureBox _curPicBx = null;
  31. private Label _curLbl = null;
  32. #endregion
  33. //选择料斗
  34. private void PicClickHandler(object sender, System.EventArgs e)
  35. {
  36. SetPicNoSelectState();
  37. _curPicBx = (PictureBox)sender;
  38. _curPicBx.BorderStyle = BorderStyle.Fixed3D;
  39. SetLabelColor();
  40. }
  41. private void SetPicNoSelectState()
  42. {
  43. _curPicBx = null;
  44. _curLbl = null;
  45. foreach (Control ctl in panel2.Controls)
  46. {
  47. if (ctl is PictureBox)
  48. ((PictureBox)ctl).BorderStyle = BorderStyle.None;
  49. }
  50. foreach (Control ctl in panel2.Controls)
  51. {
  52. if (ctl is Label)
  53. ((Label)ctl).ForeColor = Color.Black;
  54. }
  55. foreach (Control ctl in panel3.Controls)
  56. {
  57. if (ctl is PictureBox)
  58. ((PictureBox)ctl).BorderStyle = BorderStyle.None;
  59. }
  60. foreach (Control ctl in panel3.Controls)
  61. {
  62. if (ctl is Label)
  63. ((Label)ctl).ForeColor = Color.Black;
  64. }
  65. }
  66. private void SetLabelColor()
  67. {
  68. try
  69. {
  70. if (_curPicBx == null)
  71. {
  72. return;
  73. }
  74. string lbName;
  75. if (Convert.ToInt32(_curPicBx.Name.Substring(10, _curPicBx.Name.Length - 10)) < 23)
  76. {
  77. lbName = "label" + _curPicBx.Tag.ToString();
  78. foreach (Control c in this.panel2.Controls)
  79. {
  80. if (c.Name == lbName)
  81. {
  82. ((Label)c).ForeColor = Color.Red;
  83. return;
  84. }
  85. }
  86. }
  87. else
  88. {
  89. lbName = "label3" + _curPicBx.Tag.ToString();
  90. foreach (Control c in this.panel3.Controls)
  91. {
  92. if (c.Name == lbName)
  93. {
  94. ((Label)c).ForeColor = Color.Red;
  95. return;
  96. }
  97. }
  98. }
  99. }
  100. catch
  101. {
  102. }
  103. }
  104. private void frmSetHopper_Load(object sender, EventArgs e)
  105. {
  106. switch (this.devicePos.Substring(0, 3))
  107. {
  108. case "BOF": // 转炉
  109. this.ultraGroupBox2.Visible = false;
  110. //this.rbWS.Enabled = false; // 喂丝料按钮
  111. this.rbWS.Visible = false;
  112. this.rbFZL.Text = "辅助料";
  113. this.rbHJ.Text = "合金";
  114. this.ultraGroupBox1.Dock = DockStyle.Fill;
  115. break;
  116. case "CAS": // 钢包站
  117. // this.rbFZL.Enabled = false;
  118. this.rbFZL.Visible = true;
  119. this.rbHJ.Text = "合金微调";
  120. break;
  121. case "LFS": // 精炼炉
  122. // this.rbFZL.Enabled = false;
  123. this.rbFZL.Visible = true;
  124. this.rbHJ.Text = "合金微调";
  125. break;
  126. case "RHS": // RH炉
  127. // this.rbFZL.Enabled = false;
  128. this.rbFZL.Visible = true;
  129. this.rbHJ.Text = "合金微调";
  130. break;
  131. case "THJ": // 转炉合金
  132. this.ultraGroupBox2.Visible = false;
  133. this.rbWS.Visible = false; // 喂丝料按钮
  134. this.rbFZL.Enabled = false; // 辅助料
  135. this.ultraGroupBox1.Dock = DockStyle.Fill;
  136. break;
  137. default:
  138. break;
  139. }
  140. //btAdd.Enabled = false;
  141. this.comboBox1.SelectedIndex = 6;
  142. this.ClearLableText();
  143. GetDataSource();
  144. GetStationconMaterialData(this.devicePos.Substring(0, 3));
  145. BindingGrid(this.m_dtStationconMaterial);
  146. }
  147. #region " InitDataSoutce"
  148. private void GetDataSource()
  149. {
  150. string strErr = "";
  151. string strSqlID = "";
  152. try
  153. {
  154. strSqlID = "GetMaterialData.Select";//此ID为XML文件ID
  155. CommonClientToServer cctos=new CommonClientToServer();
  156. cctos.ob = ob;
  157. //查询物料配置信息
  158. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  159. "GetMaterialData", strSqlID, out strErr);
  160. if (strErr == "" && ds != null)
  161. {
  162. this.m_dtMain = ds.Tables[0];
  163. }
  164. }
  165. catch (Exception ex)
  166. {
  167. string Msg = ex.Message;
  168. }
  169. }
  170. /// <summary>
  171. /// 取岗位物料数据
  172. /// </summary>
  173. private void GetStationconMaterialData(string strStrcraftposId)
  174. {
  175. string strErr = "";
  176. string strSqlID = "";
  177. try
  178. {
  179. ArrayList arry = new ArrayList();
  180. arry.Add("GetStationconMaterialData.Select");//此ID为XML文件ID
  181. arry.Add(strStrcraftposId);
  182. CommonClientToServer cctos = new CommonClientToServer();
  183. cctos.ob = ob;
  184. //查询物料配置信息
  185. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  186. "GetStationconMaterialData", arry, out strErr);
  187. if (strErr == "" && ds != null)
  188. {
  189. this.m_dtStationconMaterial = ds.Tables[0];
  190. }
  191. }
  192. catch (Exception ex)
  193. {
  194. string Msg = ex.Message;
  195. }
  196. }
  197. private void BindingGrid(DataTable dt)
  198. {
  199. //this.ulgridMtrInfo.DataSource = dt;
  200. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].Width = 60;
  201. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].Header.Caption = "物料编码";
  202. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  203. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
  204. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].Width = 140;
  205. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].Header.Caption = "物料全称";
  206. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  207. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].Width = 100;
  208. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].Header.Caption = "物料简称";
  209. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  210. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].Width = 65;
  211. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].Header.Caption = "物料类型";
  212. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  213. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Width = 0;
  214. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Header.Caption = "";
  215. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  216. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Hidden = true;
  217. }
  218. #endregion
  219. private void ClearLableText()
  220. {
  221. this.lblG1.Text = "";
  222. this.lblG2.Text = "";
  223. this.lblG3.Text = "";
  224. this.lblG4.Text = "";
  225. this.lblG5.Text = "";
  226. this.lblG6.Text = "";
  227. this.lblG7.Text = "";
  228. this.lblG8.Text = "";
  229. this.lblG9.Text = "";
  230. this.lblG10.Text = "";
  231. this.lblG11.Text = "";
  232. this.lblG12.Text = "";
  233. this.lblG13.Text = "";
  234. this.lblG14.Text = "";
  235. this.lblG15.Text = "";
  236. this.lblG16.Text = "";
  237. this.lblG17.Text = "";
  238. this.lblG18.Text = "";
  239. this.lblG19.Text = "";
  240. this.lblG20.Text = "";
  241. this.lblG21.Text = "";
  242. this.lblG22.Text = "";
  243. this.lblW1.Text = "";
  244. this.lblW2.Text = "";
  245. this.lblW3.Text = "";
  246. this.lblW4.Text = "";
  247. this.lblW5.Text = "";
  248. this.lblW6.Text = "";
  249. this.lblW7.Text = "";
  250. this.lblW8.Text = "";
  251. }
  252. private void GetCurrLabel()
  253. {
  254. try
  255. {
  256. if (_curPicBx == null)
  257. {
  258. this._curLbl = null;
  259. return;
  260. }
  261. string lbName;
  262. if (Convert.ToInt32(_curPicBx.Name.Substring(10, _curPicBx.Name.Length - 10)) < 23)
  263. {
  264. lbName = "lblG" + _curPicBx.Tag.ToString();
  265. foreach (Control c in this.panel2.Controls)
  266. {
  267. if (c.Name == lbName)
  268. {
  269. this._curLbl = (Label)c;
  270. return;
  271. }
  272. }
  273. }
  274. else
  275. {
  276. lbName = "lblW" + _curPicBx.Tag.ToString();
  277. foreach (Control c in this.panel3.Controls)
  278. {
  279. if (c.Name == lbName)
  280. {
  281. this._curLbl = (Label)c;
  282. return;
  283. }
  284. }
  285. }
  286. }
  287. catch
  288. {
  289. this._curLbl = null;
  290. }
  291. }
  292. private void btClose_Click(object sender, EventArgs e)
  293. {
  294. this.Close();
  295. }
  296. /// <summary>
  297. /// 添料
  298. /// </summary>
  299. /// <param name="sender"></param>
  300. /// <param name="e"></param>
  301. private void btAdd_Click(object sender, EventArgs e)
  302. {
  303. string strErr = "";
  304. string szWLLX = "";
  305. Infragistics.Win.UltraWinGrid.UltraGridRow urg = this.ulgridMtrInfo.ActiveRow;
  306. if (urg == null)
  307. {
  308. MessageBox.Show("请选择物料!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  309. return;
  310. }
  311. if (_curPicBx == null)
  312. {
  313. MessageBox.Show("请选择料斗!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  314. return;
  315. }
  316. GetCurrLabel();
  317. if (_curLbl.Tag != null)
  318. szWLLX = _curLbl.Tag.ToString();
  319. string materialName = Convert.ToString(urg.Cells["MATERIELNAME"].Value);
  320. string strSqlID = "SwapHopper.Procedure";
  321. Hashtable hashtb = new Hashtable();
  322. hashtb.Add("I1", _curPicBx.Tag.ToString()); //料仓编号
  323. hashtb.Add("I2", this.devicePos); //料仓置位
  324. hashtb.Add("I3", urg.Cells["MATERIELTYPE"].Value.ToString()); //物料类型
  325. hashtb.Add("I4", Convert.ToString(urg.Cells["MATERIELCODE"].Value)); //物料编码
  326. hashtb.Add("I5", comboBox1.SelectedItem.ToString()); //物料单位
  327. hashtb.Add("I6", "1"); // 1 为料仓自动投料 2 为手投料
  328. hashtb.Add("I7", "0"); //清空标志 1 为清空 0 为添料
  329. hashtb.Add("I8", szWLLX); //物料类型
  330. CommonClientToServer cctos = new CommonClientToServer();
  331. cctos.ob = ob;
  332. string strCode= cctos.ExecuteProcedureFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  333. "SwapHopper", strSqlID, hashtb, out strErr);
  334. if (strErr.Trim().Length > 0)
  335. {
  336. MessageBox.Show("添料失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  337. return;
  338. }
  339. else
  340. {
  341. this._curLbl.Text = materialName;
  342. _curLbl.Tag = urg.Cells["MATERIELTYPE"].Value.ToString();
  343. }
  344. }
  345. private void btReset_Click(object sender, EventArgs e)
  346. {
  347. string strErr = "";
  348. if (this._curPicBx == null)
  349. {
  350. MessageBox.Show("请选择料斗!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  351. return;
  352. }
  353. GetCurrLabel();
  354. if (this._curLbl.Text.Equals(string.Empty))
  355. return;
  356. DialogResult dia = MessageBox.Show("是否确认重置当前选中的料斗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  357. if (dia == DialogResult.No) return;
  358. string szWLLX = _curLbl.Tag.ToString();
  359. string strSqlID = "SwapHopper.Procedure";
  360. Hashtable hashtb = new Hashtable();
  361. hashtb.Add("I1", _curPicBx.Tag.ToString()); //料仓编号
  362. hashtb.Add("I2", this.devicePos); //料仓置位
  363. hashtb.Add("I3", _curLbl.Tag.ToString()); //物料类型
  364. hashtb.Add("I4", ""); //物料编码
  365. hashtb.Add("I5", ""); //物料单位
  366. hashtb.Add("I6", "1"); // 1 为料仓自动投料 2 为手投料
  367. hashtb.Add("I7", "1"); //清空标志 1 为清空 0 为添料
  368. hashtb.Add("I8", szWLLX); //物料类型
  369. CommonClientToServer cctos = new CommonClientToServer();
  370. cctos.ob = ob;
  371. string strCode = cctos.ExecuteProcedureFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  372. "SwapHopper", strSqlID, hashtb, out strErr);
  373. if (strErr.Trim().Length > 0)
  374. {
  375. MessageBox.Show("重置失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  376. return;
  377. }
  378. this._curLbl.Text = "";
  379. }
  380. private void SetPicText(bool IsJS, string hopperNo, string str, string szWLLX)
  381. {
  382. if (!IsJS)
  383. {
  384. switch (hopperNo)
  385. {
  386. case "1":
  387. this.lblG1.Text = str;
  388. this.lblG1.Tag = szWLLX;
  389. break;
  390. case "2":
  391. this.lblG2.Text = str;
  392. this.lblG2.Tag = szWLLX;
  393. break;
  394. case "3":
  395. this.lblG3.Text = str;
  396. this.lblG3.Tag = szWLLX;
  397. break;
  398. case "4":
  399. this.lblG4.Text = str;
  400. this.lblG4.Tag = szWLLX;
  401. break;
  402. case "5":
  403. this.lblG5.Text = str;
  404. this.lblG5.Tag = szWLLX;
  405. break;
  406. case "6":
  407. this.lblG6.Text = str;
  408. this.lblG6.Tag = szWLLX;
  409. break;
  410. case "7":
  411. this.lblG7.Text = str;
  412. this.lblG7.Tag = szWLLX;
  413. break;
  414. case "8":
  415. this.lblG8.Text = str;
  416. this.lblG8.Tag = szWLLX;
  417. break;
  418. case "9":
  419. this.lblG9.Text = str;
  420. this.lblG9.Tag = szWLLX;
  421. break;
  422. case "10":
  423. this.lblG10.Text = str;
  424. this.lblG10.Tag = szWLLX;
  425. break;
  426. case "11":
  427. this.lblG11.Text = str;
  428. this.lblG11.Tag = szWLLX;
  429. break;
  430. case "12":
  431. this.lblG12.Text = str;
  432. this.lblG12.Tag = szWLLX;
  433. break;
  434. case "13":
  435. this.lblG13.Text = str;
  436. this.lblG13.Tag = szWLLX;
  437. break;
  438. case "14":
  439. this.lblG14.Text = str;
  440. this.lblG14.Tag = szWLLX;
  441. break;
  442. case "15":
  443. this.lblG15.Text = str;
  444. this.lblG15.Tag = szWLLX;
  445. break;
  446. case "16":
  447. this.lblG16.Text = str;
  448. this.lblG16.Tag = szWLLX;
  449. break;
  450. case "17":
  451. this.lblG17.Text = str;
  452. this.lblG17.Tag = szWLLX;
  453. break;
  454. case "18":
  455. this.lblG18.Text = str;
  456. this.lblG18.Tag = szWLLX;
  457. break;
  458. case "19":
  459. this.lblG19.Text = str;
  460. this.lblG19.Tag = szWLLX;
  461. break;
  462. case "20":
  463. this.lblG20.Text = str;
  464. this.lblG20.Tag = szWLLX;
  465. break;
  466. case "21":
  467. this.lblG21.Text = str;
  468. this.lblG21.Tag = szWLLX;
  469. break;
  470. case "22":
  471. this.lblG22.Text = str;
  472. this.lblG22.Tag = szWLLX;
  473. break;
  474. default:
  475. break;
  476. }
  477. }
  478. else
  479. {
  480. if (hopperNo == "1")
  481. {
  482. this.lblW1.Text = str;
  483. this.lblW1.Tag = szWLLX;
  484. }
  485. if (hopperNo == "2")
  486. {
  487. this.lblW2.Text = str;
  488. this.lblW2.Tag = szWLLX;
  489. }
  490. if (hopperNo == "3")
  491. {
  492. this.lblW3.Text = str;
  493. this.lblW3.Tag = szWLLX;
  494. }
  495. if (hopperNo == "4")
  496. {
  497. this.lblW4.Text = str;
  498. this.lblW4.Tag = szWLLX;
  499. }
  500. if (hopperNo == "5")
  501. {
  502. this.lblW5.Text = str;
  503. this.lblW5.Tag = szWLLX;
  504. }
  505. if (hopperNo == "6")
  506. {
  507. this.lblW6.Text = str;
  508. this.lblW6.Tag = szWLLX;
  509. }
  510. if (hopperNo == "7")
  511. {
  512. this.lblW7.Text = str;
  513. this.lblW7.Tag = szWLLX;
  514. }
  515. if (hopperNo == "8")
  516. {
  517. this.lblW8.Text = str;
  518. this.lblW8.Tag = szWLLX;
  519. }
  520. }
  521. }
  522. private void GetDataForHopper()
  523. {
  524. string strErr = "";
  525. string strSqlId = "";
  526. ArrayList arry = new ArrayList();
  527. //处理转炉与WS数据
  528. if ((devicePos.Substring(0, 3) != "CAS" && devicePos.Substring(0, 3) != "LFS" && devicePos.Substring(0, 3) != "RHS"
  529. && devicePos.Substring(0, 3) != "VDS") || _curMaterType == "WS")
  530. {
  531. strSqlId = "GetHopperNameBof.Select";
  532. arry.Add(strSqlId);//此ID为XML文件ID
  533. arry.Add(devicePos);
  534. arry.Add(_curMaterType);
  535. }
  536. else
  537. {
  538. strSqlId = "GetHopperNameSet.Select";
  539. arry.Add(strSqlId);//此ID为XML文件ID
  540. arry.Add(devicePos);
  541. }
  542. CommonClientToServer cctos = new CommonClientToServer();
  543. cctos.ob = ob;
  544. //查询料斗物料配置信息
  545. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  546. "GetHopperName", arry, out strErr);
  547. if (strErr=="" && ds != null )
  548. {
  549. _dtHopper = ds.Tables[0];
  550. DataRow[] drs = null;
  551. bool bFlag = false;
  552. for (int i = 0; i < _dtHopper.Rows.Count; i++)
  553. {
  554. try
  555. {
  556. DataRow dr = _dtHopper.Rows[i];
  557. string id = dr["MSNUMID"].ToString();
  558. drs = _dtHopper.Select(" MSNUMID = '" + id + "'"); //and MATERIELTYPE='" + _curMaterType + "'"
  559. if (drs.Length > 0)
  560. {
  561. for (int j = 0; j < drs.Length; j++)
  562. {
  563. if (drs[j]["MATERIELCODE"].ToString() != "")
  564. {
  565. SetPicText((_curMaterType == "WS"), drs[j]["MSNUMID"].ToString(), drs[j]["MATERIELFORSHORT"].ToString(), drs[j]["MATERIELTYPE"].ToString());
  566. bFlag = true;
  567. break;
  568. }
  569. }
  570. }
  571. if (false == bFlag)
  572. SetPicText((_curMaterType == "WS"), dr["MSNUMID"].ToString(), dr["MATERIELFORSHORT"].ToString(), dr["MATERIELTYPE"].ToString());
  573. if (bFlag)
  574. bFlag = false;
  575. }
  576. catch { }
  577. }
  578. }
  579. }
  580. //显示料斗配置信息
  581. private void radioButton_Click(object sender, System.EventArgs e)
  582. {
  583. this.btAdd.Enabled = true;
  584. if (_curMaterType != ((RadioButton)sender).Tag.ToString())
  585. _curMaterType = ((RadioButton)sender).Tag.ToString();
  586. else
  587. return;
  588. if (_curMaterType != "WS")
  589. {
  590. // this.ultraGroupBox4.Visible = false;
  591. // this.rbWS.Enabled=false; // 喂丝料按钮
  592. // this.ultraGroupBox3.Dock = DockStyle.Fill;
  593. panel2.Enabled = true;
  594. panel3.Enabled = false;
  595. }
  596. else // 物料类型为喂丝
  597. {
  598. // this.ultraGroupBox3.Visible = false;
  599. // this.rbWS.Enabled = true; // 喂丝料按钮
  600. // this.rbFZL.Enabled = false;
  601. // this.rbHJ.Enabled = false;
  602. // this.ultraGroupBox4.Dock = DockStyle.Fill;
  603. panel2.Enabled = false;
  604. panel3.Enabled = true;
  605. }
  606. ClearLableText();
  607. SetPicNoSelectState();
  608. GetDataForHopper();
  609. if (chkdevNo.Checked)
  610. {
  611. if (this.m_dtStationconMaterial.Rows.Count > 0)
  612. {
  613. this.m_dtStationconMaterial.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  614. ulgridMtrInfo.DataSource = this.m_dtStationconMaterial;
  615. }
  616. }
  617. else
  618. {
  619. this.m_dtMain.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  620. ulgridMtrInfo.DataSource = this.m_dtMain;
  621. }
  622. this.ulgridMtrInfo.UpdateData();
  623. }
  624. private void chkdevNo_CheckedChanged(object sender, EventArgs e)
  625. {
  626. try
  627. {
  628. if (chkdevNo.Checked)
  629. {
  630. this.m_dtStationconMaterial.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  631. ulgridMtrInfo.DataSource = this.m_dtStationconMaterial;
  632. }
  633. else
  634. {
  635. this.m_dtMain.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  636. ulgridMtrInfo.DataSource = this.m_dtMain;
  637. }
  638. this.ulgridMtrInfo.UpdateData();
  639. }
  640. catch
  641. {
  642. }
  643. }
  644. }
  645. }