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/Common/CommonStackerCrane.cs | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs index 55dde71..d6e577e 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs @@ -225,7 +225,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); } /// <summary> @@ -294,7 +294,6 @@ for (int i = 0; i < devicePros.Count; i++) { object readStatus = Communicator.ReadAsObj(devicePros[i].DeviceProAddress, devicePros[i].DeviceDataType); - //todo 鍗忚鏄庣粏淇℃伅鏈幏鍙栧埌鏃舵姏鍑哄紓甯� DeviceProtocolDetailDTO? deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePros[i].DeviceProParamName) ?? throw new Exception(); deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == devicePros[i].DeviceProParamType && x.ProtocalDetailValue.Equals(readStatus.ToString())); if (deviceProtocolDetail != null) @@ -306,17 +305,6 @@ } //todo 閫氳鏈繛鎺ユ椂鎶涘嚭寮傚父 return StackerCraneStatus.Unkonw.ToString(); - } - - /// <summary> - /// 姣旇緝涓や釜鍊兼槸鍚︾浉绛夈�� - /// </summary> - /// <param name="value">绗竴涓�笺��</param> - /// <param name="paramValue">绗簩涓�笺��</param> - /// <returns>杩斿洖姣旇緝缁撴灉銆�</returns> - private bool Compare(object value, object paramValue) - { - return value.Equals(paramValue); } private void CheckConnect() @@ -352,7 +340,7 @@ /// <returns></returns> public bool SendCommand<T>(T command) where T : IDataTransfer, new() { - if(Communicator is SiemensS7) + if (Communicator is SiemensS7) { if (!IsConnected) throw new Exception($"閫氳杩炴帴閿欒锛岃妫�鏌ョ綉缁�"); DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); -- Gitblit v1.9.3