修改开关灯参数

通信的调试(未使用)
This commit is contained in:
zxd 2018-08-05 13:51:24 +08:00
parent b427d32b44
commit 6fbb8e6273
4 changed files with 23 additions and 5 deletions

View File

@ -50,7 +50,7 @@ namespace Plane.FormationCreator
{
loginWindow = new ConnectWindow();
}
loginWindow.ShowDialog();
loginWindow.Show();
}
private void btnLogin_Click(object sender, RoutedEventArgs e)

View File

@ -132,7 +132,21 @@ namespace Plane.FormationCreator.ViewModels
{
return _WriteIdCommand ?? (_WriteIdCommand = new RelayCommand(async () =>
{
await WriteIdCommandAsync(CopterNum);
await WriteIdCommandAsync(CopterNum, MavComm.COMMANDTYPE4);
}
));
}
}
private ICommand _ChangeWriteMissionCommand;
public ICommand ChangeWriteMissionCommand
{
get
{
return _ChangeWriteMissionCommand ?? (_ChangeWriteMissionCommand = new RelayCommand(async () =>
{
await WriteIdCommandAsync(0, MavComm.COMM_WRITE_MISSION);
}
));
}
@ -279,9 +293,11 @@ namespace Plane.FormationCreator.ViewModels
}
private async Task WriteIdCommandAsync(int num)
private async Task WriteIdCommandAsync(int num, short messageType)
{
await commModule.GeneratePacketAsync((short)num, (byte)Protocols.MavComm.COMMANDTYPE4);
await commModule.GeneratePacketAsync((short)num, messageType);
}

View File

@ -202,7 +202,7 @@ namespace Plane.FormationCreator.ViewModels
}
}
private const string NTF_GROUPLED_OFF = "NTF_GROUPLED_OFF";
private const string NTF_GROUPLED_OFF = "NTF_GLED_OFF";
private ICommand _LEDOnOffCommand;
public ICommand LEDOnOffCommand
{

View File

@ -108,6 +108,7 @@
IsProcessing="{Binding IsProcessing}"
Command="{Binding Path=ConnectCommand}"
CommandParameter="SerialPort" />
<Button Content="切换写航点" Margin="5,5,0,5" Command="{Binding Path=ChangeWriteMissionCommand}" />
<!--<ec:ProgressButton Name="btnConnectUdp"
Grid.Row="1"
Grid.ColumnSpan="3"
@ -128,6 +129,7 @@
<Button Content="设置20台" Margin="5" Command="{Binding Path=SendCommand}" />
<Button Content="写入航点" Margin="5" Command="{Binding Path=CommWriteMissionCommand}" />
<Button Content="广播编号" Margin="5,5,0,5" Command="{Binding Path=WriteIdCommand}" />
<TextBox Margin="2,5,5,5" Width="30" Text="{Binding CopterNum}"></TextBox>
</StackPanel>