Refine XML docs for historian, OPC UA, and tests

This commit is contained in:
Joseph Doherty
2026-03-26 15:33:14 -04:00
parent 3c326e2d45
commit ce0b291664
14 changed files with 215 additions and 3 deletions

View File

@@ -9,18 +9,34 @@ namespace OpcUaCli.Commands;
[Command("alarms", Description = "Subscribe to alarm events on a node")]
public class AlarmsCommand : ICommand
{
/// <summary>
/// Gets the OPC UA endpoint URL for the server whose alarm stream should be monitored.
/// </summary>
[CommandOption("url", 'u', Description = "OPC UA server endpoint URL", IsRequired = true)]
public string Url { get; init; } = default!;
/// <summary>
/// Gets the node to subscribe to for event notifications, typically a source object or the server node.
/// </summary>
[CommandOption("node", 'n', Description = "Node ID to monitor for events (default: Server node)")]
public string? NodeId { get; init; }
/// <summary>
/// Gets the requested publishing and sampling interval for the alarm subscription.
/// </summary>
[CommandOption("interval", 'i', Description = "Publishing interval in milliseconds")]
public int Interval { get; init; } = 1000;
/// <summary>
/// Gets a value indicating whether the command should request a retained-condition refresh after subscribing.
/// </summary>
[CommandOption("refresh", Description = "Request a ConditionRefresh after subscribing")]
public bool Refresh { get; init; }
/// <summary>
/// Connects to the target server and streams alarm or condition events to the operator console.
/// </summary>
/// <param name="console">The CLI console used for cancellation and alarm-event output.</param>
public async ValueTask ExecuteAsync(IConsole console)
{
using var session = await OpcUaHelper.ConnectAsync(Url);

View File

@@ -9,27 +9,52 @@ namespace OpcUaCli.Commands;
[Command("historyread", Description = "Read historical data from a node")]
public class HistoryReadCommand : ICommand
{
/// <summary>
/// Gets the OPC UA endpoint URL for the server that exposes the historized node.
/// </summary>
[CommandOption("url", 'u', Description = "OPC UA server endpoint URL", IsRequired = true)]
public string Url { get; init; } = default!;
/// <summary>
/// Gets the node identifier for the historized variable to query.
/// </summary>
[CommandOption("node", 'n', Description = "Node ID (e.g. ns=1;s=TestMachine_001.TestHistoryValue)", IsRequired = true)]
public string NodeId { get; init; } = default!;
/// <summary>
/// Gets the requested history start time string supplied by the operator.
/// </summary>
[CommandOption("start", Description = "Start time (ISO 8601 or date string, default: 24 hours ago)")]
public string? StartTime { get; init; }
/// <summary>
/// Gets the requested history end time string supplied by the operator.
/// </summary>
[CommandOption("end", Description = "End time (ISO 8601 or date string, default: now)")]
public string? EndTime { get; init; }
/// <summary>
/// Gets the maximum number of raw history values that should be returned to the console.
/// </summary>
[CommandOption("max", Description = "Maximum number of values to return")]
public int MaxValues { get; init; } = 1000;
/// <summary>
/// Gets the optional aggregate name to request when the operator wants processed history instead of raw values.
/// </summary>
[CommandOption("aggregate", Description = "Aggregate function: Average, Minimum, Maximum, Count")]
public string? Aggregate { get; init; }
/// <summary>
/// Gets the aggregate processing interval, in milliseconds, for processed history reads.
/// </summary>
[CommandOption("interval", Description = "Processing interval in milliseconds for aggregates")]
public double IntervalMs { get; init; } = 3600000;
/// <summary>
/// Connects to the target server and prints raw or aggregate historical data for the requested node.
/// </summary>
/// <param name="console">The CLI console used for output, errors, and cancellation handling.</param>
public async ValueTask ExecuteAsync(IConsole console)
{
using var session = await OpcUaHelper.ConnectAsync(Url);