Browse Source

通讯逻辑修改

master
sc 2 months ago
parent
commit
e4e7853624
  1. 13
      UserClass/AsyncTcpClient.cs
  2. 6
      View/MonitorView.xaml.cs
  3. 3
      ViewModel/MainWindowViewModel.cs

13
UserClass/AsyncTcpClient.cs

@ -10,6 +10,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
using System.Diagnostics;
using System.Linq;
using System.Net;
@ -53,6 +54,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
drEmployee["State"] = "801";
drEmployee.EndEdit();
drEmployee.AcceptChanges();
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_OK");
}
catch (Exception ex)
@ -385,15 +387,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
.SetMinBufferSize(1024*64)
.SetRemoteIPHost(ip + ":" + port)
.ConfigurePlugins(a =>
{
a.UseCheckClear()
.SetCheckClearType(CheckClearType.All)
.SetTick(TimeSpan.FromSeconds(5))
.SetOnClose((c, t) =>
{
c.TryShutdown();
});
// a.UseTcpReconnection();//触发型重连
{
// a.UseTcpReconnection();//触发型重连
})
.ConfigureContainer(a =>
{

6
View/MonitorView.xaml.cs

@ -376,6 +376,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
dat_821.Add("P4", P4);
dat_821.Add("P5", P5);
DataRow row = MainWindowViewModel.dt_TP.Select("Step='" + ID + "'").First();
row.BeginEdit();
row["RUN"] = 2;
row.EndEdit();
row.AcceptChanges();
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString

3
ViewModel/MainWindowViewModel.cs

@ -329,7 +329,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
stringQueue.Enqueue(new QueueString
{
ID = i,
DAT = "SC800:SCCM[" + MachiensTcpClient[i].IP + ";" + MachiensTcpClient[i].Port + "]"
DAT = "SC800:SCCM[" + Selet_Machines(Machines, "IP", "ID='" + i + "'") + ";" +
Selet_Machines(Machines, "Prot", "ID='" + i + "'") + "]"
});//信息插入队列
}

Loading…
Cancel
Save