|
|
@ -27,6 +27,7 @@ using Newtonsoft.Json.Linq; |
|
|
|
using System.Xml.Linq; |
|
|
|
using ScottPlot; |
|
|
|
using System.Collections; |
|
|
|
using DyeingComputer.UserClass; |
|
|
|
|
|
|
|
namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
{/// <summary>
|
|
|
@ -49,6 +50,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
drEmployee.AcceptChanges(); |
|
|
|
drEmployee.ClearErrors(); |
|
|
|
|
|
|
|
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_OK"); |
|
|
|
|
|
|
|
return EasyTask.CompletedTask; |
|
|
|
};//成功连接到服务器
|
|
|
|
tcpClient.Closing = (client, e) => |
|
|
@ -59,6 +62,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
drEmployee.EndEdit(); |
|
|
|
drEmployee.AcceptChanges(); |
|
|
|
drEmployee.ClearErrors(); |
|
|
|
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_STOP"); |
|
|
|
|
|
|
|
return EasyTask.CompletedTask; |
|
|
|
};//即将从服务器断开连接。此处仅主动断开才有效。
|
|
|
@ -70,6 +74,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
drEmployee.EndEdit(); |
|
|
|
drEmployee.AcceptChanges(); |
|
|
|
drEmployee.ClearErrors(); |
|
|
|
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_INTERRUPT"); |
|
|
|
|
|
|
|
return EasyTask.CompletedTask; |
|
|
|
};//从服务器断开连接,当连接不成功时不会触发。
|
|
|
@ -100,20 +105,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
_new = JsonConvert.DeserializeObject<Dictionary<string, object>>(DAT);//反序列化
|
|
|
|
DataRow drEmployee = MainWindowViewModel.Machines.Select("IP='" + client.IP + "' AND port='" + client.Port + "'").First(); |
|
|
|
drEmployee.BeginEdit(); |
|
|
|
drEmployee["Message"] = _new.GetValue("Status").ToString(); |
|
|
|
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder").ToString(); |
|
|
|
drEmployee["Temperature"] = _new.GetValue("MTT").ToString(); |
|
|
|
drEmployee["WaterLevel"] = _new.GetValue("MTL").ToString(); |
|
|
|
drEmployee["Process"] = _new.GetValue("Process").ToString(); |
|
|
|
drEmployee["Step"] = _new.GetValue("Step").ToString(); |
|
|
|
drEmployee["Message"] = _new.GetValue("Status"); |
|
|
|
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder"); |
|
|
|
drEmployee["Temperature"] = _new.GetValue("MTT"); |
|
|
|
drEmployee["WaterLevel"] = _new.GetValue("MTL"); |
|
|
|
drEmployee["Process"] = _new.GetValue("Process"); |
|
|
|
drEmployee["Step"] = _new.GetValue("Step"); |
|
|
|
drEmployee.EndEdit(); |
|
|
|
drEmployee.AcceptChanges(); |
|
|
|
drEmployee.ClearErrors(); |
|
|
|
|
|
|
|
if (_new.GetValue("Status").ToString() != "----------") |
|
|
|
{ |
|
|
|
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
|
|
|
// Chart_new.Add("DYELOT", _new.GetValue("Status"));
|
|
|
|
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
|
|
|
Chart_new.Add("WorkOrder", _new.GetValue("WorkNumder")); |
|
|
|
Chart_new.Add("Machine", _new.GetValue("Machine")); |
|
|
|
Chart_new.Add("Time", _new.GetValue("Time")); |
|
|
|