diff --git a/PlaneGcsSdk.Contract_Shared/Copters/ICopter.cs b/PlaneGcsSdk.Contract_Shared/Copters/ICopter.cs index e038ccb..d4c4a61 100644 --- a/PlaneGcsSdk.Contract_Shared/Copters/ICopter.cs +++ b/PlaneGcsSdk.Contract_Shared/Copters/ICopter.cs @@ -2,7 +2,7 @@ namespace Plane.Copters { - public partial interface ICopter : ICopterStatus, ICopterEvents, ICopterActions, ICopterCommunication, INotifyPropertyChanged + public partial interface ICopter : ICopterStatus, ICopterEvents, ICopterActions, ICopterCommunication, INotifyPropertyChanged, ICopterAttribute { } diff --git a/PlaneGcsSdk.Contract_Shared/PlaneGcsSdk.Contract_Shared.projitems b/PlaneGcsSdk.Contract_Shared/PlaneGcsSdk.Contract_Shared.projitems index 90ba7c6..f92db2d 100644 --- a/PlaneGcsSdk.Contract_Shared/PlaneGcsSdk.Contract_Shared.projitems +++ b/PlaneGcsSdk.Contract_Shared/PlaneGcsSdk.Contract_Shared.projitems @@ -21,6 +21,7 @@ + diff --git a/PlaneGcsSdk_Private_NET46/PlaneGcsSdk_Private_NET46.csproj b/PlaneGcsSdk_Private_NET46/PlaneGcsSdk_Private_NET46.csproj index 0569a3e..78eddf5 100644 --- a/PlaneGcsSdk_Private_NET46/PlaneGcsSdk_Private_NET46.csproj +++ b/PlaneGcsSdk_Private_NET46/PlaneGcsSdk_Private_NET46.csproj @@ -31,6 +31,7 @@ bin\Release\PlaneGcsSdk_Private_NET46.xml + diff --git a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs index 60bc87f..6928324 100644 --- a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs +++ b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Media; namespace Plane.CommunicationManagement { @@ -267,8 +268,9 @@ namespace Plane.CommunicationManagement bool temp = false; //测试用 灯光间隔1S闪烁 - public async Task TestLED(short id) + public async Task TestLED(short id, string colorString) { + MAVLink.mavlink_msg_id_led_control led = new MAVLink.mavlink_msg_id_led_control(); led.target_system = 1; led.target_component = 1;//(byte)MAVLink.MAV_COMPONENT.MAV_COMP_ID_SYSTEM_CONTROL;; @@ -276,9 +278,14 @@ namespace Plane.CommunicationManagement led.pattern = 0; led.custom_len = 4; led.custom_bytes = new byte[24]; - led.custom_bytes[0] = 175; - led.custom_bytes[1] = 30; - led.custom_bytes[2] = 50; + + if (colorString == "") colorString = "330033"; + + Color color = (Color)ColorConverter.ConvertFromString("#" + colorString); + + led.custom_bytes[0] = color.R; + led.custom_bytes[1] = color.G; + led.custom_bytes[2] = color.B; led.custom_bytes[3] = 3; byte[] data; data = MavlinkUtil.StructureToByteArray(led); diff --git a/PlaneGcsSdk_Shared/Copters/CopterImplSharedPart.cs b/PlaneGcsSdk_Shared/Copters/CopterImplSharedPart.cs index 0c88891..ae5a138 100644 --- a/PlaneGcsSdk_Shared/Copters/CopterImplSharedPart.cs +++ b/PlaneGcsSdk_Shared/Copters/CopterImplSharedPart.cs @@ -150,6 +150,8 @@ namespace Plane.Copters private byte[] _Retain = new byte[4]; + private float _GroundAlt = 0; + private CopterState _State; private string _StatusText; @@ -619,6 +621,15 @@ namespace Plane.Copters get { return BitConverter.ToSingle(Retain,0); } } + public float GroundAlt + { + get { return _GroundAlt; } + set { + Set(nameof(GroundAlt), ref _GroundAlt, value); + RaisePropertyChanged(nameof(GroundAlt)); + } + } + public byte[] Retain {