dengjunjie
2 天以前 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs
@@ -123,9 +123,9 @@
        public static WebResponseContent AGVRequestinProductionLine(ConveyorLineDTO conveyor)
        {
            WebResponseContent content = new WebResponseContent();
            OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice;
            try
            {
                OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice;
                if (ProductionLine == null) throw new Exception("未找到产线设备信息");
                if (!ProductionLine.IsConnected) throw new Exception($"产线设备通讯异常");
                content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, conveyor.Type);
@@ -135,7 +135,8 @@
                switch (conveyor.Type)
                {
                    case 1:
                        if (agvState != conveyor.Type) throw new Exception("产线不允许进入作业");
                        if (agvState != conveyor.Type) throw new Exception($"AGV申请进入,产线不允许进入作业,产线信号【{agvState}】");
                        ProductionLine?.Communicator.LogNet.WriteDebug($"AGV申请进入,产线允许进入作业,产线信号【{agvState}】");
                        content.OK();
                        break;
                    case 2:
@@ -144,7 +145,7 @@
                        break;
                    case 3:
                        content.Status = ProductionLine.SetValue(ProductionLineDBName.Wrequest, 2);
                        //if (content.Status) content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, 3);
                        ProductionLine?.Communicator.LogNet.WriteDebug($"AGV已离开,任务完成");
                        break;
                }
                content = content.Status ? content.OK() : content.Error("写入失败");
@@ -152,6 +153,7 @@
            catch (Exception ex)
            {
                content.Error(ex.Message);
                ProductionLine?.Communicator.LogNet.WriteDebug(ex.Message);
            }
            return content;
        }