添加当前航点 选中飞机的平移

隐藏了千寻的发送
This commit is contained in:
zxd 2019-08-26 15:53:55 +08:00
parent be825a6065
commit b836322a15
5 changed files with 71 additions and 7 deletions

View File

@ -109,7 +109,7 @@
</MenuItem> </MenuItem>
</Menu> </Menu>
<Menu Name="otherWindows" Background="Transparent" VerticalAlignment="Center" Visibility="Collapsed"> <Menu Name="otherWindows" Background="Transparent" VerticalAlignment="Center">
<MenuItem Header="窗口" Margin="0,2,0,0" Foreground="#969696"> <MenuItem Header="窗口" Margin="0,2,0,0" Foreground="#969696">
<CheckBox Content="属性设置" Margin="0,8,0,8" IsChecked="False" Click="btnAttribute_Click"/> <CheckBox Content="属性设置" Margin="0,8,0,8" IsChecked="False" Click="btnAttribute_Click"/>
<CheckBox Content="分组设置" Margin="0,8,0,8" IsChecked="False" Click="btnGroup_Click"/> <CheckBox Content="分组设置" Margin="0,8,0,8" IsChecked="False" Click="btnGroup_Click"/>

View File

@ -366,7 +366,7 @@ namespace Plane.FormationCreator.ViewModels
return _GuidAsyncCommand ?? (_GuidAsyncCommand = new RelayCommand(async () => return _GuidAsyncCommand ?? (_GuidAsyncCommand = new RelayCommand(async () =>
{ {
if (_copterManager.AcceptingControlCopters != null && _copterManager.AcceptingControlCopters.Count() > 0) if (_copterManager.AcceptingControlCopters != null && _copterManager.AcceptingControlCopters.Count() > 0)
await _commModuleManager.TakeOffAsync(1, _copterManager.AcceptingControlCopters); await _commModuleManager.TakeOffAsync(10, _copterManager.AcceptingControlCopters);
/* /*
await Task.WhenAll(_copterManager.AcceptingControlCopters.Select(async c => await Task.WhenAll(_copterManager.AcceptingControlCopters.Select(async c =>
{ {

View File

@ -214,6 +214,13 @@ namespace Plane.FormationCreator.ViewModels
set { Set(nameof(StaggerRoutes), ref _StaggerRoutes, value); } set { Set(nameof(StaggerRoutes), ref _StaggerRoutes, value); }
} }
private bool _OnlySelected = false;
public bool OnlySelected
{
get { return _OnlySelected; }
set { Set(nameof(OnlySelected), ref _OnlySelected, value); }
}
//调整所有任务经度 //调整所有任务经度
private ICommand _ModiAllPosCommand; private ICommand _ModiAllPosCommand;
public ICommand ModiAllPosCommand public ICommand ModiAllPosCommand
@ -1188,6 +1195,61 @@ public ICommand VerticlAlignmentCommand
} }
} }
//当前任务选中的飞机修改高度
private ICommand _ModiSelectedAltCommand;
public ICommand ModiSelectedAltCommand
{
get
{
return _ModiSelectedAltCommand ?? (_ModiSelectedAltCommand = new RelayCommand<double>(async =>
{
if (_flightTaskManager.Tasks.Count < 2) return;
if (_flightTaskManager.SelectedTask.TaskType != FlightTaskType.FlyTo) return;
for (int i = 0; i < _flightTaskManager.SelectedTask.SingleCopterInfos.Count; i++)
{
var info = _flightTaskManager.SelectedTask.SingleCopterInfos[i];
if (_copterManager.SelectedCopters.Contains(info.Copter))
{
info.TargetAlt += Modialtvalue;
}
}
}));
}
}
//当前任务选中的飞机水平移动
private ICommand _ModiSelectedPosCommand;
public ICommand ModiSelectedPosCommand
{
get
{
return _ModiSelectedPosCommand ?? (_ModiSelectedPosCommand = new RelayCommand<double>(async =>
{
if (_flightTaskManager.Tasks.Count < 2) return;
if (_flightTaskManager.SelectedTask.TaskType != FlightTaskType.FlyTo) return;
for (int i = 0; i < _flightTaskManager.SelectedTask.SingleCopterInfos.Count; i++)
{
var info = _flightTaskManager.SelectedTask.SingleCopterInfos[i];
if (_copterManager.SelectedCopters.Contains(info.Copter))
{
Tuple<double, double> targetLatLng = new Tuple<double, double>(0, 0);
targetLatLng = GeographyUtils.CalcLatLngSomeMetersAway2D(
info.TargetLat,
info.TargetLng,
directionvalue,
Modialtvalue
);
info.TargetLat = targetLatLng.Item1;
info.TargetLng = targetLatLng.Item2;
}
}
}));
}
}
//调整所有任务高度 //调整所有任务高度
private ICommand _ModiAltCommand; private ICommand _ModiAltCommand;
public ICommand ModiAltCommand public ICommand ModiAltCommand

View File

@ -87,7 +87,8 @@
<Button Content="统计模块" <Button Content="统计模块"
Command="{Binding DetectionCommModuleVersion}" /> Command="{Binding DetectionCommModuleVersion}" />
<Button Content="正式灯光" <Button Content="正式灯光"
Command="{Binding TurnOffTestLightsCommand}" /> Command="{Binding TurnOffTestLightsCommand}"
Visibility="Collapsed"/>
<Label Visibility="Collapsed">Lat</Label> <Label Visibility="Collapsed">Lat</Label>
<TextBox Visibility="Collapsed" Text="{Binding LatOffset}" Width="50"/> <TextBox Visibility="Collapsed" Text="{Binding LatOffset}" Width="50"/>
<Label Visibility="Collapsed">Lng</Label> <Label Visibility="Collapsed">Lng</Label>
@ -139,7 +140,7 @@
<Button Content="{Binding Path=NTRIPbtntxt}" <Button Content="{Binding Path=NTRIPbtntxt}"
Command="{Binding SendRTCMCommand}" Command="{Binding SendRTCMCommand}"
/> Visibility="Collapsed"/>
<TextBlock <TextBlock
Margin="5,5,5,5" Margin="5,5,5,5"
Text="{Binding Path=RTKState}" Text="{Binding Path=RTKState}"

View File

@ -163,18 +163,19 @@
Command="{Binding ModiAllPosCommand}" /> Command="{Binding ModiAllPosCommand}" />
<TextBox <TextBox
Grid.Column="1" Grid.Column="1"
Width="40" Width="30"
Margin="0, 5, 5, 0" Margin="0, 5, 5, 0"
HorizontalContentAlignment="Right" HorizontalContentAlignment="Right"
Text="{Binding Modialtvalue, UpdateSourceTrigger=PropertyChanged}"/> Text="{Binding Modialtvalue, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="米 方向" Margin="0, 10, 5, 0"/> <TextBlock Text="米 方向" Margin="0, 10, 5, 0"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Width="35" Width="30"
Margin="0, 5, 5, 0" Margin="0, 5, 5, 0"
HorizontalContentAlignment="Right" HorizontalContentAlignment="Right"
Text="{Binding directionvalue, UpdateSourceTrigger=PropertyChanged}"/> Text="{Binding directionvalue, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="度" Margin="0, 10, 5, 0"/> <TextBlock Text="度" Margin="0, 10, 5, 0"/>
<Button Content="提高" Margin="0,5,5,0" Command="{Binding ModiSelectedAltCommand}"/>
<Button Content="移动" Margin="0,5,5,0" Command="{Binding ModiSelectedPosCommand}"/>
</StackPanel> </StackPanel>
<Separator Margin="0,2" /> <Separator Margin="0,2" />