From ba8eb6b2e2f49c038d31d05623b3f0044ea0ca6b Mon Sep 17 00:00:00 2001 From: xu Date: Fri, 27 Nov 2020 00:27:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=BB=9F=E8=AE=A1=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=8A=B6=E6=80=81=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9C=BA=E5=A4=B4=E7=BB=9F=E8=AE=A1=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=A3=80=E6=B5=8B=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=A3=81=E7=BD=97=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ControlPanelViewModel.cs | 28 +++++++++++++++++++ .../Views/ControlPanelView.xaml | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs index 74bb998..d3178a9 100644 --- a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs @@ -238,6 +238,9 @@ namespace Plane.FormationCreator.ViewModels if (_copterManager.Copters.Count > 0) { Dictionary> GPSTypes = new Dictionary>(); + + Dictionary> Heading = new Dictionary>(); + foreach (var copter in _copterManager.Copters) { string name = copter.Name; @@ -249,12 +252,37 @@ namespace Plane.FormationCreator.ViewModels } else GPSTypes[copter.GpsFixType.ToString()].Add(name); + + + + + if (!Heading.Keys.Contains(copter.Heading.ToString())) + { + List copterNames = new List(); + copterNames.Add(name); + Heading.Add(copter.Heading.ToString(), copterNames); + } + else + Heading[copter.Heading.ToString()].Add(name); + + } + Message.Show($"==定位状态=="); foreach (var item in GPSTypes) { Message.Show($"{item.Key}:{string.Join(",", item.Value)}"); + Message.Show($"------------"); } + Message.Show($"==机头方向=="); + + foreach (var item in Heading) + { + Message.Show($"{item.Key} 度:{string.Join(",", item.Value)}"); + Message.Show($"------------"); + + } + } await Task.Delay(10); })); diff --git a/Plane.FormationCreator/Views/ControlPanelView.xaml b/Plane.FormationCreator/Views/ControlPanelView.xaml index c6b5049..94ce4ef 100644 --- a/Plane.FormationCreator/Views/ControlPanelView.xaml +++ b/Plane.FormationCreator/Views/ControlPanelView.xaml @@ -55,7 +55,7 @@ Command="{Binding ParamModify}" />