826312befe
Clears CommentChecker findings in src/ (3,280 -> 209, the remainder being false positives like PLC-5/IEEE-754/M0.0) by adding missing summaries/params/returns, normalising inheritdoc usage, and removing Gitea/review tracking IDs while keeping the rationale they annotated. Comment-only: comment-stripped sources are identical to the parent commit.
36 lines
1.8 KiB
C#
36 lines
1.8 KiB
C#
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Forms;
|
|
|
|
/// <summary>
|
|
/// The rule deciding which primary-host advisory <c>MqttDriverForm</c> shows when
|
|
/// <c>Act as Primary Host</c> is on.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// <b>A plain static rather than markup logic, because this repo has no bUnit.</b> A condition
|
|
/// written inline in a <c>.razor</c> file is unreachable from any test, and the failure mode
|
|
/// here is specific: an operator who ticks the box with a blank host id must see a
|
|
/// <i>refusal</i>, not the ordinary "here is what will happen" note. Getting that backwards
|
|
/// tells them a claim is being made when the driver is in fact declining to make one.
|
|
/// </para>
|
|
/// <para>
|
|
/// Deliberately mirrors <c>SparkplugPrimaryHost.DescribeUnusable</c>'s blank-host-id arm. The
|
|
/// mode arm is not duplicated: this panel only renders inside the SparkplugB branch of the
|
|
/// form, so mode cannot be wrong here.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static class SparkplugPrimaryHostAdvice
|
|
{
|
|
/// <summary>
|
|
/// Describes why a primary-host claim cannot be made for <paramref name="hostId"/>, or
|
|
/// <see langword="null"/> when it can.
|
|
/// </summary>
|
|
/// <param name="hostId">The Sparkplug host id as typed into the form.</param>
|
|
/// <returns>An operator-facing reason, or <see langword="null"/>.</returns>
|
|
public static string? DescribeBlockingProblem(string? hostId) =>
|
|
string.IsNullOrWhiteSpace(hostId)
|
|
? "A Sparkplug host claim is published on spBv1.0/STATE/{hostId}, so it needs a Host ID. "
|
|
+ "Set one above, or turn this off — the driver will otherwise log a warning at startup "
|
|
+ "and publish nothing."
|
|
: null;
|
|
}
|