From 8938e3aaaadcb526d7179cec31920d8af7ce3d50 Mon Sep 17 00:00:00 2001 From: xu Date: Tue, 5 May 2020 16:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=80=81=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=88=AA=E7=82=B9=E6=96=87=E4=BB=B6=20=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E4=BF=9D=E7=95=991=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlightTaskSingleCopterInfo_LED.cs | 24 ++++++++++++++++--- .../Views/ModifyTaskView.xaml | 4 ++-- 2 files changed, 23 insertions(+), 5 deletions(-) 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 @@ - +