|
|
@ -743,11 +743,13 @@ namespace DyeingComputer.UserClass |
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
|
} |
|
|
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "IOLog") |
|
|
|
{ |
|
|
|
|
|
|
|
{ |
|
|
|
var dt_ = APILog.LOGSELECT("select * from IOLog where TIME >'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'"); |
|
|
|
dt_.Columns.Remove("type"); |
|
|
|
dt_.Columns.Remove("Value"); |
|
|
|
dt_.Columns.Remove("PLC"); |
|
|
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
|
|
|
|
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
@ -839,16 +841,14 @@ namespace DyeingComputer.UserClass |
|
|
|
}; |
|
|
|
|
|
|
|
await service.SetupAsync(new TouchSocketConfig()//载入配置
|
|
|
|
.SetMaxBufferSize(1024 * 1024) |
|
|
|
.SetMinBufferSize(1024 * 64) |
|
|
|
.SetMaxBufferSize(1024 * 1024 * 100) |
|
|
|
.SetMinBufferSize(1024 * 1024) |
|
|
|
.SetListenIPHosts(new IPHost[] { new IPHost("tcp://127.0.0.1:7789"), new IPHost(7790) })//同时监听两个地址
|
|
|
|
.ConfigureContainer(a =>//容器的配置顺序应该在最前面
|
|
|
|
{ |
|
|
|
//a.AddConsoleLogger();//添加一个控制台日志注入(注意:在maui中控制台日志不可用)
|
|
|
|
}) |
|
|
|
.ConfigurePlugins(a => |
|
|
|
{ |
|
|
|
//a.Add<DifferentProtocolPlugin>();
|
|
|
|
}) |
|
|
|
); |
|
|
|
await service.StartAsync();//启动
|
|
|
|