Skip to content

Commit

Permalink
Merge pull request #269 from asv-soft/feat-Asv-drones-gui-added-LastK…
Browse files Browse the repository at this point in the history
…nownPosition

feat-Asv-drones-gui-added-LastKnownPosition
  • Loading branch information
asv-soft-u01 authored Jan 22, 2024
2 parents 6861a06 + c995f9f commit be5a978
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System.Reactive.Linq;
using System.Windows.Input;
using Asv.Common;
using Asv.Drones.Gui.Core;
Expand Down Expand Up @@ -73,6 +74,19 @@ public FlightUavViewModel(IVehicleClient vehicle, ILogService log, ILocalization
.Subscribe()
.DisposeItWith(Disposable);

Vehicle.Position.Current.Subscribe(p =>
{
LastKnownPosition = p;
});

Vehicle.Heartbeat.Link.DistinctUntilChanged().Subscribe(s =>
{
if (s == LinkState.Disconnected)
{
log.Info(LogName, $"Last known position: {LastKnownPosition}");
}
});

MinimizedRttItems = _rttItems.Where(_ => _.IsMinimizedVisible).ToList();

ChangeStateCommand = ReactiveCommand.Create(() =>
Expand Down Expand Up @@ -206,7 +220,8 @@ private void ChangeAnchorsVisibility(bool needTo)
public MissionStatusViewModel MissionStatus { get; }
public ReadOnlyObservableCollection<IUavRttItem> RttItems => _rttItems;
public IEnumerable<IUavRttItem> MinimizedRttItems { get; set; }


public GeoPoint LastKnownPosition { get; set; }
public string LogName => "Map." + Title;

[Reactive]
Expand Down

0 comments on commit be5a978

Please sign in to comment.