diff --git a/Plane.FormationCreator/MainWindow.xaml.cs b/Plane.FormationCreator/MainWindow.xaml.cs index 59cd581..8a580c8 100644 --- a/Plane.FormationCreator/MainWindow.xaml.cs +++ b/Plane.FormationCreator/MainWindow.xaml.cs @@ -50,7 +50,7 @@ namespace Plane.FormationCreator { loginWindow = new ConnectWindow(); } - loginWindow.ShowDialog(); + loginWindow.Show(); } private void btnLogin_Click(object sender, RoutedEventArgs e) diff --git a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs index c47cb36..37a7caf 100644 --- a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs @@ -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); } diff --git a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs index 08b8253..d376051 100644 --- a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs @@ -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 { diff --git a/Plane.FormationCreator/Views/ConnectWindow.xaml b/Plane.FormationCreator/Views/ConnectWindow.xaml index 3d81ccd..60110bf 100644 --- a/Plane.FormationCreator/Views/ConnectWindow.xaml +++ b/Plane.FormationCreator/Views/ConnectWindow.xaml @@ -108,6 +108,7 @@ IsProcessing="{Binding IsProcessing}" Command="{Binding Path=ConnectCommand}" CommandParameter="SerialPort" /> +