From 2f75b4c0a67ccc3a443e7cc4f2f0f909defd9a92 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期五, 01 十一月 2024 09:49:23 +0800
Subject: [PATCH] 版本更新

---
 WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Spec/SpeStackerCrane.cs |   76 -------------------------------------
 1 files changed, 1 insertions(+), 75 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Spec/SpeStackerCrane.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Spec/SpeStackerCrane.cs
index 6038eca..49abede 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Spec/SpeStackerCrane.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Spec/SpeStackerCrane.cs
@@ -70,16 +70,7 @@
 
         public string DeviceName => _deviceName;
 
-        public bool IsFault => throw new NotImplementedException();
-
         public bool IsConnected => Communicator.IsConnected && _isConnected;
-
-        public DeviceStatus Status => throw new NotImplementedException();
-
-        /// <summary>
-        /// 鏃犵敤
-        /// </summary>
-        public event EventHandler<StackerCraneTaskCompletedEventArgs> StackerCraneTaskCompletedEventHandler;
 
         public object StackerCraneTaskCommand { get; set; }
         #endregion
@@ -134,7 +125,7 @@
         private int GetCurrentTaskNum()
         {
             DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CurrentTaskNum));
-            return devicePro == null ? throw new Exception() : (int)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
+            return devicePro == null ? throw new Exception($"璇诲彇褰撳墠浠诲姟鍙烽敊璇�,鏈幏鍙栧埌鍗忚淇℃伅,璇锋鏌ラ厤缃弬鏁板悕绉版槸鍚﹂厤缃�,涓旈厤缃负涓簕nameof(CurrentTaskNum)}") : (int)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
         }
 
         private void CheckConnect()
@@ -210,71 +201,6 @@
             {
                 throw new Exception("鏆備笉鏀寔闄よタ闂ㄥ瓙涔嬪鐨凱LC");
             }
-        }
-
-        /// <summary>
-        /// 鐩戞祴鍫嗗灈鏈轰换鍔℃槸鍚﹀畬鎴�(闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽畾涔夋墜鍔ㄨЕ鍙戝姛鑳�)
-        /// </summary>
-        void CheckStackerCraneTaskCompleted()
-        {
-            if (_isChecked)
-                return;
-
-            Task.Run(() =>
-            {
-                _isChecked = true;
-                try
-                {
-                    DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(StackerCraneWorkStatus));
-                    if (devicePro != null)
-                    {
-                        DeviceProtocolDetailDTO? deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePro.DeviceProParamName && x.ProtocolDetailType == StackerCraneWorkStatus.WorkCompleted.ToString());
-                        if (deviceProtocolDetail != null)
-                        {
-                            OperateResult<TimeSpan> operateResult = new OperateResult<TimeSpan>();
-                            TypeCode typeCode = SiemensDBDataType.GetTypeCode(devicePro.DeviceDataType);
-                            switch (typeCode)
-                            {
-                                case TypeCode.Boolean:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToBoolean(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                case TypeCode.Byte:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToByte(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                case TypeCode.Int16:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToInt16(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                case TypeCode.Int32:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToInt32(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                case TypeCode.UInt16:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToUInt16(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                case TypeCode.UInt32:
-                                    operateResult = Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, Convert.ToUInt32(deviceProtocolDetail.ProtocalDetailValue));
-                                    break;
-                                default:
-                                    break;
-                            }
-                            int taskNum = CurrentTaskNum;
-                            if (operateResult.IsSuccess /*&& LastTaskNum != taskNum*/)
-                            {
-                                StackerCraneTaskCompletedEventArgs args = new(taskNum);
-                                StackerCraneTaskCompletedEventHandler?.Invoke(this, args);
-                                _lastTaskNum = taskNum;
-                            }
-                        }
-                    }
-                }
-                catch (Exception ex)
-                {
-
-                }
-                finally
-                {
-                    _isChecked = false;
-                }
-            });
         }
 
         public bool SetValue<TEnum, TValue>(TEnum @enum, TValue value)

--
Gitblit v1.9.3