From bdc88e08328c360c2bddeedde744d858a7fd7e3d Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期四, 15 五月 2025 13:51:44 +0800 Subject: [PATCH] 修改信号/伸缩杆速度 --- project/后台管理/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs | 58 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 34 insertions(+), 24 deletions(-) diff --git "a/project/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs" "b/project/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs" index a10f1af..99164aa 100644 --- "a/project/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs" +++ "b/project/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs" @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using SqlSugar; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseRepository; @@ -57,28 +58,28 @@ continue; } - int ext = (int)para.ExtendSpeed; - int ret = (int)para.RetractionSpeed; + int ext = (int)para.ExtendSpeed;//宸LC鑷姩浼稿嚭缂╁洖閫熷害 + int ret = (int)para.RetractionSpeed;//鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害 if (extendedState == "浼稿嚭") { - devices.Value.left.Communicator.Write<int>("D500", ext);//浼稿嚭閫熷害 - devices.Value.left.Communicator.Write<bool>("M100", true);//浼稿嚭鎸夐挳 + devices.Value.left.Communicator.Write<int>("D1001", ext);//浼稿嚭閫熷害 + devices.Value.left.Communicator.Write<bool>("M102", true);//浼稿嚭鎸夐挳 - devices.Value.right.Communicator.Write<int>("D500", ext); - devices.Value.right.Communicator.Write<bool>("M100", true); + devices.Value.right.Communicator.Write<int>("D1001", ret); + devices.Value.right.Communicator.Write<bool>("M102", true); - Console.WriteLine($"DeptId={deptId} 浼稿嚭鎿嶄綔锛岄�熷害={ext}"); + Console.WriteLine($"DeptId={deptId} 锛屽乏閫熷害={ext}锛屽彸閫熷害={ret}"); } else if (extendedState == "缂╁洖") { - devices.Value.left.Communicator.Write<int>("D501", ret);//浼稿嚭閫熷害 - devices.Value.left.Communicator.Write<bool>("M101", true);//浼稿嚭鎸夐挳 + devices.Value.left.Communicator.Write<int>("D1001", ext);//缂╁洖閫熷害 + devices.Value.left.Communicator.Write<bool>("M103", true);//缂╁洖鎸夐挳 - devices.Value.right.Communicator.Write<int>("D501", ret); - devices.Value.right.Communicator.Write<bool>("M101", true); + devices.Value.right.Communicator.Write<int>("D1001", ret); + devices.Value.right.Communicator.Write<bool>("M103", true); - Console.WriteLine($"DeptId={deptId} 缂╁洖鎿嶄綔锛岄�熷害={ret}"); + Console.WriteLine($"DeptId={deptId} 缂╁洖鎿嶄綔锛屽乏閫熷害={ext}锛屽彸閫熷害={ret}"); } else { @@ -86,7 +87,8 @@ } } - return new WebResponseContent { Status = true, Message = "鍏ㄩ儴璁惧鎿嶄綔瀹屾垚" }; + return new WebResponseContent { Status = true, Message = "鍏ㄩ儴璁惧鎿嶄綔瀹屾垚", + }; } catch (Exception ex) { @@ -173,32 +175,32 @@ if (para == null) return new WebResponseContent { Status = false, Message = "鍙傛暟鏈厤缃�" }; - int ext = (int)para.ExtendSpeed; - int ret = (int)para.RetractionSpeed; + int ext = (int)para.ManualExtend;//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 + int ret = (int)para.ManualRetraction;//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 if (position == "宸�" && ExtendedState == "浼稿嚭") { - devices.Value.left.Communicator.Write<int>("D500", ext);//浼稿嚭閫熷害 + devices.Value.left.Communicator.Write<int>("D1000", ext);//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M100", true);//浼稿嚭鎸夐挳 - Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄤ几鍑簕ext}"); + Console.WriteLine($"{position}宸LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); } else if (position == "宸�" && ExtendedState == "缂╁洖") { - devices.Value.left.Communicator.Write<int>("D501", ret);//缂╁洖閫熷害 + devices.Value.left.Communicator.Write<int>("D1000", ext);//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M101", true); - Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄧ缉鍥瀧ret}"); + Console.WriteLine($"{position}宸LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); } else if (position == "鍙�" && ExtendedState == "浼稿嚭") { - devices.Value.right.Communicator.Write<int>("D500", ext); + devices.Value.right.Communicator.Write<int>("D1000", ret);//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M100", true); - Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄤ几鍑簕ext}"); + Console.WriteLine($"{position}鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); } else if (position == "鍙�" && ExtendedState == "缂╁洖") { - devices.Value.right.Communicator.Write<int>("D501", ret); + devices.Value.right.Communicator.Write<int>("D1000", ret);//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M101", true); - Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄧ缉鍥瀧ret}"); + Console.WriteLine($"{position}鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害{ret}"); } else @@ -206,7 +208,14 @@ return new WebResponseContent { Status = false, Message = "鐘舵�佸弬鏁伴敊璇�" }; } - return new WebResponseContent { Status = true, Message = "鎴愬姛" }; + return new WebResponseContent { Status = true, Message = "鎴愬姛", + Data = new + { + ManualExtend = ext, + ManualRetraction = ret + } + + }; } catch (Exception ex) @@ -238,6 +247,7 @@ return (left, right); } + } } -- Gitblit v1.9.3