PathServiceInstaller.cs
1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Microsoft.Extensions.DependencyInjection;
using Rcs.Application.Services;
using Rcs.Application.Services.PathFind;
using Rcs.Infrastructure.PathFinding;
using Rcs.Infrastructure.PathFinding.Services;
namespace Rcs.Infrastructure.Installs;
/// <summary>
/// 路径相关服务注册
/// </summary>
public static class PathInstaller
{
/// <summary>
/// 安装HttpClient服务
/// </summary>
public static IServiceCollection InstallerPathService(
this IServiceCollection services)
{
// 地图映射服务(按MapCode合并多厂商地图)
services.AddSingleton<IMapMappingService, MapMappingService>();
// 统一交通管制服务(基于 MapCode:NodeCode/EdgeCode)
services.AddSingleton<IUnifiedTrafficControlService, UnifiedTrafficControlService>();
// 导航服务
services.AddSingleton<NavigationService>();
// AGV寻路服务
services.AddSingleton<IAgvPathService, AgvPathService>();
// 启动时自动初始化合并映射和逆向边关系
services.AddHostedService<PathServiceInitializer>();
return services;
}
}