|
@@ -3,7 +3,9 @@ using DevComponents.DotNetBar.SuperGrid;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Data;
|
|
|
+using System.Linq;
|
|
|
using System.Windows.Forms;
|
|
|
+using WCS.Entity.Protocol;
|
|
|
using WCS_Client.UC;
|
|
|
using WCS_Client.Utility;
|
|
|
|
|
@@ -115,13 +117,79 @@ where DBCODE not like '%521%' and DBCODE not like '%523%' and DBCODE not like '%
|
|
|
|
|
|
private void ClikMethod(DataRow dr)
|
|
|
{
|
|
|
- try
|
|
|
+ var pack = eqpData.deviceDataPack;
|
|
|
+ if (pack is null)
|
|
|
{
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
+ MessageBox.Show("该设备无数据。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ TryCachHelper.TryExecute((db) =>
|
|
|
{
|
|
|
- MessageUtil.ShowTips(ex.Message);
|
|
|
- }
|
|
|
+ string equName = dr["CODE"].ToString();
|
|
|
+ DataTable dt = null;
|
|
|
+ if (pack.SCDatas.Datas.Any(p => p.Code == equName))
|
|
|
+ {
|
|
|
+ var rgvdata = pack.SCDatas;//堆垛机数据
|
|
|
+ var plcItem = pack.SCDatas.Datas.Where(o => o.Code == equName).FirstOrDefault();
|
|
|
+ if (plcItem == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("该设备无数据。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dt = plcItem.GetAttributesDataTable();
|
|
|
+ }
|
|
|
+ else if (pack.RGVDatas.Datas.Any(p => p.Code == equName))
|
|
|
+ {
|
|
|
+ var rgvdata = pack.RGVDatas;//RGV数据
|
|
|
+ var plcItem = pack.RGVDatas.Datas.Where(o => o.Code == equName).FirstOrDefault();
|
|
|
+ if (plcItem == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("该设备无数据。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dt = plcItem.GetAttributesDataTable();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (pack.StationDatas.Datas.Any(p => p.Code == equName))
|
|
|
+ {
|
|
|
+ var convdata = pack.StationDatas;//输送机数据
|
|
|
+ var plcItem = pack.StationDatas.Datas.Where(o => o.Code == equName).FirstOrDefault();
|
|
|
+ if (plcItem == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("该设备无数据。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dt = plcItem.GetAttributesDataTable();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (dt == null)
|
|
|
+ return;
|
|
|
+ string QeuMsg = null;
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ for (int j = 1; j < dt.Columns.Count; j++)
|
|
|
+ {
|
|
|
+ if (j == 1)
|
|
|
+ QeuMsg += "[" + dt.Rows[i][0].ToString() + "]" + "\r\n" + dt.Rows[i][j] + ":";
|
|
|
+ else
|
|
|
+ QeuMsg += dt.Rows[i][j];
|
|
|
+ }
|
|
|
+ QeuMsg += "\r\n";
|
|
|
+ }
|
|
|
+ textBox1.Text = QeuMsg;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ //}
|
|
|
+ //catch (Exception ex)
|
|
|
+ //{
|
|
|
+ // MessageUtil.ShowTips(ex.Message);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|