| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(sourceCodes[0]))); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartColumn = (byte)Convert.ToSByte(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(sourceCodes[1]); |
| | | |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(0); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(0); |
| | |
| | | stackerCraneTaskCommand.StartLayer = (byte)Convert.ToSByte(0); |
| | | |
| | | stackerCraneTaskCommand.EndRow = (byte)Convert.ToSByte(GetRowCode(Convert.ToInt32(targetCodes[0]))); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndColumn = (byte)Convert.ToSByte(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = (byte)Convert.ToSByte(targetCodes[1]); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | return content.Error("æªæ¾å°ä»»å¡å½ä»¤"); |
| | | } |
| | | |
| | | StackerSendCommand(stackerCraneTaskCommand, stackerhand.DeviceCode); |
| | | return content; |
| | | |
| | | return content.OK("å½ä»¤ä¸åæåï¼"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)device; |
| | | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.TaskType, Convert.ToSByte(2)); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(2)); |
| | | return content.OK(); |
| | | } |
| | | else |
| | |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)device; |
| | | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.TaskType, Convert.ToSByte(2)); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(2)); |
| | | return content.OK(); |
| | | } |
| | | else |
| | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.StartColumn, command.StartColumn); |
| | | Thread.Sleep(100); |
| | | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.StartColumn, command.StartLayer); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.StartLayer, command.StartLayer); |
| | | Thread.Sleep(100); |
| | | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.EndRow, command.EndRow); |
| | |
| | | Thread.Sleep(100); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.EndLayer, command.EndLayer); |
| | | Thread.Sleep(100); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.TaskType, Convert.ToSByte(command.WorkType)); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(command.WorkType)); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("请å¨å åæºèæºæ¨¡å¼ãå¾
æºç¶æãæ æ
éçæ
åµä¸ä¸åä»»å¡"); |
| | | throw new Exception($"请å¨{commonStackerCrane.DeviceName}èæºæ¨¡å¼ãå¾
æºç¶æãæ æ
éçæ
åµä¸ä¸åä»»å¡"); |
| | | } |
| | | } |
| | | else |
| | |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | short x = conveyorLine.GetValue<ConveyorLineDBName, short>(ConveyorLineDBName.InteractiveSignal, stationManager.stationChildCode); |
| | | var structs = BitConverter.GetBytes(x).ToArray().ToBoolArray(); |
| | | if (!structs[2]) |
| | | { |
| | | return content.Error($"请å¨{stationManager.stationChildCode}è¾é线就绪æ
åµä¸ä¸åå½ä»¤"); |
| | | } |
| | | //å
¥åº |
| | | if (ConveyorLinehand.TaskType == "1") |
| | | { |
| | |
| | | if (RGVhand.DeviceCode == "RGV01" || RGVhand.DeviceCode == "RGV02") |
| | | { |
| | | CommonRGV_FirstFloor RGVcommand = (CommonRGV_FirstFloor)device; |
| | | if (RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Fault) && !RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | { |
| | | if (RGVhand.TaskType == "1") |
| | | { |
| | | if (RGVhand.SourceAddress != null) |
| | |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"请å¨èæºæ¨¡å¼ãæ æ
éãå¾
æºç¶ææ¶åä¸å{RGVcommand.DeviceName}å½ä»¤"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | CommonRGV RGVcommand = (CommonRGV)device; |
| | | if (RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Fault) && !RGVcommand.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | { |
| | | if (RGVhand.TaskType == "1") |
| | | { |
| | | if (RGVhand.SourceAddress != null) |
| | |
| | | return content.Error($"{device.DeviceName}æªç¥ä»»å¡å½ä»¤"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"请å¨èæºæ¨¡å¼ãæ æ
éãå¾
æºç¶ææ¶åä¸å{RGVcommand.DeviceName}å½ä»¤"); |
| | | } |
| | | } |
| | | } |
| | | return content.Error("æªæ¾å°è®¾å¤ä¿¡æ¯è¯·èç³»IT"); |
| | | } |
| | |
| | | if (DeviceCode == "RGV01" || DeviceCode == "RGV02") |
| | | { |
| | | CommonRGV_FirstFloor commonRGV = (CommonRGV_FirstFloor)device; |
| | | commonRGV.SetValue(StackerCraneDBName.TaskType, Convert.ToSByte(9)); |
| | | commonRGV.SetValue(RGVDBName.TaskType, Convert.ToSByte(9)); |
| | | } |
| | | else |
| | | { |
| | | CommonRGV commonRGV = (CommonRGV)device; |
| | | commonRGV.SetValue(StackerCraneDBName.TaskType, Convert.ToSByte(9)); |
| | | commonRGV.SetValue(RGVDBName.TaskType, Convert.ToSByte(9)); |
| | | } |
| | | return content.OK($"{device.DeviceName}å¤ä½æå"); |
| | | } |
| | |
| | | { |
| | | CommonRGV_FirstFloor commonRGV = (CommonRGV_FirstFloor)device; |
| | | DeviceProDTO? devicePro = commonRGV.DeviceProDTOs.Where(x => x.DeviceChildCode == commonRGV.DeviceCode && x.DeviceProParamName == "TaskType").FirstOrDefault(); |
| | | byte[] byt = Encoding.UTF8.GetBytes("08"); |
| | | commonRGV.Communicator.Write(devicePro.DeviceProAddress, byt); |
| | | //byte[] byt = Encoding.UTF8.GetBytes("08"); |
| | | byte valueToWrite = 8; |
| | | |
| | | byte[] buffer = new byte[] { valueToWrite }; |
| | | |
| | | commonRGV.Communicator.Write(devicePro.DeviceProAddress, buffer); |
| | | } |
| | | else |
| | | { |
| | | CommonRGV commonRGV = (CommonRGV)device; |
| | | DeviceProDTO? devicePro = commonRGV.DeviceProDTOs.Where(x => x.DeviceChildCode == commonRGV.DeviceCode && x.DeviceProParamName == "TaskType").FirstOrDefault(); |
| | | byte[] byt = Encoding.UTF8.GetBytes("8"); |
| | | commonRGV.Communicator.Write(devicePro.DeviceProAddress, byt); |
| | | byte valueToWrite = 8; |
| | | |
| | | byte[] buffer = new byte[] { valueToWrite }; |
| | | commonRGV.Communicator.Write(devicePro.DeviceProAddress, buffer); |
| | | } |
| | | return content.OK($"{device.DeviceName}åå§åæå"); |
| | | } |
| | |
| | | #endregion <Public Menber> |
| | | } |
| | | |
| | | public enum RGVDBName |
| | | { |
| | | SendTask, |
| | | Automatic, |
| | | WorkCompleted, |
| | | Running, |
| | | Fault, |
| | | InStock, |
| | | RGVTargetAddress, |
| | | RGVTaskNum, |
| | | PickupLocation, |
| | | PutcargoLocation, |
| | | TaskType, |
| | | TaskNum, |
| | | LevelPoint, |
| | | CurrentTaskNum, |
| | | RGVAlarm, |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |