From 3de39066b5894850d0f0dc311b60cc09f599a025 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 26 二月 2026 14:30:06 +0800
Subject: [PATCH] 修复图片导入;重构路由和堆垛机命令
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 147c902..c312236 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -86,10 +86,10 @@
Dt_Task? task = GetTask(commonStackerCrane);
if (task != null)
{
- var stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
+ object? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
if (stackerCraneTaskCommand != null)
{
- bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
+ bool sendFlag = SendStackerCraneCommand(commonStackerCrane, stackerCraneTaskCommand);
if (sendFlag)
{
commonStackerCrane.LastTaskType = task.TaskType;
@@ -152,10 +152,10 @@
if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- if (IsOutTaskStationAvailable(task))
- {
+ //if (IsOutTaskStationAvailable(task))
+ //{
return task;
- }
+ //}
List<string> otherOutStationCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress, task.TaskType)
.Select(x => x.ChildPosi).ToList();
@@ -201,7 +201,7 @@
/// <summary>
/// 浠诲姟瀹炰綋杞崲鎴愬懡浠odel
/// </summary>
- public dynamic? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
+ public object? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
{
// 鏍规嵁閰嶇疆鍒ゆ柇鍛戒护绫诲瀷
string commandType = GetCommandType(task.Roadway);
@@ -211,6 +211,16 @@
{
"Formation" => BuildCommand(task, CreateFormationCommand(task)),
_ => BuildCommand(task, CreateStandardCommand(task))
+ };
+ }
+
+ private static bool SendStackerCraneCommand(IStackerCrane commonStackerCrane, object command)
+ {
+ return command switch
+ {
+ FormationStackerCraneTaskCommand formationCommand => commonStackerCrane.SendCommand(formationCommand),
+ StackerCraneTaskCommand standardCommand => commonStackerCrane.SendCommand(standardCommand),
+ _ => false
};
}
@@ -236,15 +246,15 @@
{
return new StackerCraneTaskCommand
{
- Barcode = task.PalletCode,
+ //Barcode = task.PalletCode,
TaskNum = task.TaskNum,
WorkType = 1,
- TrayType = 0
+ WorkAction = 1
};
}
/// <summary>
- /// 鍒涘缓缁勭洏鍫嗗灈鏈哄懡浠�
+ /// 鍒涘缓鍒嗗鍫嗗灈鏈哄懡浠�
/// </summary>
private static FormationStackerCraneTaskCommand CreateFormationCommand(Dt_Task task)
{
--
Gitblit v1.9.3