Plane.FormationCreator/Plane.FormationCreator/Formation/FlightTaskSingleCopterInfo_FlyTo.cs

73 lines
2.2 KiB
C#

using GalaSoft.MvvmLight.Command;
using Plane.Copters;
using Plane.Windows.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Plane.FormationCreator.Formation
{
public partial class FlightTaskSingleCopterInfo
{
public static FlightTaskSingleCopterInfo CreateForFlyToTask(ICopter copter, double targetLat, double targetLng, float targetAlt,int flytoTime,int loiterTime)
{
var info = new FlightTaskSingleCopterInfo(copter)
{
TargetLat = targetLat,
TargetLng = targetLng,
TargetAlt = targetAlt,
FlytoTime= flytoTime,
LoiterTime = loiterTime
};
return info;
}
public static FlightTaskSingleCopterInfo CreateForFlyToTask(ICopter copter, LatLng latLngOffset, float targetAlt, int flytoTime, int loiterTime)
{
var info = new FlightTaskSingleCopterInfo(copter)
{
LatLngOffset = latLngOffset,
TargetAlt = targetAlt,
FlytoTime = flytoTime,
LoiterTime = loiterTime
};
return info;
}
private bool _FlytoShowLED = true;
public bool FlytoShowLED
{
get { return _FlytoShowLED; }
set { Set(nameof(FlytoShowLED), ref _FlytoShowLED, value); }
}
private int _FlytoTime = 10;
public int FlytoTime
{
get { return _FlytoTime; }
set { Set(nameof(FlytoTime), ref _FlytoTime, value); }
}
private int _LoiterTime = 0;
public int LoiterTime
{
get { return _LoiterTime; }
set { Set(nameof(LoiterTime), ref _LoiterTime, value); }
}
//设置飞机航点中灯光
private ICommand _ModiFlytoLEDCommand;
public ICommand ModiFlytoLEDCommand
{
get
{
return _ModiFlytoLEDCommand ?? (_ModiFlytoLEDCommand = new RelayCommand<double>(async =>
{
Alert.Show("灯光控制");
}));
}
}
}
}