dengjunjie
2025-06-17 4f39dcc195f28fa275fc2d065fbf1bf6a46c21b7
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs
@@ -1,17 +1,10 @@
using HslCommunication;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.StackerCrane;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
namespace WIDESEAWCS_Tasks.StackerCraneJob
{
@@ -56,7 +49,7 @@
        /// </summary>
        /// <param name="speStackerCrane"></param>
        /// <returns></returns>
        public int WorkCommandValue() => _speStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkCommand);
        //public int WorkCommandValue() => _speStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkCommand);
        /// <summary>
        /// èŽ·å–å †åž›æœºè®¾å¤‡çŠ¶æ€
@@ -111,7 +104,7 @@
        private string GetStatus(string protocolParamType)
        {
            List<DeviceProDTO> devicePros = _speStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == protocolParamType).ToList();
            List<DeviceProDTO> devicePros = _speStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamName == protocolParamType).ToList();
            if (devicePros.Count == 0)
            {
                throw new Exception("未获取到协议信息");
@@ -120,7 +113,7 @@
            {
                object readStatus = _speStackerCrane.Communicator.ReadAsObj(devicePros[i].DeviceProAddress, devicePros[i].DeviceDataType);
                DeviceProtocolDetailDTO? deviceProtocolDetail = _speStackerCrane.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePros[i].DeviceProParamName) ?? throw new Exception();
                deviceProtocolDetail = _speStackerCrane.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePros[i].DeviceProParamType && x.ProtocalDetailValue.Equals(readStatus.ToString()));
                deviceProtocolDetail = _speStackerCrane.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePros[i].DeviceProParamName && x.ProtocalDetailValue.Equals(readStatus.ToString()));
                if (deviceProtocolDetail != null)
                {
                    return deviceProtocolDetail.ProtocolDetailType;
@@ -221,9 +214,9 @@
                    _speStackerCrane.SetValue(StackerCraneDBName.EndRow, command.EndRow);
                    _speStackerCrane.SetValue(StackerCraneDBName.EndColumn, command.EndColumn);
                    _speStackerCrane.SetValue(StackerCraneDBName.EndLayer, command.EndLayer);
                    _speStackerCrane.SetValue(StackerCraneDBName.Barcode, command.Barcode);
                    //_speStackerCrane.SetValue(StackerCraneDBName.Barcode, command.Barcode);
                    _speStackerCrane.SetValue(StackerCraneDBName.WorkType, command.WorkType);
                    _speStackerCrane.SetValue(StackerCraneDBName.TrayType, command.TrayType);
                    //_speStackerCrane.SetValue(StackerCraneDBName.WorkType, command.TrayType);
                    return true;
                }
                return false;