frmTest.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.StlMes.Client.LgClassModel;
  11. namespace Core.StlMes.Client.LgCommon
  12. {
  13. public partial class frmTest : FrmBase
  14. {
  15. public frmTest()
  16. {
  17. InitializeComponent();
  18. }
  19. private string _DEVICE_POSITION = "HMP01"; // 设备位置
  20. private int _DEVICE_POS = 1; // 设备号
  21. private CommandCollection CC = new CommandCollection();
  22. private void frmTest_Load(object sender, EventArgs e)
  23. {
  24. ClsBusinessPack.getCommandCollection(_DEVICE_POSITION, CC, ob);
  25. ucResAdditiveBase1.SetOpeBase(this.ob);
  26. ucResAdditiveBase2.SetOpeBase(this.ob);
  27. ucResAdditiveBase3.SetOpeBase(this.ob);
  28. GetMaterialData();
  29. SetHopperInfo();
  30. SetManualAddtInfo();
  31. ucResAdditiveBase1.SetAdditiveData(null);
  32. ucResAdditiveBase2.SetAdditiveData(null);
  33. ucResAdditiveBase3.SetAdditiveData(null);
  34. //ucResPlan1.SetValuelistSteel(ob);
  35. //ucResPlanCcm1.SetValuelistSteel(ob);
  36. //ucResCcm1.GetValuelistProtectiveSlag(ob);
  37. //ucHeatNoQuery1.SetSteelDropDownList(ob);
  38. }
  39. private void button1_Click(object sender, EventArgs e)
  40. {
  41. ClsBusinessPack.getCommandCollection(((Button)sender).Text.Substring(0, 3), CC, ob);
  42. frmManualOperate frm = new frmManualOperate(((Button)sender).Text.Substring(0, 5), ((Button)sender).Text, CC);
  43. frm.Location = ClsControlPack.GetChildWindowLocation(frm.Size);
  44. frm.ShowDialog();
  45. }
  46. private DataTable _dtMaterial;
  47. /// <summary>
  48. /// 获取物料信息
  49. /// </summary>
  50. private void GetMaterialData()
  51. {
  52. bool bSuccess = false;
  53. string strMsg = "";
  54. DataSet ds = ClsDataAccessPack.GetMaterialData(out bSuccess, out strMsg, ob);
  55. if (bSuccess) _dtMaterial = ds.Tables[0];
  56. }
  57. /// <summary>
  58. /// 初始化自动加料料仓配置
  59. /// </summary>
  60. private void SetHopperInfo()
  61. {
  62. try
  63. {
  64. string strMsg = "";
  65. bool bSuccess = false;
  66. DataSet ds = ClsBusinessPack.GetHopperConfig("BOF01", out bSuccess, out strMsg, ob);
  67. if (ds != null && ds.Tables.Count > 0)
  68. {
  69. ucResAdditiveBase1.SetHopperInfo(ds.Tables[0], this._dtMaterial);
  70. ucResAdditiveBase2.SetHopperInfo(ds.Tables[0], this._dtMaterial);
  71. }
  72. }
  73. catch { }
  74. }
  75. /// <summary>
  76. /// 初始化手投料配置
  77. /// </summary>
  78. private void SetManualAddtInfo()
  79. {
  80. try
  81. {
  82. string strMsg = "";
  83. bool bSuccess = false;
  84. DataSet ds = ClsBusinessPack.GetManualAdditiveConfig("BOF01", out bSuccess, out strMsg, ob);
  85. if (ds != null && ds.Tables.Count > 0)
  86. {
  87. ucResAdditiveBase3.SetHopperInfo(ds.Tables[0], this._dtMaterial);
  88. }
  89. }
  90. catch { }
  91. }
  92. }
  93. }