You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
968 B
30 lines
968 B
using DotNetty.Transport.Channels;
|
|
using log4net;
|
|
using Service.Charger.Client;
|
|
using Service.Charger.Handler;
|
|
|
|
namespace Service.Charger.Msg.Charger.OutCharger.Req;
|
|
/// <summary>
|
|
/// 3.7.11 充电桩遥信数据上报
|
|
/// </summary>
|
|
public class PileUploadRemoteSignalHandler: SimpleChannelInboundHandler<PileUploadRemoteSignal>, IBaseHandler
|
|
{
|
|
private static readonly ILog Log = LogManager.GetLogger(typeof(PileUploadRemoteSignalHandler));
|
|
|
|
|
|
protected override void ChannelRead0(IChannelHandlerContext ctx, PileUploadRemoteSignal msg)
|
|
{
|
|
if (ClientMgr.TryGetClient(ctx.Channel, out var sn, out var client))
|
|
{
|
|
//存储日志
|
|
Log.Info($"receive {msg} from {sn}");
|
|
|
|
client.Workstate = msg.WorkStatus;
|
|
client.IsCharged = msg.WorkStatus == 1 ? true : false;
|
|
client.TotalError = msg.TotalError;
|
|
client.TotalWarning = msg.TotalWarning;
|
|
|
|
|
|
}
|
|
}
|
|
} |