通信模块的断线重连 固定IP改换为199.51
添加飞机选中数量的统计 优化写航点跳过错误,优化写航点的统计 通信模块的version 检测航点最小距离时显示ID号
This commit is contained in:
parent
72a9e28ed1
commit
c867d89f19
@ -173,6 +173,14 @@ namespace Plane.Copters
|
||||
/// </summary>
|
||||
float Voltage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 预留字节用于通信模块条件下的返回值
|
||||
/// </summary>
|
||||
byte[] Retain { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 飞机上通信模块版本
|
||||
/// </summary>
|
||||
byte CommModuleVersion { get; }
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace Plane.Communication
|
||||
{
|
||||
try
|
||||
{
|
||||
return !((_client.Client.Poll(1000, SelectMode.SelectRead) && (_client.Client.Available == 0)) || !_client.Client.Connected);
|
||||
return _client.Client != null && !((_client.Client.Poll(1000, SelectMode.SelectRead) && (_client.Client.Available == 0)) || !_client.Client.Connected);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
@ -107,6 +107,8 @@ namespace Plane.Communication
|
||||
{
|
||||
while (Available < count)
|
||||
{
|
||||
if (Available > 0)
|
||||
Console.WriteLine("Available = " + Available);
|
||||
//if (!IsOpen)
|
||||
// return 0;
|
||||
if (!IsOnline)
|
||||
|
@ -662,6 +662,13 @@ namespace Plane.Copters
|
||||
protected set { Set(nameof(CommModuleMode), ref _CommModuleMode, value); }
|
||||
}
|
||||
|
||||
private byte _CommModuleVersion;
|
||||
public byte CommModuleVersion
|
||||
{
|
||||
get { return _CommModuleVersion; }
|
||||
protected set { Set(nameof(CommModuleVersion), ref _CommModuleVersion, value); }
|
||||
}
|
||||
|
||||
#if PRIVATE
|
||||
public
|
||||
#else
|
||||
|
@ -33,6 +33,7 @@ namespace Plane.Copters
|
||||
Retain = BitConverter.GetBytes(_internalCopter.retain);
|
||||
Voltage = _internalCopter.battery_voltage;
|
||||
CommModuleMode = (FlightMode)_internalCopter.commModuleMode;
|
||||
CommModuleVersion = _internalCopter.commModuleVersion;
|
||||
IsUnlocked = _internalCopter.isUnlocked;
|
||||
Yaw = _internalCopter.yaw;
|
||||
HeartbeatCount++;
|
||||
|
@ -378,7 +378,7 @@ namespace Plane.Copters
|
||||
/// 处理通信模块发过来的数据
|
||||
/// </summary>
|
||||
/// <param name="buffer"></param>
|
||||
public void AnalyzeCommMouldePositionIntPacket(byte[] buffer)
|
||||
public void AnalyzeCommMouldePositionIntPacket(byte[] buffer, byte version)
|
||||
{
|
||||
var info = buffer.ByteArrayToStructure<MavComm.comm_copter_info>(0);
|
||||
lat = info.lat * 1.0e-7;
|
||||
@ -392,6 +392,8 @@ namespace Plane.Copters
|
||||
battery_voltage = ((float)info.battery_voltage) / 1000;
|
||||
yaw = ((float)info.yaw / 100) % 360;
|
||||
|
||||
commModuleVersion = version;
|
||||
|
||||
retain = info.retain;
|
||||
RaiseReceiveDataStreamEventOnUIThread(MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT);
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ namespace Plane.Copters
|
||||
|
||||
public uint mode { get; set; }
|
||||
public uint commModuleMode { get; set; }
|
||||
public byte commModuleVersion { get; set; }
|
||||
|
||||
public bool isUnlocked { get; set; }
|
||||
|
||||
public float battery_voltage { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user