MES对接

This commit is contained in:
a88359121
2025-07-29 15:14:39 +08:00
parent c45e3622af
commit a1ba7e36a3
3 changed files with 26 additions and 13 deletions
+16 -3
View File
@@ -138,9 +138,9 @@ namespace JinYuan.ControlCenters
{ {
DicStationFunction = new Dictionary<string, dgStationFunction>(); DicStationFunction = new Dictionary<string, dgStationFunction>();
DicStationFunction.Add("外观检测进站", FeedingStation); DicStationFunction.Add("电芯进站", FeedingStation);
DicStationFunction.Add("NG出站", NGStation); //DicStationFunction.Add("NG出站", NGStation);
DicStationFunction.Add("外观检测出站", BlankingStation); //DicStationFunction.Add("外观检测出站", BlankingStation);
for (int i = 0; i < CommonMethods.ChatLineCount; i++) for (int i = 0; i < CommonMethods.ChatLineCount; i++)
{ {
@@ -273,6 +273,19 @@ namespace JinYuan.ControlCenters
} }
else else
{ {
//if (DicStationFunction.TryGetValue(pf.GroupName, out var func))
//{
// func.BeginInvoke(resByte, pf, ar =>
// {
// try { func.EndInvoke(ar); }
// catch (Exception ex)
// {
// CommonMethods.AddLog(true, ex.Message);
// LogHelper.Instance.WriteEX(ex);
// }
// }, null);
//}
//// private Dictionary<string, dgStationFunction> DicStationFunction;
DicStationFunction[pf.GroupName].BeginInvoke(resByte, pf, null, null);//信息解析 DicStationFunction[pf.GroupName].BeginInvoke(resByte, pf, null, null);//信息解析
} }
} }
+1 -1
View File
@@ -34,7 +34,7 @@ namespace JinYuan.MES
StringContent stringContent = new StringContent(strJosnData, Encoding.UTF8, "application/json"); StringContent stringContent = new StringContent(strJosnData, Encoding.UTF8, "application/json");
string ResponseMessage= new HttpClient() string ResponseMessage= new HttpClient()
{ {
Timeout = TimeSpan.FromSeconds(6.0) Timeout = TimeSpan.FromSeconds(3.0)
}.PostAsync(url, (HttpContent)stringContent).Result.Content.ReadAsStringAsync().Result; }.PostAsync(url, (HttpContent)stringContent).Result.Content.ReadAsStringAsync().Result;
return ResponseMessage; return ResponseMessage;
} }
+1 -1
View File
@@ -117,7 +117,7 @@ namespace LargeSquareOne
using (new TimerReset(m_RefreshTimer, 2000)) using (new TimerReset(m_RefreshTimer, 2000))
{ {
Refish12ProdQty(); Refish12ProdQty();
RefreshXiaoLvData(); RefreshXiaoLvData();//设备综合效率
RefreshChatTop10AlarmData(); RefreshChatTop10AlarmData();
RefreshChatNGData(); RefreshChatNGData();
} }