docs: backfill XML documentation across 756 files
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
This commit is contained in:
@@ -16,11 +16,14 @@ public sealed class ProbeCommand : S7CommandBase
|
||||
[CommandOption("address", 'a', Description =
|
||||
"Probe address (default MW0 — merker word 0). DB1.DBW0 if your PLC project " +
|
||||
"reserves a fingerprint DB.")]
|
||||
/// <summary>Gets or sets the S7 address to probe.</summary>
|
||||
public string Address { get; init; } = "MW0";
|
||||
|
||||
[CommandOption("type", Description = "Probe data type (default Int16).")]
|
||||
/// <summary>Gets or sets the data type of the probe address.</summary>
|
||||
public S7DataType DataType { get; init; } = S7DataType.Int16;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
ConfigureLogging();
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.S7.Cli.Commands;
|
||||
[Command("read", Description = "Read a single S7 address.")]
|
||||
public sealed class ReadCommand : S7CommandBase
|
||||
{
|
||||
/// <summary>Gets the S7 address to read.</summary>
|
||||
[CommandOption("address", 'a', Description =
|
||||
"S7 address. Examples: DB1.DBW0 (DB1, word 0); M0.0 (merker bit); IW4 (input word 4); " +
|
||||
"QD8 (output dword 8); DB2.DBD20 (DB2, dword 20); DB5.DBX4.3 (DB5, byte 4, bit 3); " +
|
||||
@@ -22,15 +23,18 @@ public sealed class ReadCommand : S7CommandBase
|
||||
// Driver.S7.Cli-002: help text trimmed to the types the driver actually implements.
|
||||
// Int64 / UInt64 / Float64 / String / DateTime are defined in S7DataType but the driver
|
||||
// raises NotSupportedException (→ BadNotSupported) on reads of those types.
|
||||
/// <summary>Gets the data type to interpret the address as.</summary>
|
||||
[CommandOption("type", 't', Description =
|
||||
"Bool / Byte / Int16 / UInt16 / Int32 / UInt32 / Float32 (default Int16). " +
|
||||
"Int64, UInt64, Float64, String, and DateTime are not yet implemented and will return BadNotSupported.")]
|
||||
public S7DataType DataType { get; init; } = S7DataType.Int16;
|
||||
|
||||
/// <summary>Gets the maximum string length for string-type reads.</summary>
|
||||
[CommandOption("string-length", Description =
|
||||
"For type=String: S7-string max length (default 254, S7 max).")]
|
||||
public int StringLength { get; init; } = 254;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
ConfigureLogging();
|
||||
@@ -55,6 +59,8 @@ public sealed class ReadCommand : S7CommandBase
|
||||
}
|
||||
|
||||
/// <summary>Tag-name key used internally. Address + type is already unique.</summary>
|
||||
/// <param name="address">The S7 address to encode in the tag name.</param>
|
||||
/// <param name="type">The data type to encode in the tag name.</param>
|
||||
internal static string SynthesiseTagName(string address, S7DataType type)
|
||||
=> $"{address}:{type}";
|
||||
}
|
||||
|
||||
@@ -12,18 +12,22 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.S7.Cli.Commands;
|
||||
[Command("subscribe", Description = "Watch an S7 address via polled subscription until Ctrl+C.")]
|
||||
public sealed class SubscribeCommand : S7CommandBase
|
||||
{
|
||||
/// <summary>Gets the S7 address to subscribe to.</summary>
|
||||
[CommandOption("address", 'a', Description = "S7 address — same format as `read`.", IsRequired = true)]
|
||||
public string Address { get; init; } = default!;
|
||||
|
||||
/// <summary>Gets the data type of the address.</summary>
|
||||
// Driver.S7.Cli-002: help text trimmed to the types the driver actually implements.
|
||||
[CommandOption("type", 't', Description =
|
||||
"Bool / Byte / Int16 / UInt16 / Int32 / UInt32 / Float32 (default Int16). " +
|
||||
"Int64, UInt64, Float64, String, and DateTime are not yet implemented and will return BadNotSupported.")]
|
||||
public S7DataType DataType { get; init; } = S7DataType.Int16;
|
||||
|
||||
/// <summary>Gets the polling interval in milliseconds.</summary>
|
||||
[CommandOption("interval-ms", 'i', Description = "Publishing interval ms (default 1000).")]
|
||||
public int IntervalMs { get; init; } = 1000;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
ConfigureLogging();
|
||||
|
||||
@@ -14,10 +14,12 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.S7.Cli.Commands;
|
||||
[Command("write", Description = "Write a single S7 address.")]
|
||||
public sealed class WriteCommand : S7CommandBase
|
||||
{
|
||||
/// <summary>Gets or sets the S7 address to write to.</summary>
|
||||
[CommandOption("address", 'a', Description =
|
||||
"S7 address — same format as `read`.", IsRequired = true)]
|
||||
public string Address { get; init; } = default!;
|
||||
|
||||
/// <summary>Gets or sets the data type of the value to write.</summary>
|
||||
// Driver.S7.Cli-002: help text trimmed to the types the driver actually implements.
|
||||
// Int64 / UInt64 / Float64 / String / DateTime are defined in S7DataType but the driver
|
||||
// raises NotSupportedException (→ BadNotSupported) on any read/write of those types;
|
||||
@@ -27,15 +29,18 @@ public sealed class WriteCommand : S7CommandBase
|
||||
"Int64, UInt64, Float64, String, and DateTime are not yet implemented and will return BadNotSupported.")]
|
||||
public S7DataType DataType { get; init; } = S7DataType.Int16;
|
||||
|
||||
/// <summary>Gets or sets the value to write.</summary>
|
||||
[CommandOption("value", 'v', Description =
|
||||
"Value to write. Parsed per --type (booleans accept true/false/1/0).",
|
||||
IsRequired = true)]
|
||||
public string Value { get; init; } = default!;
|
||||
|
||||
/// <summary>Gets or sets the maximum length for string values.</summary>
|
||||
[CommandOption("string-length", Description =
|
||||
"For type=String: S7-string max length (default 254).")]
|
||||
public int StringLength { get; init; } = 254;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
ConfigureLogging();
|
||||
@@ -68,6 +73,9 @@ public sealed class WriteCommand : S7CommandBase
|
||||
/// surfaces as a clean <see cref="CliFx.Exceptions.CommandException"/> rather than a
|
||||
/// raw .NET stack trace — matching the friendly message the Bool path already produces.
|
||||
/// </remarks>
|
||||
/// <param name="raw">The raw string value to parse.</param>
|
||||
/// <param name="type">The target data type for parsing.</param>
|
||||
/// <returns>The parsed value as an object.</returns>
|
||||
internal static object ParseValue(string raw, S7DataType type)
|
||||
{
|
||||
if (type == S7DataType.Bool) return ParseBool(raw);
|
||||
|
||||
@@ -12,24 +12,30 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.S7.Cli;
|
||||
/// </summary>
|
||||
public abstract class S7CommandBase : DriverCommandBase
|
||||
{
|
||||
/// <summary>Gets the PLC IP address or hostname.</summary>
|
||||
[CommandOption("host", 'h', Description = "PLC IP address or hostname.", IsRequired = true)]
|
||||
public string Host { get; init; } = default!;
|
||||
|
||||
/// <summary>Gets the ISO-on-TCP port.</summary>
|
||||
[CommandOption("port", 'p', Description = "ISO-on-TCP port (default 102).")]
|
||||
public int Port { get; init; } = 102;
|
||||
|
||||
/// <summary>Gets the S7 CPU family type.</summary>
|
||||
[CommandOption("cpu", 'c', Description =
|
||||
"S7 CPU family: S7200 / S7200Smart / S7300 / S7400 / S71200 / S71500 " +
|
||||
"(default S71500). Determines the ISO-TSAP slot byte.")]
|
||||
public S7NetCpuType CpuType { get; init; } = S7NetCpuType.S71500;
|
||||
|
||||
/// <summary>Gets the rack number.</summary>
|
||||
[CommandOption("rack", Description = "Rack number (default 0 — single-rack).")]
|
||||
public short Rack { get; init; } = 0;
|
||||
|
||||
/// <summary>Gets the CPU slot number.</summary>
|
||||
[CommandOption("slot", Description =
|
||||
"CPU slot. S7-300 = 2, S7-400 = 2 or 3, S7-1200 / S7-1500 = 0 (default 0).")]
|
||||
public short Slot { get; init; } = 0;
|
||||
|
||||
/// <summary>Gets the per-operation timeout in milliseconds.</summary>
|
||||
[CommandOption("timeout-ms", Description = "Per-operation timeout in ms (default 5000).")]
|
||||
public int TimeoutMs { get; init; } = 5000;
|
||||
|
||||
@@ -45,6 +51,7 @@ public abstract class S7CommandBase : DriverCommandBase
|
||||
/// collected + whatever <paramref name="tags"/> the subclass declares. Probe
|
||||
/// disabled — CLI runs are one-shot.
|
||||
/// </summary>
|
||||
/// <param name="tags">The tag definitions to include in the options.</param>
|
||||
protected S7DriverOptions BuildOptions(IReadOnlyList<S7TagDefinition> tags) => new()
|
||||
{
|
||||
Host = Host,
|
||||
@@ -57,5 +64,6 @@ public abstract class S7CommandBase : DriverCommandBase
|
||||
Probe = new S7ProbeOptions { Enabled = false },
|
||||
};
|
||||
|
||||
/// <summary>Gets the driver instance ID for this CLI session.</summary>
|
||||
protected string DriverInstanceId => $"s7-cli-{Host}:{Port}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user