mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:36:31 +00:00
fix re-send new batch to gps denied
todo: clear folders, consider better center point to fetch next batch from satellite provider
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using System.Windows.Media;
|
||||
using MediatR;
|
||||
|
||||
namespace Azaion.Common.Events;
|
||||
|
||||
public class SetStatusTextEvent(string text, Color? color = null) : INotification
|
||||
public class SetStatusTextEvent(string text, bool isError = false) : INotification
|
||||
{
|
||||
public string Text { get; set; } = text;
|
||||
public Color? Color { get; set; } = color;
|
||||
public bool IsError { get; set; } = isError;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class GpsMatcherService(IGpsMatcherClient gpsMatcherClient, ISatelliteDow
|
||||
.ToDictionary(x => x.Filename, x => x.Index);
|
||||
|
||||
await satelliteTileDownloader.GetTiles(_currentLat, _currentLon, SATELLITE_RADIUS_M, ZOOM_LEVEL, _detectToken);
|
||||
gpsMatcherClient.StartMatching(new StartMatchingEvent
|
||||
await gpsMatcherClient.StartMatching(new StartMatchingEvent
|
||||
{
|
||||
ImagesCount = POINTS_COUNT,
|
||||
Latitude = _currentLat,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Azaion.Common.Events;
|
||||
using Azaion.CommonSecurity;
|
||||
using Azaion.CommonSecurity.DTO;
|
||||
using MediatR;
|
||||
@@ -12,7 +13,7 @@ namespace Azaion.Common.Services;
|
||||
|
||||
public interface IGpsMatcherClient : IDisposable
|
||||
{
|
||||
void StartMatching(StartMatchingEvent startEvent);
|
||||
Task StartMatching(StartMatchingEvent startEvent);
|
||||
void Stop();
|
||||
}
|
||||
|
||||
@@ -121,9 +122,15 @@ public class GpsMatcherClient : IGpsMatcherClient
|
||||
}
|
||||
}
|
||||
|
||||
public void StartMatching(StartMatchingEvent e)
|
||||
public async Task StartMatching(StartMatchingEvent e)
|
||||
{
|
||||
_requestSocket.SendFrame(e.ToString());
|
||||
_requestSocket.TryReceiveFrameString(TimeSpan.FromMilliseconds(300), out var response);
|
||||
if (response != "OK")
|
||||
{
|
||||
_logger.LogError(response);
|
||||
await _mediator.Publish(new SetStatusTextEvent(response, true));
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop() => _requestSocket.SendFrame("STOP");
|
||||
|
||||
Reference in New Issue
Block a user