SingleForkRGVAnalysis.cs 1.14 KB
using HHECS.BllModel;
using HHECS.DAQHandle.Dto;
using HHECS.DAQShared.Common.Enums;
using HHECS.DAQShared.Common.Utils;
using HHECS.DAQShared.Models;

namespace HHECS.DAQHandle.EquipmentHandle
{
    /// <summary>
    /// RGV设备解析
    /// </summary>
    /// <remarks>对应ECS调度的设备</remarks>
    internal class SingleForkRGVAnalysis : AnalysisBase
    {
        public SingleForkRGVAnalysis(AnalysisParameter parameter) : base(parameter) { }

        protected override BllResult<EquipmentStatus> GetEquipmentStatus(EquipmentExtend equipment, EquipmentDataRecord record)
        {
            try
            {
                var tagResult = JsonConvertToTagList(record.Tags);
                if (!tagResult.Success)
                {
                    return BllResultFactory.Error<EquipmentStatus>(tagResult.Msg);
                }
                return EquipmentStatusHelper.GetEquipmentStatus(EquipmentTypeConst.SingleForkRGV, equipment.EquipmentProps, tagResult.Data);
            }
            catch (Exception ex)
            {
                return BllResultFactory.Error<EquipmentStatus>(ex.Message);
            }
        }
    }
}