From dd5b18ba20b6863ec91c364dff0aa3b9353e54b9 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期五, 16 五月 2025 17:03:13 +0800 Subject: [PATCH] 添加自动伸缩杆的暂停接口,以及添加自动伸出位置 --- project/后台管理/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs | 35 ++++++++++++++++++++++++++++++++--- 1 files changed, 32 insertions(+), 3 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 99164aa..3f6b351 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" @@ -60,14 +60,21 @@ int ext = (int)para.ExtendSpeed;//宸LC鑷姩浼稿嚭缂╁洖閫熷害 int ret = (int)para.RetractionSpeed;//鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害 + int liftPosition = (int)para.LeftPosition;//宸︿几鍑轰綅缃� + int rigtpostition = (int)para.RightPosition;//鍙充几鍑轰綅缃� + + if (extendedState == "浼稿嚭") { - devices.Value.left.Communicator.Write<int>("D1001", ext);//浼稿嚭閫熷害 + devices.Value.left.Communicator.Write<int>("D1001", ext);//宸LC鑷姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M102", true);//浼稿嚭鎸夐挳 + devices.Value.right.Communicator.Write<int>("D1002", liftPosition);//宸︿几鍑轰綅缃� - devices.Value.right.Communicator.Write<int>("D1001", ret); + + devices.Value.right.Communicator.Write<int>("D1001", ret); //鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M102", true); + devices.Value.right.Communicator.Write<int>("D1002", rigtpostition);//鍙充几鍑轰綅缃� Console.WriteLine($"DeptId={deptId} 锛屽乏閫熷害={ext}锛屽彸閫熷害={ret}"); } @@ -227,6 +234,28 @@ /// <summary> + ///褰撹嚜鍔ㄤ几鍑洪渶瑕佹殏鍋滄椂锛屾殏鍋滄寜閽� + /// </summary> + /// <returns></returns> + public WebResponseContent PauseButton(int deptid) + { + try + { + //鏍规嵁int.TryParse(AppSettings.Get("DepartmentID")璇诲彇鍒板綋鍓嶆槸杞ㄩ亾鍑狅紝鎵�鏈変汉閮藉彧鑳芥搷浣滃綋鍓� + var devices = GetDevicesByDeptId(deptid); + devices.Value.left.Communicator.Write<bool>("M104", true); + devices.Value.right.Communicator.Write<bool>("M104", true); + return new WebResponseContent { Status = true, Message = "鏆傚仠鎴愬姛", Data = devices }; + } + catch (Exception ex) + { + + return new WebResponseContent { Status = false, Message = ex.Message }; + } + } + + + /// <summary> /// 鑾峰彇璁惧鍙� /// </summary> /// <param name="deptId"></param> @@ -247,7 +276,7 @@ return (left, right); } - + } } -- Gitblit v1.9.3