Merge branch 'master' of http://192.168.110.57:3000/guor/SOMS
This commit is contained in:
commit
af3c58c0e9
@ -46,7 +46,6 @@ namespace Yunda.SOMS.DataMonitoringServer.ProtectionDeviceHandle
|
||||
_redisDataRepository = redisDataRepository;
|
||||
_dotNettyTcpServer.MessageReceived += OnMessageReceived; // 订阅事件
|
||||
_deviceBoardStatesRedis = redisRepository;
|
||||
|
||||
}
|
||||
//Dictionary<byte, DeviceInfo> _deviceRunStates = new Dictionary<byte, DeviceInfo>();
|
||||
//private ConcurrentDictionary<byte, int> _communicationStateCounts = new();
|
||||
@ -199,7 +198,7 @@ namespace Yunda.SOMS.DataMonitoringServer.ProtectionDeviceHandle
|
||||
}
|
||||
boardStates[0].Value = new BitArray(new byte[] { data[0] })[0] ? 0 : 1;//运行状态
|
||||
boardStates[1].Value = new BitArray(new byte[] { data[0] })[1] ? 0 : 1;//报警状态
|
||||
boardStates[7].Value = new BitArray(new byte[] { data[1] })[0] ? 0 : 1; // 液晶状态
|
||||
boardStates[7].Value = new BitArray(new byte[] { data[1] })[7] ? 0 : 1; // 液晶状态
|
||||
BitArray bit2 = new BitArray(new byte[] { data[2] });
|
||||
boardStates[2].Value = bit2[0] ? 0 : 1;
|
||||
boardStates[3].Value = bit2[1] ? 0 : 1;
|
||||
|
@ -33,7 +33,7 @@ namespace Yunda.SOMS.DataMonitoringServer.ProtectionDeviceHandle
|
||||
}
|
||||
private void OnMessageReceived(byte address, byte[] message, byte functionType)
|
||||
{
|
||||
|
||||
|
||||
if (functionType == 3)//装置版本信息报文
|
||||
{
|
||||
string messageStr = BitConverter.ToString(message);
|
||||
|
@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -143,6 +144,10 @@ namespace Yunda.SOMS.DataMonitoringServer.TcpSocket.Server
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DateTime.Now.Hour == 0&&DateTime.Now.Minute == 5&& DateTime.Now.Second<30)
|
||||
{
|
||||
await SendCustomMessageAsync(ctx, address, 0, 4, 0);//发送版本信息请求
|
||||
}
|
||||
UpdateConnectionContext(address, ctx);
|
||||
await UpdateCommunicationStateCountAsync(address, ctx);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user