| | |
| | | #endregion |
| | | |
| | | #region ä»»å¡å®æ |
| | | var completeStatus = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CompleteStatus); |
| | | if (common.CompleteStatus == 2 || common.CompleteStatus == 3) |
| | | { |
| | | NormalCompleted(commonStackerCrane); |
| | |
| | | //} |
| | | #endregion |
| | | #region ä»»å¡é»è¾å¤ç |
| | | var onlinestate = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.Onlinestate); |
| | | var writeStatus = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WriteStatus); |
| | | if (onlinestate == (short)Onlinestate.online /*&& writeStatus == (short)WriteStatus.Permit*/) |
| | | if (common.Onlinestate == (short)Onlinestate.online) |
| | | { |
| | | #region æ¥è¯¢ä»»å¡,é»è¾å¤ç |
| | | if (Enum.Parse<RunStatus>(commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.RunStatus).ToString()) == RunStatus.Standby) |
| | | if (common.RunStatus == (short)RunStatus.Standby) |
| | | { |
| | | var Task = _taskService.GetTaskState((int)TaskCarStatusEnum.ShuttleCar_Finish, (int)TaskOtherTypeEnum.RelocationCar);//è·åç§»è½¦ä»»å¡ |
| | | var Task1 = _taskService.GetTaskState((int)CarChargingTaskEnum.ShuttleCar_Finish, (int)TaskOtherTypeEnum.RelocationCarCharging);//è·å移车å
çµä»»å¡ |
| | | var Task1 = _taskService.GetTaskState((int)CarChargingTaskEnum.CarCharging_Finish, (int)TaskOtherTypeEnum.RelocationCarCharging);//è·å移车å
çµä»»å¡ |
| | | if (Task != null) |
| | | { |
| | | SendTask(commonStackerCrane, Task); |
| | |
| | | if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)//ç§»åºä»»å¡å¤æç»ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | { |
| | | if (task.SourceIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.RelocationNew) |
| | | SendTask(commonStackerCrane, task);//ä¸åå åæºä»»å¡ |
| | | else if (!task.SourceIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.RelocationNew) |
| | | { |
| | | var ShuttleCar = GetShuttleCarInfo(task.TargetAddress);//ç§»åºä»»å¡å¤æç»ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | if (ShuttleCar == null) |
| | | { |
| | | _taskService.AddRelocationCarTask("", task.TargetAddress); |
| | | } |
| | | else |
| | | SendTask(commonStackerCrane, task);//ä¸åå åæºä»»å¡ |
| | | } |
| | | else if (!task.SourceIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.RelocationNew && task.ShuttleCarCode == null) |
| | | { |
| | | var ShuttleCar = GetShuttleCarInfo(task.SourceAddress);//ç§»åºä»»å¡å¤æèµ·ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | if (ShuttleCar != null) |
| | |
| | | } |
| | | else _taskService.AddRelocationCarTask("", task.SourceAddress); |
| | | } |
| | | else if (!task.TargetIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.CarSource_Finish) |
| | | else if (/*!task.TargetIsPickPlace &&*/ task.TaskState == (int)TaskRelocationStatusEnum.CarSource_Finish) |
| | | { |
| | | var ShuttleCar = GetShuttleCarInfo(task.TargetAddress);//ç§»åºä»»å¡å¤æç»ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | if (task.TargetIsPickPlace && ShuttleCar != null)//移走 |
| | |
| | | else if (!task.TargetIsPickPlace && ShuttleCar == null) |
| | | { |
| | | _taskService.AddRelocationCarTask("", task.TargetAddress); |
| | | #region æ¥è¯¢ |
| | | task = _taskService.QueryCarOutFinish(); |
| | | if (task != null) SendTask(commonStackerCrane, task);//ä¸åå åæºä»»å¡ |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (commonStackerCrane.SetValue(StackerCraneDBName.CommandSend, sendFlag)) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | if (_taskService.TaskInboundTypes.Contains(task.TaskType) || |
| | | _taskService.TaskOutboundTypes.Contains(task.TaskType)) |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.ConfirmComplete, true); |
| | | var content = _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.ConfirmComplete, content.Status); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | Dt_Task task = _taskService.QueryStackerCraneRelocationTask(commonStackerCrane.DeviceCode);//è·åç§»åºä»»å¡ |
| | | #region åå¨ç§»åºä»»å¡å¿
é¡»å
æ§è¡ç§»åºä»»å¡ |
| | | if (task != null) return task; |
| | | if (task != null) |
| | | { |
| | | return task; |
| | | //if (task.SourceIsPickPlace && task.ShuttleCarCode != null) |
| | | // return task; |
| | | //else return null; |
| | | } |
| | | #endregion |
| | | |
| | | #region åºå
¥åºä»»å¡ |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | if (task != null) return task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); |
| | |
| | | } |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode) ?? _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | var EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(EndRow > 1 ? EndRow - 1 : EndRow); |
| | | stackerCraneTaskCommand.EndRow = EndRow;// Convert.ToInt16(EndRow > 1 ? EndRow - 1 : EndRow); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | var StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(StartRow > 1 ? StartRow - 1 : StartRow); |
| | | stackerCraneTaskCommand.StartRow = StartRow;// Convert.ToInt16(StartRow > 1 ? StartRow - 1 : StartRow); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | var EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(EndRow > 1 ? EndRow - 1 : EndRow); |
| | | stackerCraneTaskCommand.EndRow = EndRow;// Convert.ToInt16(EndRow > 1 ? EndRow - 1 : EndRow); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | var SourceRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(SourceRow > 1 ? SourceRow - 1 : SourceRow); |
| | | stackerCraneTaskCommand.StartRow = SourceRow;// Convert.ToInt16(SourceRow > 1 ? SourceRow - 1 : SourceRow); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |