From 5171d3f59b89389bf75293afd210cfa6de4ccff7 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 10 四月 2026 23:03:49 +0800
Subject: [PATCH] feat: 添加堆垛机相关常量类并重构代码使用常量
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
index 76aff9c..d940fb7 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
@@ -225,7 +225,7 @@
{
return DeviceStatus.Idle;
}
- else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUpCompleted || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted)
+ else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutMove || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted)
{
return DeviceStatus.Working;
}
@@ -236,7 +236,11 @@
private int GetCurrentTaskNum()
{
DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CurrentTaskNum));
- return devicePro == null ? throw new Exception($"璇诲彇褰撳墠浠诲姟鍙烽敊璇�,鏈幏鍙栧埌鍗忚淇℃伅,璇锋鏌ラ厤缃弬鏁板悕绉版槸鍚﹂厤缃�,涓旈厤缃负涓簕nameof(CurrentTaskNum)}") : (int)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
+ if (devicePro == null)
+ throw new Exception($"璇诲彇褰撳墠浠诲姟鍙烽敊璇�,鏈幏鍙栧埌鍗忚淇℃伅,璇锋鏌ラ厤缃弬鏁板悕绉版槸鍚﹂厤缃�,涓旈厤缃负{nameof(CurrentTaskNum)}");
+
+ object value = Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
+ return Convert.ToInt32(value); // 缁熶竴杞崲涓� int
}
/// <summary>
@@ -311,10 +315,10 @@
{
return deviceProtocolDetail.ProtocolDetailType;
}
- return StackerCraneStatus.Unkonw.ToString();
+ return StackerCraneStatus.Unknown.ToString();
}
}
- return StackerCraneStatus.Unkonw.ToString();
+ return StackerCraneStatus.Unknown.ToString();
}
private void CheckConnect()
--
Gitblit v1.9.3