diff --git a/Plane.FormationCreator/Formation/FlightTaskSingleCopterInfo_LED.cs b/Plane.FormationCreator/Formation/FlightTaskSingleCopterInfo_LED.cs index 3e06aa4..239bd65 100644 --- a/Plane.FormationCreator/Formation/FlightTaskSingleCopterInfo_LED.cs +++ b/Plane.FormationCreator/Formation/FlightTaskSingleCopterInfo_LED.cs @@ -102,7 +102,7 @@ namespace Plane.FormationCreator.Formation { _ledSumTime += (float)led.Delay; } - LEDSumTime = _ledSumTime; + LEDSumTime =(float) Math.Round(_ledSumTime, 1); } @@ -204,6 +204,7 @@ namespace Plane.FormationCreator.Formation private double delay = 1; //灯光延时 单位:100ms (从当前任务开为0,延时几秒后设置LED) private int ledmode = 0; //灯光模式 0常亮 1闪烁 2随机闪烁(RGB无意义) private float ledInterval = 0; //闪烁延时 单位:秒 + private int ledrate = 0; //为了和以前文件兼容,自动转为ledInterval private int ledtimes = 0; //次数 (预留、暂取消其意义) private string ledRGB = "FFFFFF"; //灯光颜色 private SolidColorBrush _DrawRGB = new SolidColorBrush(Color.FromRgb(0xFF, 0xFF, 0xFF)); @@ -231,7 +232,10 @@ namespace Plane.FormationCreator.Formation public double Delay { get { return delay; } - set { delay = value; OnPropertyChanged("delay"); } + set { + delay = Math.Round(value, 1); + OnPropertyChanged("delay"); + } } public int LEDMode @@ -242,8 +246,22 @@ namespace Plane.FormationCreator.Formation public float LEDInterval { get { return ledInterval; } - set { ledInterval = value; } + set { ledInterval = value; + if (ledInterval != 0) + ledrate = (int)Math.Round(1 / ledInterval); //用于兼容老版本 + } } + + public int LEDRate + { + get { return ledrate; } + set { ledrate = value; + if ((ledrate!=0)&&(ledInterval==0)) + ledInterval = 1 / ledrate; + } + } + + public int LEDTimes { get { return ledtimes; } diff --git a/Plane.FormationCreator/Views/ModifyTaskView.xaml b/Plane.FormationCreator/Views/ModifyTaskView.xaml index 8304910..65084bd 100644 --- a/Plane.FormationCreator/Views/ModifyTaskView.xaml +++ b/Plane.FormationCreator/Views/ModifyTaskView.xaml @@ -427,7 +427,7 @@ - + @@ -435,7 +435,7 @@ - +