65 lines
2.3 KiB
C#
65 lines
2.3 KiB
C#
|
using Plane.Communication;
|
|||
|
using Plane.Copters;
|
|||
|
using System.Collections.ObjectModel;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Plane.CopterManagement
|
|||
|
{
|
|||
|
public interface ICopterManager : ICopterActionsSharedByCopterManager
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 获取 <see cref="ICopter"/> 实例的动态集合。
|
|||
|
/// </summary>
|
|||
|
ObservableCollection<ICopter> AllCopters { get; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取单个 <see cref="ICopter"/> 实例。用 <see cref="EmptyCopter.Instance"/> 代替 null,使用时不必判断是否为 null。
|
|||
|
/// </summary>
|
|||
|
ICopter Copter { get; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取一个值,指示是否正在搜寻飞行器。
|
|||
|
/// </summary>
|
|||
|
bool IsSearching { get; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取被选中的 <see cref="ICopter"/> 实例的动态集合。
|
|||
|
/// </summary>
|
|||
|
ObservableCollection<ICopter> SelectedCopters { get; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 添加或更新 <see cref="ICopter"/> 实例。
|
|||
|
/// </summary>
|
|||
|
/// <param name="id">飞行器的唯一 ID。</param>
|
|||
|
/// <param name="name">飞行器的名字。</param>
|
|||
|
/// <param name="connection">用于通信的 <see cref="IConnection"/> 实例。</param>
|
|||
|
/// <returns></returns>
|
|||
|
Task AddOrUpdateCopterAsync(string id, string name, IConnection connection);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 检查飞行器的状态,判断是否允许 FlyTo,若允许,飞往指定位置。
|
|||
|
/// </summary>
|
|||
|
/// <param name="lat">目的地纬度。</param>
|
|||
|
/// <param name="lng">目的地经度。</param>
|
|||
|
/// <returns>若允许并执行了 FlyTo,返回 true;否则返回 false。</returns>
|
|||
|
Task<bool> CheckStatusAndFlyToAsync(double lat, double lng);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 连接一个新的 <see cref="ICopter"/> 实例。
|
|||
|
/// </summary>
|
|||
|
/// <param name="copter">要连接的 <see cref="ICopter"/> 实例。</param>
|
|||
|
/// <returns>表示此异步操作的 <see cref="Task"/> 实例。</returns>
|
|||
|
Task ConnectAsync(ICopter copter);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 开始搜索并连接飞行器。
|
|||
|
/// </summary>
|
|||
|
void StartSearching();
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 停止搜索飞行器。
|
|||
|
/// </summary>
|
|||
|
void StopSearching();
|
|||
|
}
|
|||
|
}
|