定位统计改为状态统计,增加机头统计,用于检测是否需要校验磁罗盘

This commit is contained in:
xu 2020-11-27 00:27:35 +08:00
parent 4dba5da8fd
commit ba8eb6b2e2
2 changed files with 29 additions and 1 deletions

View File

@ -238,6 +238,9 @@ namespace Plane.FormationCreator.ViewModels
if (_copterManager.Copters.Count > 0)
{
Dictionary<string, List<string>> GPSTypes = new Dictionary<string, List<string>>();
Dictionary<string, List<string>> Heading = new Dictionary<string, List<string>>();
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<string> copterNames = new List<string>();
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);
}));

View File

@ -55,7 +55,7 @@
Command="{Binding ParamModify}" />
<Button Content="读入参数"
Command="{Binding LoadParamfile}" />
<Button Content="定位统计" Command="{Binding ReportGPSTypeCommand}"/>
<Button Content="状态统计" Command="{Binding ReportGPSTypeCommand}"/>
<Button Content="飞机校准"
Command="{Binding CalibrationSingleCommand}" />
<Button Content="正式参数" Command="{Binding TurnOffTestLightsCommand}" Visibility="Collapsed" />