namespace RobotNet10.NavigationTune.Shared.Models;
///
/// Test run execution record
///
public class TestRun
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid ScenarioId { get; set; }
public Guid ParameterSetId { get; set; }
public DateTime StartTime { get; set; }
public DateTime? EndTime { get; set; }
public TestStatus Status { get; set; }
public double Duration { get; set; } // seconds
public string? Notes { get; set; }
public string? ErrorMessage { get; set; }
// Navigation properties
public TestScenario? Scenario { get; set; }
public NavigationParameterSet? ParameterSet { get; set; }
public TestMetrics? Metrics { get; set; }
public List SafetyViolations { get; set; } = new();
}
///
/// DTO for TestRun API responses. Use this to avoid deserializing abstract TestScenario on the client.
///
public class TestRunDto
{
public Guid Id { get; set; }
public Guid ScenarioId { get; set; }
public string ScenarioName { get; set; } = string.Empty;
public Guid ParameterSetId { get; set; }
public string ParameterSetName { get; set; } = string.Empty;
public DateTime StartTime { get; set; }
public DateTime? EndTime { get; set; }
public TestStatus Status { get; set; }
public double Duration { get; set; }
public string? Notes { get; set; }
public string? ErrorMessage { get; set; }
public TestMetrics? Metrics { get; set; }
public List SafetyViolations { get; set; } = new();
}
///
/// Request body for delete-batch API
///
public class DeleteBatchRequest
{
public List Ids { get; set; } = new();
}
///
/// Test execution status
///
public enum TestStatus
{
Preparing = 0,
Running = 1,
Paused = 2,
Completed = 3,
Aborted = 4,
Error = 5,
EmergencyStopped = 6
}
///
/// Safety violation during test
///
public class SafetyViolation
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid TestRunId { get; set; }
public DateTime Timestamp { get; set; }
public ViolationType Type { get; set; }
public ViolationSeverity Severity { get; set; }
public double Value { get; set; }
public double Threshold { get; set; }
public string Message { get; set; } = string.Empty;
}
public enum ViolationType
{
CrossTrackError = 1,
HeadingError = 2,
VelocityLimit = 3,
AccelerationLimit = 4,
SustainedTrackingError = 5,
ObstacleProximity = 6
}
public enum ViolationSeverity
{
Info = 0,
Warning = 1,
Critical = 2
}