1
huangxiaoqiang
5 天以前 60f86b0fba3ab82e245654cddfa5abc62fe1f9e8
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -20,6 +20,7 @@
using WIDESEAWCS_Tasks;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_Tasks.DBNames;
using WIDESEAWCS_Tasks.StackPlateJob;
using static Dm.net.buffer.ByteArrayBuffer;
namespace WIDESEAWCS_Server.Controllers
@@ -325,6 +326,22 @@
                {
                    return content.Error($"未找到对应设备");
                }
                if (device.DeviceCode.Contains("Plate"))
                {
                    CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                    StackPlateTaskCommandCommand command = commonConveyorLine.ReadCustomer<StackPlateTaskCommandCommand>(device.DeviceCode);
                    if (command != null && command.State == 2 && command.InteractiveSignal == 1)
                    {
                        return content.OK("允许放料");
                    }
                    else
                    {
                        return content.Error("禁止放料");
                    }
                }
                else
                {
                OtherDevice otherDevice = (OtherDevice)device;
@@ -378,7 +395,7 @@
                        return content.Error("禁止放料");
                    }
                }
                }
                return content;
            }
            catch (Exception ex)
@@ -408,7 +425,14 @@
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                if (device.DeviceCode.Contains("Plate"))
                {
                    CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                    commonConveyorLine.SetValue(StackPlateDBName.WriteInteractiveSignal, Convert.ToInt16(2), device.DeviceCode);
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                OtherDevice otherDevice = (OtherDevice)device;
                if (device.DeviceCode.Contains("Coveryor"))//接驳台
                {
@@ -417,6 +441,7 @@
                else if (device.DeviceCode.Contains("Retract"))//伸缩货叉
                {
                    otherDevice.SetValue(RetractDB.Ret_PutFinish, true, stationManger.StationDeviceCode);
                    }
                }
                return WebResponseContent.Instance.OK();
            }
@@ -448,7 +473,22 @@
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备{stationManger.StationDeviceCode}");
                }
                if (device.DeviceCode.Contains("Plate"))
                {
                    CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                    StackPlateTaskCommandCommand command = commonConveyorLine.ReadCustomer<StackPlateTaskCommandCommand>(device.DeviceCode);
                    if (command != null&&command.State == 2 && command.InteractiveSignal == 2)
                    {
                        return content.OK("允许取料");
                    }
                    else
                    {
                        return content.Error("禁止取料");
                    }
                }
                else
                {
                OtherDevice otherDevice = (OtherDevice)device;
                if (otherDevice.DeviceCode.Contains("CP"))//成品输送线
@@ -487,7 +527,7 @@
                        return content.Error("禁止取料");
                    }
                }
                }
                return content;
            }
            catch (Exception ex)
@@ -517,7 +557,14 @@
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                if (device.DeviceCode.Contains("Plate"))
                {
                    CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                    commonConveyorLine.SetValue(StackPlateDBName.WriteInteractiveSignal, Convert.ToInt16(2), device.DeviceCode);
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                OtherDevice otherDevice = (OtherDevice)device;
                if (device.DeviceCode.Contains("CP"))
                {
@@ -531,6 +578,7 @@
                {
                    otherDevice.SetValue(RetractDB.Ret_TakeFinish, true, stationManger.StationDeviceCode);
                }
                }
                return WebResponseContent.Instance.OK();
            }