| | |
| | | LevelPoint = SecondRgv.GetValue<RGVDBName, int>(RGVDBName.LevelPoint), |
| | | CurrentTaskNum = SecondRgv.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum), |
| | | RGVAlarm = SecondRgv.GetValue<RGVDBName, uint>(RGVDBName.RGVAlarm), |
| | | InStock = SecondRgv.GetValue<RGVDBName, bool>(RGVDBName.InStock), |
| | | SecondRgv.DeviceCode, |
| | | SecondRgv.DeviceName, |
| | | }; |
| | |
| | | }; |
| | | SendCommand(commonRGVSecond, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | Thread.Sleep(1000); |
| | | if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029")))) |
| | | if (task.Remark != null || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))) |
| | | { |
| | | task.Remark = "1025"; |
| | | _taskRepository.UpdateData(task); |
| | |
| | | }; |
| | | SendCommand(commonRGVFirst, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | }; |
| | | SendCommand(commonRGVSecond, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | }; |
| | | SendCommand(commonRGVFirst, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | }; |
| | | SendCommand(commonRGVSecond, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | }; |
| | | SendCommand(commonRGVFirst, command); |
| | | Thread.Sleep(3000); |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running)) |
| | | if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running) || commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.Speed) == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, Convert.ToInt16(stationManager.stationNextChildCode), stationManager.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, Convert.ToInt16(stationManager.stationNextChildCode), stationManager.stationChildCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTaskNum, Convert.ToInt16(1), stationManager.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, Convert.ToInt16(1), stationManager.stationChildCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, Convert.ToSByte(2), stationManager.stationChildCode); |
| | | } |
| | |
| | | } |
| | | else if (task.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | | { |
| | | if (task.Remark != null && (task.Roadway == "SC01" || task.Roadway == "SC06")) |
| | | if (task.Remark != null && (task.Remark == "1026" || task.Remark == "1025")) |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.Remark); |
| | | rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4); |
| | |
| | | |
| | | if (task.TaskState == (int)TaskOutStatusEnum.Line_OutFinish) |
| | | { |
| | | if (task.Remark != null && (task.Roadway == "SC01" || task.Roadway == "SC06")) |
| | | if (task.Remark != null && (task.Remark == "1025" || task.Remark == "1026")) |
| | | { |
| | | Dt_StationManager stationManagerStart = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress); |
| | | Dt_StationManager stationManagerEnd = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.Remark); |
| | |
| | | } |
| | | else if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish) |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress); |
| | | rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4); |
| | | rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark); |
| | | if (task.Remark != null && (task.Remark == "1025" || task.Remark == "1026")) |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.Remark); |
| | | rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4); |
| | | rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark); |
| | | } |
| | | else |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress); |
| | | rgvTaskCommand.TaskType = (byte)Convert.ToSByte(4); |
| | | rgvTaskCommand.PutcargoLocation = (byte)Convert.ToSByte(stationManager.stationRemark); |
| | | } |
| | | } |
| | | else |
| | | { |