diff --git a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs index 1af61e9..e7c6207 100644 --- a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs @@ -228,6 +228,21 @@ namespace Plane.FormationCreator.ViewModels } } + private ICommand _TestFireCommandAsync; + public ICommand TestFireCommandAsync + { + get + { + return _TestFireCommandAsync ?? (_TestFireCommandAsync = new RelayCommand(async () => + { + int channel = int.Parse(CopterColor); + if (channel >= 0 && channel <= 4) + await commModule.TestFire((short)CopterNum, channel); + } + )); + } + } + private List CreateLEDMissions(IEnumerable LEDInfos) { List missions = new List(); diff --git a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs index e788203..1b5a811 100644 --- a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs @@ -253,6 +253,8 @@ namespace Plane.FormationCreator.ViewModels } } + + private ICommand _DetectionCommModuleVersion; public ICommand DetectionCommModuleVersion { @@ -733,6 +735,25 @@ namespace Plane.FormationCreator.ViewModels } } + private ICommand _TurnOffTestLightsCommand; + public ICommand TurnOffTestLightsCommand + { + get + { + return _TurnOffTestLightsCommand ?? (_TurnOffTestLightsCommand = new RelayCommand(async () => + { + int num = 0; + var o = new { NTF_G_RTLOFF = 1 }; + num = await _commModuleManager.SetMultipleParamAsync( + "NTF_G_RTLOFF", "1", + "FS_GCS_ENABLE", "0", + "NTF_G_RTKTEST", "0", + "WAYPOINT_GLED", "0"); + Alert.Show($"广播完成! 当前序列号:{num}"); + })); + } + } + private string _RTKcomvalue = "COM6"; public string RTKcomvalue @@ -1338,10 +1359,11 @@ namespace Plane.FormationCreator.ViewModels foreach (LEDInfo ledInfo in LEDInfos) { Color color = (Color)ColorConverter.ConvertFromString("#" + ledInfo.LEDRGB); - if (ledInfo.LEDMode == 8) ledInfo.LEDMode = 50; + int ledMode = ledInfo.LEDMode; + if (ledMode == 8) ledMode = 50; IMission LEDMission = Mission.CreateLEDControlMission( (int)(ledInfo.Delay * 10), - ledInfo.LEDMode, + ledMode, ledInfo.LEDRate, 0, //ledInfo.LEDTimes, color.R, diff --git a/Plane.FormationCreator/Views/ConnectWindow.xaml b/Plane.FormationCreator/Views/ConnectWindow.xaml index b5a8da8..49dd811 100644 --- a/Plane.FormationCreator/Views/ConnectWindow.xaml +++ b/Plane.FormationCreator/Views/ConnectWindow.xaml @@ -145,6 +145,7 @@