From 257d09aff7ec7b858b037607869d23ec61ac75bc Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期二, 19 八月 2025 09:03:49 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs | 318 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 234 insertions(+), 84 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
index b8b06cd..3defe0a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs"
@@ -19,26 +19,53 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
-using WIDESEAWCS_Tasks.闃荤剨浠�;
+using WIDESEAWCS_Tasks;
+using WIDESEAWCS_Core;
+using WIDESEAWCS_Tasks.ConveyorLineJob;
+using Newtonsoft.Json;
+using WIDESEAWCS_Common.APIEnum;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_Core.Caches;
+using AutoMapper;
namespace WIDESEAWCS_Tasks
{
[DisallowConcurrentExecution]
public class StackerCraneJob_PP : JobBase, IJob
{
+ private readonly IMapper _mapper;
+ private readonly ICacheService _cacheService;
private readonly ITaskService _taskService;
private readonly ITaskExecuteDetailService _taskExecuteDetailService;
private readonly ITaskRepository _taskRepository;
private readonly IRouterService _routerService;
private readonly IStationMangerRepository _stationMangerRepository;
+ private List<Dt_ApiInfo> apiInfos;
- public StackerCraneJob_PP(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
+ public StackerCraneJob_PP(IMapper mapper, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, ICacheService cacheService)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
_taskRepository = taskRepository;
_routerService = routerService;
_stationMangerRepository = stationMangerRepository;
+ _cacheService = cacheService;
+ _mapper=mapper;
+
+ string? apiInfoStr = _cacheService.Get("apiInfos");
+ if (!string.IsNullOrEmpty(apiInfoStr))
+ {
+ List<Dt_ApiInfo>? infos = JsonConvert.DeserializeObject<List<Dt_ApiInfo>>(apiInfoStr);
+ if (infos == null || infos.Count == 0)
+ {
+ apiInfos = new List<Dt_ApiInfo>();
+ }
+ else
+ {
+ apiInfos = infos;
+ }
+ }
}
public Task Execute(IJobExecutionContext context)
@@ -52,25 +79,26 @@
{
commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢
}
-
- if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
+ commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
+ if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
{
- commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
-
- if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
+ Thread.Sleep(1000);
+ Dt_Task? task = GetTask(commonStackerCrane);
+ if (task != null)
{
- Dt_Task? task = GetTask(commonStackerCrane);
- if (task != null)
+ StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
+ if (stackerCraneTaskCommand != null)
{
- StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
- if (stackerCraneTaskCommand != null)
+ bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
+ if (sendFlag)
{
- bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
- if (sendFlag)
- {
- commonStackerCrane.LastTaskType = task.TaskType;
- _taskService.UpdateTaskStatusToNext(task.TaskNum);
- }
+ commonStackerCrane.LastTaskType = task.TaskType;
+ task.Dispatchertime = DateTime.Now;
+ task.ExceptionMessage = "";
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
+ commonStackerCrane.Communicator.Write("DB105.54", (short)1);
+ //寤舵椂1s
+ Thread.Sleep(1000);
}
}
}
@@ -96,12 +124,66 @@
{
if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
{
- Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
- _taskService.StackCraneTaskCompleted(e.TaskNum);
- commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+ if (StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode).Status)
+ {
+ commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+ }
}
}
}
+ public WebResponseContent StackerCraneTaskCompleted(int taskNum, string deviceCode)
+ {
+ try
+ {
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum);
+ if (task != null)
+ {
+ if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+ {
+ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress);
+ if (stationManger == null)
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
+ _taskService.UpdateTaskExceptionMessage(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
+ return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
+ }
+
+ int oldStatus = task.TaskState;
+ task.DeviceCode = stationManger.StationDeviceCode;
+ task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt();
+ task.CurrentAddress = stationManger.StationCode;
+ _taskRepository.UpdateData(task);
+ _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"绯荤粺鑷姩娴佺▼,浠诲姟鐘舵�佷粠銆恵oldStatus}銆戣浆鍒般�恵task.TaskState}銆�");
+ WriteInfo(deviceCode, $"鍫嗗灈鏈轰换鍔″畬鎴�,浠诲姟鍙�:{taskNum}");
+ //todo 瀹屾垚
+ }
+ else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
+ {
+ WriteInfo(deviceCode, $"鍫嗗灈鏈轰换鍔″畬鎴�,浠诲姟鍙�:{taskNum}");
+ _taskService.TaskCompleted(taskNum);
+ }
+ else
+ {
+ WriteInfo(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}");
+ _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}");
+ _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}");
+ }
+ }
+ else
+ {
+ WriteInfo(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}");
+ return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}");
+ }
+
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ WriteError(deviceCode, $"浠诲姟瀹屾垚閿欒", ex);
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+
/// <summary>
/// 鑾峰彇浠诲姟
@@ -134,25 +216,95 @@
}
}
}
-
+ //鍒ゆ柇绉诲簱
if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- if (OutTaskStationIsOccupied(task) != null || true)
+ if (OutTaskStationIsOccupied(task) == null)
{
- return task;
- }
- else
- {
- List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
+ bool flag = false;
+ List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress, task.TaskType).Select(x => x.ChildPosi).ToList();
List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
foreach (var item in tasks)
{
if (OutTaskStationIsOccupied(task) != null)
{
- return task;
+ flag = true;
+ break;
}
}
- task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
+ if (!flag)
+ {
+ task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
+ }
+ }
+ }
+
+ if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+ {
+ string? url = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.WMSIsReloaction.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(url))
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
+ WriteError(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
+ return null;
+ }
+ string response = HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.CurrentAddress}", "");//todo 璋冪敤WMS浠诲姟瀹屾垚鏂规硶
+ if (string.IsNullOrEmpty(response))
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+ }
+ WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response);
+ if (responseContent == null || !responseContent.Status)
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+ }
+ WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.Serialize());
+ if (taskDTO == null)
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+
+ }
+ if (task.TaskNum == taskDTO.TaskNum)
+ {
+ return task;
+ }
+ else
+ {
+ Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
+ //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+ Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
+ if (existTask != null && existTask.TaskState == (int)TaskStatusEnum.SC_Execute)
+ {
+ return existTask;
+ }
+ else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute)
+ {
+ WriteError(commonStackerCrane.DeviceCode, $"浠诲姟{task.TaskNum}娴呰揣浣嶄换鍔existTask.TaskNum}浠诲姟鐘舵�佷笉涓哄爢鍨涘緟鎵ц");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"浠诲姟{task.TaskNum}娴呰揣浣嶄换鍔existTask.TaskNum}浠诲姟鐘舵�佷笉涓哄爢鍨涘緟鎵ц");
+ return null;
+ }
+ else
+ {
+ reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+ reloTask.CurrentAddress = taskDTO.SourceAddress;
+ reloTask.NextAddress = taskDTO.TargetAddress;
+ reloTask.DeviceCode = task.DeviceCode;
+ reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
+ int taskId = _taskRepository.AddData(reloTask);
+ reloTask.TaskId = taskId;
+ }
+ return reloTask;
+
}
}
@@ -166,27 +318,29 @@
/// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns>
private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
{
- Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway);
+ Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.DeviceCode);
if (stationManger != null)
{
IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
if (device != null)
{
OtherDevice client = (OtherDevice)device;
- if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤
+ if (!client.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Goods, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤
{
- task.TargetAddress = stationManger.StackerCraneStationCode;
+ task.NextAddress = stationManger.StackerCraneStationCode;
_taskRepository.UpdateData(task);
return task;
}
}
else
{
+ WriteInfo(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
}
}
else
{
+ WriteInfo(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
}
return null;
@@ -208,15 +362,35 @@
stackerCraneTaskCommand.TrayType = 1;
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
{
- //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
- //if (routers.Count > 0)
- //{
+
string[] startCodes = task.CurrentAddress.Split("-");
-
- stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
- stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
- stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
-
+ if (startCodes.Length == 3)
+ {
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
+ }
+ else
+ {
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�");
+ return null;
+ }
+ string[] targetCodes = task.NextAddress.Split("-");
+ if (targetCodes.Length == 5)
+ {
+ stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]);
+ stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]);
+ stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]);
+ }
+ else
+ {
+ //鏁版嵁閰嶇疆閿欒
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�");
+ return null;
+ }
+ }
+ else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+ {
string[] targetCodes = task.NextAddress.Split("-");
if (targetCodes.Length == 3)
{
@@ -227,55 +401,31 @@
else
{
//鏁版嵁閰嶇疆閿欒
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟涓嬩竴鍦板潃鐐归敊璇紝璧风偣锛氥�恵task.NextAddress}銆�");
return null;
}
- //}
- //else
- //{
- // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅");
- // return null;
- //}
- }
- else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
- {
- //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
- //if (routers.Count > 0)
+ string[] sourceCodes = task.CurrentAddress.Split("-");
+ if (sourceCodes.Length == 5)
{
- string[] targetCodes = task.NextAddress.Split("-");
-
- stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
- stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
- stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
-
- string[] sourceCodes = task.CurrentAddress.Split("-");
- if (sourceCodes.Length == 3)
- {
- stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
- stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
- stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
- }
- else
- {
- //鏁版嵁閰嶇疆閿欒
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�");
- return null;
- }
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]);
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]);
}
- //else
- //{
- // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅");
- // return null;
- //}
+ else
+ {
+ //鏁版嵁閰嶇疆閿欒
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�");
+ return null;
+ }
}
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
{
string[] targetCodes = task.NextAddress.Split("-");
- if (targetCodes.Length == 3)
+ if (targetCodes.Length == 5)
{
- stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
- stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
- stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
+ stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]);
+ stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]);
+ stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]);
}
else
{
@@ -284,11 +434,11 @@
return null;
}
string[] sourceCodes = task.CurrentAddress.Split("-");
- if (sourceCodes.Length == 3)
+ if (sourceCodes.Length == 5)
{
- stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
- stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
- stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]);
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]);
}
else
{
--
Gitblit v1.9.3