liudl
8 天以前 3b4ab19a4b05e098e971746c692a0d012fde7445
Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -53,7 +53,7 @@
                modPlc = plcList.FirstOrDefault(m => m.Text == "1层托盘输送线");
                if (modPlc == null)
                    throw Oops.Bah($"未查询到{input.Layer}楼层PLC信息");
                DbNum = "";
                DbNum = "DB91";
                break;
            case "2":
                modPlc = plcList.FirstOrDefault(m => m.Text == "2层托盘输送线");
@@ -65,7 +65,7 @@
                modPlc = plcList.FirstOrDefault(m => m.Text == "3层托盘输送线");
                if (modPlc == null)
                    throw Oops.Bah($"未查询到{input.Layer}楼层PLC信息");
                DbNum = "";
                DbNum = "DB91";
                break;
            default:
                throw Oops.Bah("楼层信息错误");
@@ -483,7 +483,8 @@
                modPlc = plcList.FirstOrDefault(m => m.Text == "1层托盘输送线");
                if (modPlc == null)
                    throw Oops.Bah($"未查询到{input.Layer}楼层PLC信息");
                DbNum = "";
                DbNum = "DB91";
                TaskDbNum = "DB1100";
                break;
            case "2":
                modPlc = plcList.FirstOrDefault(m => m.Text == "2层托盘输送线");
@@ -496,7 +497,8 @@
                modPlc = plcList.FirstOrDefault(m => m.Text == "3层托盘输送线");
                if (modPlc == null)
                    throw Oops.Bah($"未查询到{input.Layer}楼层PLC信息");
                DbNum = "";
                DbNum = "DB91";
                TaskDbNum = "DB1100";
                break;
            default:
                throw Oops.Bah("楼层信息错误");
@@ -549,6 +551,11 @@
                Thread.Sleep(1000);
                modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.2", "false");
                break;
            case "applyTask":
                modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.1", "true");
                Thread.Sleep(1000);
                modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.1", "false");
                break;
            default:
                break;
@@ -579,7 +586,71 @@
            modPlc = plcList.FirstOrDefault(m => m.Text == "1层托盘输送线");
            if (modPlc == null)
                throw Oops.Bah($"未查询到1楼层PLC信息");
            DbNum = "";
            DbNum = "DB91";
            PLCUtil modUtil = new PLCUtil(modPlc);
            switch (input.Type)
            {
                case "OnePalletStart":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                case "OnePalletStop":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                case "OneBoxStart":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.2", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.2", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                case "OneBoxStop":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.3", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.3", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                default:
                    break;
            }
            modUtil.Close();
        }
        else if (input.Layer == "2")
        {
@@ -713,7 +784,42 @@
            modPlc = plcList.FirstOrDefault(m => m.Text == "3层托盘输送线");
            if (modPlc == null)
                throw Oops.Bah($"未查询到3楼层PLC信息");
            DbNum = "";
            DbNum = "DB91";
            PLCUtil modUtil = new PLCUtil(modPlc);
            switch (input.Type)
            {
                case "ThreePalletStart":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                case "ThreePalletStop":
                    if (input.FuncName == "true")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "true");
                    }
                    else if (input.FuncName == "false")
                    {
                        modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "false");
                    }
                    else
                    {
                        throw Oops.Bah("事件结果错误");
                    }
                    break;
                default:
                    break;
            }
            modUtil.Close();
        }
        else
        {