Compare commits
No commits in common. "e2ea96ed56f7da85989652a395b67d78e19993c6" and "b000e7fa0f9116fc3f93d4b69caa119de1ba6fbe" have entirely different histories.
e2ea96ed56
...
b000e7fa0f
@ -172,15 +172,5 @@ namespace Plane.Copters
|
|||||||
/// 获取当前电池电压,单位为伏特。
|
/// 获取当前电池电压,单位为伏特。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float Voltage { get; }
|
float Voltage { get; }
|
||||||
|
|
||||||
//定位类型RTK,GPS
|
|
||||||
CopterLocationType LocationType { get; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// MissionStatus=1表示正在飞向目标中,0标识达到目标
|
|
||||||
/// </summary>
|
|
||||||
int MissionStatus { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)CopterManagement\ICopterManager.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)CopterManagement\ICopterManager.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\Constants.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Copters\Constants.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\CopterCommand.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Copters\CopterCommand.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\CopterLocationType.cs" />
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\CopterState.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Copters\CopterState.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\PLObservableObject.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Copters\PLObservableObject.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Copters\FlightCommand.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Copters\FlightCommand.cs" />
|
||||||
|
@ -9,7 +9,6 @@ namespace Plane.Communication
|
|||||||
internal class UdpServerConnection : UdpConnectionBase
|
internal class UdpServerConnection : UdpConnectionBase
|
||||||
{
|
{
|
||||||
private IPEndPoint _remoteEP;
|
private IPEndPoint _remoteEP;
|
||||||
private IPEndPoint _boardaddEP;
|
|
||||||
|
|
||||||
private Func<byte[], int, IPEndPoint, Task<int>> _sendFunc;
|
private Func<byte[], int, IPEndPoint, Task<int>> _sendFunc;
|
||||||
|
|
||||||
@ -18,7 +17,6 @@ namespace Plane.Communication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public UdpServerConnection(IPEndPoint remoteEP, Func<byte[], int, IPEndPoint, Task<int>> sendFunc)
|
public UdpServerConnection(IPEndPoint remoteEP, Func<byte[], int, IPEndPoint, Task<int>> sendFunc)
|
||||||
{
|
{
|
||||||
_boardaddEP = new IPEndPoint(IPAddress.Parse("192.168.62.255"), remoteEP.Port);
|
|
||||||
_remoteEP = remoteEP;
|
_remoteEP = remoteEP;
|
||||||
_sendFunc = sendFunc;
|
_sendFunc = sendFunc;
|
||||||
}
|
}
|
||||||
@ -39,13 +37,6 @@ namespace Plane.Communication
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _sendFunc(datagram, bytes, _remoteEP).ConfigureAwait(false);
|
await _sendFunc(datagram, bytes, _remoteEP).ConfigureAwait(false);
|
||||||
/*
|
|
||||||
//如果是广播包,用于广播消息,比如RTK等
|
|
||||||
if (false)
|
|
||||||
await _sendFunc(datagram, bytes, _boardaddEP).ConfigureAwait(false);
|
|
||||||
else
|
|
||||||
await _sendFunc(datagram, bytes, _remoteEP).ConfigureAwait(false);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -155,12 +155,8 @@ namespace Plane.Copters
|
|||||||
|
|
||||||
private float _Voltage;
|
private float _Voltage;
|
||||||
|
|
||||||
private CopterLocationType _LocationType= CopterLocationType.GPS;
|
|
||||||
|
|
||||||
private float _Yaw;
|
private float _Yaw;
|
||||||
|
|
||||||
private int _MissionStatus;
|
|
||||||
|
|
||||||
#endregion Backing Fields
|
#endregion Backing Fields
|
||||||
|
|
||||||
public CopterImplSharedPart(SynchronizationContext uiSyncContext) : base(uiSyncContext)
|
public CopterImplSharedPart(SynchronizationContext uiSyncContext) : base(uiSyncContext)
|
||||||
@ -617,27 +613,12 @@ namespace Plane.Copters
|
|||||||
protected set { Set(nameof(Voltage), ref _Voltage, value); }
|
protected set { Set(nameof(Voltage), ref _Voltage, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CopterLocationType LocationType
|
|
||||||
{
|
|
||||||
get { return _LocationType; }
|
|
||||||
protected set { Set(nameof(LocationType), ref _LocationType, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public float Yaw
|
public float Yaw
|
||||||
{
|
{
|
||||||
get { return _Yaw; }
|
get { return _Yaw; }
|
||||||
protected set { Set(nameof(Yaw), ref _Yaw, value); }
|
protected set { Set(nameof(Yaw), ref _Yaw, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int MissionStatus
|
|
||||||
{
|
|
||||||
get { return _MissionStatus; }
|
|
||||||
set { Set(nameof(MissionStatus), ref _MissionStatus, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if PRIVATE
|
#if PRIVATE
|
||||||
public
|
public
|
||||||
#else
|
#else
|
||||||
|
@ -84,11 +84,6 @@ namespace Plane.Copters
|
|||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task InitAsync()
|
|
||||||
{
|
|
||||||
return TaskUtils.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task StopPairingAsync()
|
public Task StopPairingAsync()
|
||||||
{
|
{
|
||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
|
@ -343,12 +343,6 @@ namespace Plane.Copters
|
|||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Task InitAsync()
|
|
||||||
{
|
|
||||||
return TaskUtils.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task StopPairingAsync()
|
public Task StopPairingAsync()
|
||||||
{
|
{
|
||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
|
@ -54,8 +54,6 @@ namespace Plane.Copters
|
|||||||
await _internalCopter.ConnectAsync().ConfigureAwait(false);
|
await _internalCopter.ConnectAsync().ConfigureAwait(false);
|
||||||
IsConnected = _internalCopter.IsConnected;
|
IsConnected = _internalCopter.IsConnected;
|
||||||
IsCheckingConnection = true;
|
IsCheckingConnection = true;
|
||||||
//连接完成后做一些初始化的工作
|
|
||||||
await InitAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task DisconnectAsync()
|
public virtual async Task DisconnectAsync()
|
||||||
@ -250,17 +248,6 @@ namespace Plane.Copters
|
|||||||
await _internalCopter.GeneratePacketAsync(MAVLink.MAVLINK_MSG_ID_SET_PAIR, packet).ConfigureAwait(false);
|
await _internalCopter.GeneratePacketAsync(MAVLink.MAVLINK_MSG_ID_SET_PAIR, packet).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task InitAsync()
|
|
||||||
{
|
|
||||||
float Gpstype= await _internalCopter.GetParamAsync("GPS_TYPE") ;
|
|
||||||
if (Gpstype == 15)
|
|
||||||
LocationType = CopterLocationType.RTK;
|
|
||||||
else
|
|
||||||
LocationType = CopterLocationType.GPS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task StopPairingAsync()
|
public async Task StopPairingAsync()
|
||||||
{
|
{
|
||||||
if (!IsPairing) return;
|
if (!IsPairing) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user