feat(client-cli): add ack/confirm/shelve alarm commands with service layer
Adds ConfirmAlarmAsync and ShelveAlarmAsync to IOpcUaClientService and OpcUaClientService (mirroring the AcknowledgeAlarmAsync pattern: same CallMethodAsync/ServiceResultException/StatusCode contract). Adds ShelveKind enum (OneShot/Timed/Unshelve). Adds three new CLI commands — ack, confirm, shelve — with hex EventId input and per-command argument validation. Updates both fakes (CLI + UI) to implement the new interface members and record calls. Adds 16 unit tests covering argument mapping, invalid-input CommandException paths, bad-status output, and disconnect-in-finally.
This commit is contained in:
@@ -263,6 +263,26 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
|
||||
return Task.FromResult(AcknowledgeResult);
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the status code returned by confirmation operations in UI tests.</summary>
|
||||
public StatusCode ConfirmResult { get; set; } = StatusCodes.Good;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<StatusCode> ConfirmAlarmAsync(string conditionNodeId, byte[] eventId, string comment,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
return Task.FromResult(ConfirmResult);
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the status code returned by shelve operations in UI tests.</summary>
|
||||
public StatusCode ShelveResult { get; set; } = StatusCodes.Good;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<StatusCode> ShelveAlarmAsync(string conditionNodeId, ShelveKind kind, double shelvingTimeSeconds = 0,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
return Task.FromResult(ShelveResult);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadRawAsync(NodeId nodeId, DateTime startTime, DateTime endTime,
|
||||
int maxValues = 1000, CancellationToken ct = default)
|
||||
|
||||
Reference in New Issue
Block a user