IFatigueTestConfigService.cs
1.73 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
namespace Rcs.Application.Services;
/// <summary>
/// Fatigue test config service
/// </summary>
public interface IFatigueTestConfigService
{
Task<List<FatigueTestConfig>> GetConfigsAsync(CancellationToken cancellationToken = default);
Task<FatigueTestConfig?> GetConfigByIdAsync(string configId, CancellationToken cancellationToken = default);
Task<FatigueTestConfig?> UpsertConfigAsync(FatigueTestConfig config, CancellationToken cancellationToken = default);
Task<bool> DeleteConfigAsync(string configId, CancellationToken cancellationToken = default);
Task<bool> StartAsync(string configId, CancellationToken cancellationToken = default);
Task<bool> StopAsync(string configId, CancellationToken cancellationToken = default);
Task<List<FatigueTestStatus>> GetStatusesAsync(CancellationToken cancellationToken = default);
}
/// <summary>
/// Fatigue test config
/// </summary>
public class FatigueTestConfig
{
public string ConfigId { get; set; } = string.Empty;
public string MapId { get; set; } = string.Empty;
public List<string> RobotIds { get; set; } = new();
public List<string> LocationIds { get; set; } = new();
public bool IsRunning { get; set; }
public int TaskIntervalMs { get; set; } = 1000;
public DateTime CreatedAt { get; set; } = DateTime.Now;
public DateTime UpdatedAt { get; set; } = DateTime.Now;
}
/// <summary>
/// Fatigue test status
/// </summary>
public class FatigueTestStatus
{
public string ConfigId { get; set; } = string.Empty;
public string MapId { get; set; } = string.Empty;
public bool IsRunning { get; set; }
public int RobotCount { get; set; }
public int LocationCount { get; set; }
public int TaskIntervalMs { get; set; }
}