From 3a8662548fdefe0b8ce836a334290546753a7bfe Mon Sep 17 00:00:00 2001 From: xu Date: Thu, 22 Jul 2021 15:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=9B=E7=89=A9=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=8A=9F=E8=83=BD=EF=BC=8C=EF=BC=88=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=EF=BC=8C=E4=BD=86=E5=8A=9F=E8=83=BD=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=89=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=88=86=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plane.FormationCreator/MainWindow.xaml | 8 +++++-- .../ViewModels/ConnectViewModel.cs | 21 +++++++++++++++++++ .../Views/ConnectWindow.xaml | 9 ++++---- .../Views/CopterListView.xaml | 4 ++-- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Plane.FormationCreator/MainWindow.xaml b/Plane.FormationCreator/MainWindow.xaml index 3c3e992..a31793f 100644 --- a/Plane.FormationCreator/MainWindow.xaml +++ b/Plane.FormationCreator/MainWindow.xaml @@ -161,8 +161,9 @@ - - + + + @@ -317,5 +318,8 @@ + + + diff --git a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs index c9920a9..f0f7e4f 100644 --- a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs @@ -270,6 +270,27 @@ namespace Plane.FormationCreator.ViewModels } } + + private ICommand _TestPWMCommandAsync; + public ICommand TestPWMCommandAsync + { + get + { + return _TestPWMCommandAsync ?? (_TestPWMCommandAsync = new RelayCommand(async () => + { + try + { + int channel = 10; //固定10是控制PWM舵机 + await commModule.TestFire((short)CopterNum, channel); + } + catch + { } + + } + )); + } + } + private ICommand _TestFireCommandAsync; public ICommand TestFireCommandAsync { diff --git a/Plane.FormationCreator/Views/ConnectWindow.xaml b/Plane.FormationCreator/Views/ConnectWindow.xaml index 90fc952..78fa6a8 100644 --- a/Plane.FormationCreator/Views/ConnectWindow.xaml +++ b/Plane.FormationCreator/Views/ConnectWindow.xaml @@ -44,9 +44,10 @@ - - + diff --git a/Plane.FormationCreator/Views/CopterListView.xaml b/Plane.FormationCreator/Views/CopterListView.xaml index 59fbe6a..107aa6b 100644 --- a/Plane.FormationCreator/Views/CopterListView.xaml +++ b/Plane.FormationCreator/Views/CopterListView.xaml @@ -31,9 +31,9 @@ - + - +