48 lines
1.5 KiB
C#
Raw Normal View History

2025-04-24 19:31:28 +08:00
using JiShe.CollectBus.Protocol.Contracts.Interfaces;
using JiShe.CollectBus.Protocol.Contracts.Models;
using JiShe.CollectBus.Protocol.Contracts.Protocol.Dto;
using JiShe.CollectBus.Protocol.Dto;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.CollectBus.Protocol.AnalysisData.AFN_00H
{
/// <summary>
/// 5.1.3.2 F2全部否认
/// </summary>
public class AFN0_F2_Analysis : IAnalysisStrategy<TB3761, UnitDataAnalysis<bool>>
{
private readonly ILogger<AFN0_F2_Analysis> _logger;
public AFN0_F2_Analysis(ILogger<AFN0_F2_Analysis> logger)
{
_logger = logger;
}
public Task<UnitDataAnalysis<bool>> ExecuteAsync(TB3761 input)
{
try
{
ArgumentNullException.ThrowIfNull(input);
UnitDataAnalysis<bool> dto = new UnitDataAnalysis<bool>
{
Code = input.A.Code,
AFN = input.AFN_FC.AFN,
Fn = input.DT.Fn,
Pn = input.DA.Pn,
Data = false,
};
return Task.FromResult(dto);
}
catch (Exception ex)
{
_logger.LogError(ex, $"00_2解析失败:{input.A?.Code}-{input.DT?.Fn ?? 0}-{input?.BaseHexMessage?.HexMessageString},{ex.Message}");
return null;
}
}
}
}