调整设置界面
任务右键改为隐藏\显示航点
This commit is contained in:
parent
5c6cf9ecdb
commit
08ff8c7772
@ -86,7 +86,7 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
{
|
{
|
||||||
return _SendCommand ?? (_SendCommand = new RelayCommand(async () =>
|
return _SendCommand ?? (_SendCommand = new RelayCommand(async () =>
|
||||||
{
|
{
|
||||||
await SendCommandAsync(CopterNum);
|
await SendCommandAsync(CopterSum);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -125,7 +125,14 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
set { Set(nameof(CopterNum), ref _CopterNum, value); }
|
set { Set(nameof(CopterNum), ref _CopterNum, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _CopterColor = "";
|
|
||||||
|
private int _CopterSum=100;
|
||||||
|
public int CopterSum
|
||||||
|
{
|
||||||
|
get { return _CopterSum; }
|
||||||
|
set { Set(nameof(CopterSum), ref _CopterSum, value); }
|
||||||
|
}
|
||||||
|
private string _CopterColor = "FFFFFF";
|
||||||
public string CopterColor
|
public string CopterColor
|
||||||
{
|
{
|
||||||
get { return _CopterColor; }
|
get { return _CopterColor; }
|
||||||
@ -233,11 +240,17 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _TestFireCommandAsync ?? (_TestFireCommandAsync = new RelayCommand(async () =>
|
return _TestFireCommandAsync ?? (_TestFireCommandAsync = new RelayCommand(async () =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
int channel = int.Parse(CopterColor);
|
int channel = int.Parse(CopterColor);
|
||||||
if (channel >= 0 && channel <= 4)
|
if (channel >= 0 && channel <= 4)
|
||||||
await commModule.TestFire((short)CopterNum, channel);
|
await commModule.TestFire((short)CopterNum, channel);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
|
||||||
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,16 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
case nameof(FlightTaskManager.SelectedTaskIndex):
|
case nameof(FlightTaskManager.SelectedTaskIndex):
|
||||||
SelectTask();
|
SelectTask();
|
||||||
break;
|
break;
|
||||||
|
case nameof(FlightTaskManager.RightSelectedTaskIndex): // 单击右键触发清除航点
|
||||||
|
|
||||||
|
int taskIndexTmp = Math.Abs(_flightTaskManager.RightSelectedTaskIndex);
|
||||||
|
if (_flightTaskManager.Tasks[taskIndexTmp].IsRightSelected)
|
||||||
|
{
|
||||||
|
if (waypointGroup == null) waypointGroup = new Model3DGroup();
|
||||||
|
waypointGroup.Children.Clear();
|
||||||
|
}
|
||||||
|
else SelectTask();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -37,19 +37,25 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Name="panel2" >
|
Name="panel2" >
|
||||||
|
<TextBlock Margin="5" VerticalAlignment="Center" Text="总数:" />
|
||||||
|
<TextBox Width="45" VerticalContentAlignment="Center" Text="{Binding CopterSum}" Margin="5,5,5,5" />
|
||||||
<Button Content="设置总数" Width="90" Margin="5,5,5,5" Command="{Binding Path=SendCommand}" />
|
<Button Content="设置总数" Width="90" Margin="5,5,5,5" Command="{Binding Path=SendCommand}" />
|
||||||
<Button Content="切换写航点" Width="90" Margin="5,5,5,5" Command="{Binding Path=ChangeWriteMissionCommand}" />
|
<Button Content="切换写航点" Width="90" Margin="5,5,5,5" Command="{Binding Path=ChangeWriteMissionCommand}" />
|
||||||
<Button Content="通信状态" Width="90" Margin="5,5,5,5" Command="{Binding StateInquireCommand}"/>
|
<Button Content="通信状态" Width="90" Margin="5,5,5,5" Command="{Binding StateInquireCommand}"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Grid.Row="1" >
|
Grid.Row="1" >
|
||||||
<TextBox Width="90" VerticalContentAlignment="Center" Text="{Binding CopterNum}" Margin="5,5,5,5" />
|
<TextBlock Margin="5" VerticalAlignment="Center" Text="ID:" />
|
||||||
<Button Content="对频" Width="90" Margin="5,5,5,5" Command="{Binding Path=WriteIdCommand}" />
|
<TextBox Width="30" VerticalContentAlignment="Center" Text="{Binding CopterNum}" Margin="5,5,5,5" />
|
||||||
<Button Content="闪灯 " Width="90" Margin="5,5,5,5" Command="{Binding CommDataAsync}"/>
|
<TextBlock Margin="5" VerticalAlignment="Center" Text="参数:" />
|
||||||
<Button Content="拉烟" Width="90" Margin="5,5,5,5" Command="{Binding TestFireCommandAsync}"/>
|
<TextBox Width="56" VerticalContentAlignment="Center" Text="{Binding CopterColor}" Margin="5,5,5,5"/>
|
||||||
<TextBox Width="50" VerticalContentAlignment="Center" Text="{Binding CopterColor}" Margin="5,5,5,5"/>
|
<Button Content="对频" Width="67" Margin="5,5,5,5" Command="{Binding Path=WriteIdCommand}" />
|
||||||
|
<Button Content="闪灯 " Width="67" Margin="5,5,5,5" Command="{Binding CommDataAsync}"/>
|
||||||
|
<Button Content="拉烟" Width="67" Margin="5,5,5,5" Command="{Binding TestFireCommandAsync}"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
|
@ -122,13 +122,7 @@ namespace Plane.FormationCreator.Views
|
|||||||
{
|
{
|
||||||
var elem = sender as FrameworkElement;
|
var elem = sender as FrameworkElement;
|
||||||
var task = elem.DataContext as FlightTask;
|
var task = elem.DataContext as FlightTask;
|
||||||
if (task.TaskType != FlightTaskType.FlyTo) return;
|
_flightTaskManager.RightSelect(task);
|
||||||
TasksControl.Focus();
|
|
||||||
string newName = task.TaskCnName;
|
|
||||||
if (PlaneMessageBox.OnShow("请输入新的名称", "重命名", ref newName))
|
|
||||||
{
|
|
||||||
task.TaskCnName = newName;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user