FrmEquMsg_dtl.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using DevComponents.DotNetBar.Layout;
  2. using DevComponents.DotNetBar.SuperGrid;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Windows.Forms;
  7. using WCS_Client.UC;
  8. using WCS_Client.Utility;
  9. namespace WCS_Client.Frm
  10. {
  11. public partial class FrmEquMsg_dtl : Form
  12. {
  13. private DataTable dt = null;
  14. private string DEVICECODE = string.Empty;
  15. public FrmEquMsg_dtl(string equNo)
  16. {
  17. InitializeComponent();
  18. DEVICECODE = equNo.ToUpper();
  19. InitFrm();
  20. }
  21. private void InitFrm()
  22. {
  23. var pack = eqpData.deviceDataPack;
  24. if (pack is null)
  25. {
  26. MessageBox.Show("该设备无数据。");
  27. return;
  28. }
  29. if (pack.StationDatas.Datas.Any(p => p.Code == DEVICECODE))
  30. {
  31. var convdata = pack.StationDatas;//输送机数据
  32. var plcItem = pack.StationDatas.Datas.Where(o => o.Code == DEVICECODE).FirstOrDefault();
  33. if (plcItem == null)
  34. {
  35. MessageBox.Show("该设备无数据。");
  36. return;
  37. }
  38. dt = plcItem.GetAttributesDataTable();
  39. }
  40. if (pack.RGVDatas.Datas.Any(p => p.Code == DEVICECODE))
  41. {
  42. var rgvdata = pack.RGVDatas;//RGV数据
  43. var plcItem = pack.RGVDatas.Datas.Where(o => o.Code == DEVICECODE).FirstOrDefault();
  44. if (plcItem == null)
  45. {
  46. MessageBox.Show("该设备无数据。");
  47. return;
  48. }
  49. dt = plcItem.GetAttributesDataTable();
  50. }
  51. if (pack.SCDatas.Datas.Any(p => p.Code == DEVICECODE))
  52. {
  53. var rgvdata = pack.SCDatas;//堆垛机数据
  54. var plcItem = pack.SCDatas.Datas.Where(o => o.Code == DEVICECODE).FirstOrDefault();
  55. if (plcItem == null)
  56. {
  57. MessageBox.Show("该设备无数据。");
  58. return;
  59. }
  60. dt = plcItem.GetAttributesDataTable();
  61. }
  62. string result = string.Empty;
  63. List<GridColumn> GCList = new List<GridColumn>()
  64. {
  65. SuperGridUtil.Get_GridColumn("信号名称", "信号名称", 200),
  66. SuperGridUtil.Get_GridColumn("信号值", "信号值", 160),
  67. SuperGridUtil.Get_GridColumn("信号说明", "信号说明", 900),
  68. };
  69. List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
  70. string buttonName = string.Format("刷新(设备编号:[{0}])", DEVICECODE);
  71. LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", buttonName, 180, 30, SubmitMethods));
  72. uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethodsms, RefreshRoleMethodsms, DoubleClikMethod, null, null);
  73. CommonShow.ShowProcessing("正在处理中,请稍候...", this, (obj) =>
  74. {
  75. uC_QueryPage1.RefreshData(1, 0);
  76. }, null);
  77. }
  78. private PageData QueryPageDataMethodsms(int PageIndex, int PageSize)
  79. {
  80. PageData pd = BaseWorkflow.QueryDatatble(dt, PageIndex, PageSize);
  81. return pd;
  82. }
  83. private void RefreshRoleMethodsms(bool ChkValue)
  84. {
  85. }
  86. private void DoubleClikMethod(DataRow dr)
  87. {
  88. }
  89. private void SubmitMethods(string LCName)
  90. {
  91. if (LCName == "btn_QDB")
  92. {
  93. }
  94. }
  95. }
  96. }