47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using RobotNet10.FleetManager.Services.TrafficControl.Models;
|
|
|
|
namespace RobotNet10.FleetManager.Services.TrafficControl.Services;
|
|
|
|
/// <summary>
|
|
/// Service for managing Base/Horizon segments
|
|
/// </summary>
|
|
public interface IBaseHorizonManagementService
|
|
{
|
|
/// <summary>
|
|
/// Check robot position (Base vs Horizon)
|
|
/// </summary>
|
|
Task<(bool IsInBase, int CurrentSegmentIndex, RouteSegment? CurrentSegment)> CheckRobotPositionAsync(
|
|
string robotId,
|
|
RobotRoute route,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Release horizon segments to base when safe
|
|
/// </summary>
|
|
Task<bool> ReleaseHorizonSegmentAsync(
|
|
string robotId,
|
|
int segmentCount,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Check and release horizons for all robots (called periodically or on state update)
|
|
/// </summary>
|
|
Task CheckAndReleaseHorizonsAsync(
|
|
string? robotId = null,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Calculate safe base size - largest base size without conflicts
|
|
/// </summary>
|
|
Task<int> CalculateSafeBaseSizeAsync(
|
|
string robotId,
|
|
RobotRoute route,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Count remaining Base segments based on robot's current position
|
|
/// </summary>
|
|
int CountRemainingBaseSegments(RobotRoute route, RobotNet.VDA5050.State.StateMsg? state);
|
|
}
|
|
|