added my location service
90e79dfd
Tobias Donaubauer
committed
4 changed files
MyLocation.cs
/WPE.App.Services/Models/MyLocation.cs+47
/WPE.App.Services/Models/MyLocation.cs
Add comment 1 Plus  using System;
Add comment 2 Plus  using System.Collections.Generic;
Add comment 3 Plus  using System.Linq;
Add comment 4 Plus  using System.Text;
Add comment 5 Plus  using System.Threading.Tasks;
Add comment 6 Plus  
Add comment 7 Plus  namespace Infsoft.WPE.App.Services.Models
Add comment 8 Plus  {
Add comment 9 Plus   /// <summary>
Add comment 10 Plus   /// Represents a location with optional coordinates, floor level, accuracy, timestamp, and source.
Add comment 11 Plus   /// </summary>
Add comment 12 Plus   public class MyLocation
Add comment 13 Plus   {
Add comment 14 Plus   /// <summary>
Add comment 15 Plus   /// Latitude in decimal degrees. Optional.
Add comment 16 Plus   /// </summary>
Add comment 17 Plus   public double? Latitude { get; set; }
Add comment 18 Plus  
Add comment 19 Plus   /// <summary>
Add comment 20 Plus   /// Longitude in decimal degrees. Optional.
Add comment 21 Plus   /// </summary>
Add comment 22 Plus   public double? Longitude { get; set; }
Add comment 23 Plus  
Add comment 24 Plus   /// <summary>
Add comment 25 Plus   /// Floor level or story number. Optional.
Add comment 26 Plus   /// </summary>
Add comment 27 Plus   public int? Level { get; set; }
Add comment 28 Plus  
Add comment 29 Plus   /// <summary>
Add comment 30 Plus   /// Horizontal accuracy in meters. Optional.
Add comment 31 Plus   /// </summary>
Add comment 32 Plus   public double? Accuracy { get; set; }
Add comment 33 Plus  
Add comment 34 Plus   /// <summary>
Add comment 35 Plus   /// Timestamp of the location data in UTC. Required but can be null.
Add comment 36 Plus   /// Caller must explicitly assign a value (including null).
Add comment 37 Plus   /// </summary>
Add comment 38 Plus   public required DateTime? UtcTs { get; set; }
Add comment 39 Plus  
Add comment 40 Plus   /// <summary>
Add comment 41 Plus   /// Source of the location information (e.g., GPS, Wi-Fi, UWB, etc.). Required.
Add comment 42 Plus   /// </summary>
Add comment 43 Plus   public required MyLocationSource Source { get; set; }
Add comment 44 Plus   }
Add comment 45 Plus  
Add comment 46 Plus  }
Add comment 47 Plus  
MyLocationSource.cs
/WPE.App.Services/Models/MyLocationSource.cs+35
/WPE.App.Services/Models/MyLocationSource.cs
Add comment 1 Plus  using System;
Add comment 2 Plus  using System.Collections.Generic;
Add comment 3 Plus  using System.Linq;
Add comment 4 Plus  using System.Text;
Add comment 5 Plus  using System.Threading.Tasks;
Add comment 6 Plus  
Add comment 7 Plus  namespace Infsoft.WPE.App.Services.Models
Add comment 8 Plus  {
Add comment 9 Plus   /// <summary>
Add comment 10 Plus   /// source of my location
Add comment 11 Plus   /// </summary>
Add comment 12 Plus   public enum MyLocationSource
Add comment 13 Plus   {
Add comment 14 Plus   /// <summary>
Add comment 15 Plus   /// none
Add comment 16 Plus   /// </summary>
Add comment 17 Plus   None,
Add comment 18 Plus  
Add comment 19 Plus   /// <summary>
Add comment 20 Plus   /// gps
Add comment 21 Plus   /// </summary>
Add comment 22 Plus   Gps,
Add comment 23 Plus  
Add comment 24 Plus   /// <summary>
Add comment 25 Plus   /// ble
Add comment 26 Plus   /// </summary>
Add comment 27 Plus   Ble,
Add comment 28 Plus  
Add comment 29 Plus   /// <summary>
Add comment 30 Plus   /// ultra wideband
Add comment 31 Plus   /// </summary>
Add comment 32 Plus   Uwb
Add comment 33 Plus   }
Add comment 34 Plus  }
Add comment 35 Plus  
IMyLocationService.cs
/WPE.App.Services/IMyLocationService.cs+39
/WPE.App.Services/IMyLocationService.cs
Add comment 1 Plus  using Infsoft.WPE.App.Services.Models;
Add comment 2 Plus  using System;
Add comment 3 Plus  using System.Collections.Generic;
Add comment 4 Plus  using System.Linq;
Add comment 5 Plus  using System.Text;
Add comment 6 Plus  using System.Threading.Tasks;
Add comment 7 Plus  
Add comment 8 Plus  namespace Infsoft.WPE.App.Services
Add comment 9 Plus  {
Add comment 10 Plus   /// <summary>
Add comment 11 Plus   /// Service for retrieving and monitoring location updates.
Add comment 12 Plus   /// </summary>
Add comment 13 Plus   public interface IMyLocationService
Add comment 14 Plus   {
Add comment 15 Plus   /// <summary>
Add comment 16 Plus   /// The most recent known location, if available.
Add comment 17 Plus   /// </summary>
Add comment 18 Plus   MyLocation? LastKnown { get; }
Add comment 19 Plus  
Add comment 20 Plus   /// <summary>
Add comment 21 Plus   /// Event triggered when a new location is available.
Add comment 22 Plus   /// </summary>
Add comment 23 Plus   event Func<MyLocation, Task> LocationChanged;
Add comment 24 Plus  
Add comment 25 Plus   /// <summary>
Add comment 26 Plus   /// Requests a location update identified by a specific request ID.
Add comment 27 Plus   /// </summary>
Add comment 28 Plus   /// <param name="requestId">The identifier for this location request.</param>
Add comment 29 Plus   Task Request(Guid requestId);
Add comment 30 Plus  
Add comment 31 Plus   /// <summary>
Add comment 32 Plus   /// Cancels a previously made location request.
Add comment 33 Plus   /// </summary>
Add comment 34 Plus   /// <param name="requestId">The identifier for the request to cancel.</param>
Add comment 35 Plus   Task Cancel(Guid requestId);
Add comment 36 Plus   }
Add comment 37 Plus  
Add comment 38 Plus  }
Add comment 39 Plus  
WPE.App.Services.csproj
/WPE.App.Services/WPE.App.Services.csproj-3+3
/WPE.App.Services/WPE.App.Services.csproj
Add comment 16 <PackageIcon>icon.png</PackageIcon>
Add comment 17 <PackageReadmeFile>ReadMe.md</PackageReadmeFile>
Add comment 18 <PackageTags>WPE;Workplace Experience;infsoft</PackageTags>
Add comment 19 Minus   <Version>0.9.9</Version>
Add comment 19 Plus   <Version>0.9.10</Version>
Add comment 20 <GenerateDocumentationFile>true</GenerateDocumentationFile>
Add comment 21 </PropertyGroup>
Add comment 22
Add comment 39 <ItemGroup>
Add comment 40 <PackageReference Include="Infsoft.WPE.App.DTO" Version="1.5.5" />
Add comment 41 <PackageReference Include="Infsoft.WPE.App.Extensions" Version="0.3.5" />
Add comment 42 Minus   <PackageReference Include="Microsoft.Extensions.Http" Version="9.0.3" />
Add comment 43 Minus   <PackageReference Include="Microsoft.JSInterop" Version="9.0.3" />
Add comment 42 Plus   <PackageReference Include="Microsoft.Extensions.Http" Version="9.0.4" />
Add comment 43 Plus   <PackageReference Include="Microsoft.JSInterop" Version="9.0.4" />
Add comment 44 <PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.8.1">
Add comment 45 <PrivateAssets>all</PrivateAssets>
Add comment 46 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>