From 9250e3e48760f91fbefef03331fc7b14b4b1be18 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期六, 07 六月 2025 13:09:59 +0800 Subject: [PATCH] 修改数字大屏接口 --- project/后台管理/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/ParametersService.cs | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 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 e9327e6..01dd061 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" @@ -100,6 +100,8 @@ { devices.Value.left.Communicator.Write<int>("D1001", ext);//宸LC鑷姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M102", true);//浼稿嚭鎸夐挳 + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.left.Communicator.Write<bool>("M102", false); // 閲婃斁鎸夐挳 devices.Value.left.Communicator.Write<int>("D1002", liftPosition);//宸︿几鍑轰綅缃� } catch (Exception) @@ -112,12 +114,14 @@ { devices.Value.right.Communicator.Write<int>("D1001", ret); //鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M102", true); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.right.Communicator.Write<bool>("M102", false); // 閲婃斁鎸夐挳 devices.Value.right.Communicator.Write<int>("D1002", rigtpostition);//鍙充几鍑轰綅缃� } catch (Exception) { - throw; + } @@ -130,22 +134,26 @@ { devices.Value.left.Communicator.Write<int>("D1001", ext);//缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M103", true);//缂╁洖鎸夐挳 + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.left.Communicator.Write<bool>("M103", false); // 閲婃斁鎸夐挳 } catch (Exception) { - throw; + } try { devices.Value.right.Communicator.Write<int>("D1001", ret); devices.Value.right.Communicator.Write<bool>("M103", true); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.right.Communicator.Write<bool>("M103", false); // 閲婃斁鎸夐挳 } catch (Exception) { - throw; + } Console.WriteLine($"DeptId={deptId} 缂╁洖鎿嶄綔锛屽乏閫熷害={ext}锛屽彸閫熷害={ret}"); } @@ -190,6 +198,8 @@ int ext = (int)para.ManualExtend;//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 int ret = (int)para.ManualRetraction;//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 + int liftPosition = (int)para.LeftPosition;//宸︿几鍑轰綅缃� + int rigtpostition = (int)para.RightPosition;//鍙充几鍑轰綅缃� try { var leftorigin = devices.Value.left.Communicator.Read<bool>("M115");//宸lc鍒板師鐐逛綅缃俊鍙� @@ -225,25 +235,35 @@ { devices.Value.left.Communicator.Write<int>("D1000", ext);//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M100", true);//浼稿嚭鎸夐挳 - Console.WriteLine($"{position}宸LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.left.Communicator.Write<bool>("M100", false); // 閲婃斁鎸夐挳 + devices.Value.left.Communicator.Write<int>("D1002", liftPosition);//宸︿几鍑轰綅缃� + Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄤ几鍑簕ext}"); } else if (position == "宸�" && ExtendedState == "缂╁洖") { devices.Value.left.Communicator.Write<int>("D1000", ext);//宸LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.left.Communicator.Write<bool>("M101", true); - Console.WriteLine($"{position}宸LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.left.Communicator.Write<bool>("M101", false); // 閲婃斁鎸夐挳 + Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄧ缉鍥瀧ext}"); } else if (position == "鍙�" && ExtendedState == "浼稿嚭") { devices.Value.right.Communicator.Write<int>("D1000", ret);//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M100", true); - Console.WriteLine($"{position}鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害{ext}"); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.right.Communicator.Write<bool>("M100", false); // 閲婃斁鎸夐挳 + devices.Value.right.Communicator.Write<int>("D1002", liftPosition);//宸︿几鍑轰綅缃� + Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄤ几鍑簕ret}"); } else if (position == "鍙�" && ExtendedState == "缂╁洖") { devices.Value.right.Communicator.Write<int>("D1000", ret);//鍙砅LC鎵嬪姩浼稿嚭缂╁洖閫熷害 devices.Value.right.Communicator.Write<bool>("M101", true); - Console.WriteLine($"{position}鍙砅LC鑷姩浼稿嚭缂╁洖閫熷害{ret}"); + Thread.Sleep(100); // 绛夊緟100ms锛堟ā鎷熸寜閽寜涓嬶級 + devices.Value.right.Communicator.Write<bool>("M101", false); // 閲婃斁鎸夐挳 + Console.WriteLine($"{position}浼哥缉鏉嗘墜鍔ㄧ缉鍥瀧ret}"); } else -- Gitblit v1.9.3