Document client stack XML docs progress

This commit is contained in:
Joseph Doherty
2026-04-01 08:58:17 -04:00
parent b2be438d33
commit 5c89a44255
27 changed files with 14809 additions and 28 deletions

View File

@@ -58,6 +58,12 @@ public partial class MainWindowViewModel : ObservableObject
[ObservableProperty] private string? _username;
/// <summary>
/// Creates the main shell view model that coordinates connection state, browsing, subscriptions, alarms, history, and persisted settings.
/// </summary>
/// <param name="factory">Creates the shared OPC UA client service used by all panels.</param>
/// <param name="dispatcher">Marshals service callbacks back onto the UI thread.</param>
/// <param name="settingsService">Loads and saves persisted user connection settings.</param>
public MainWindowViewModel(IOpcUaClientServiceFactory factory, IUiDispatcher dispatcher,
ISettingsService? settingsService = null)
{
@@ -71,21 +77,49 @@ public partial class MainWindowViewModel : ObservableObject
/// <summary>All available security modes.</summary>
public IReadOnlyList<SecurityMode> SecurityModes { get; } = Enum.GetValues<SecurityMode>();
/// <summary>
/// Gets a value indicating whether the shell is currently connected to an OPC UA endpoint.
/// </summary>
public bool IsConnected => ConnectionState == ConnectionState.Connected;
/// <summary>The currently selected tree nodes (supports multi-select).</summary>
public ObservableCollection<TreeNodeViewModel> SelectedTreeNodes { get; } = [];
/// <summary>
/// Gets the browse-tree panel view model for the address-space explorer.
/// </summary>
public BrowseTreeViewModel? BrowseTree { get; private set; }
/// <summary>
/// Gets the read/write panel view model for point operations against the selected node.
/// </summary>
public ReadWriteViewModel? ReadWrite { get; private set; }
/// <summary>
/// Gets the subscriptions panel view model for live data monitoring.
/// </summary>
public SubscriptionsViewModel? Subscriptions { get; private set; }
/// <summary>
/// Gets the alarms panel view model for active-condition monitoring and acknowledgment.
/// </summary>
public AlarmsViewModel? Alarms { get; private set; }
/// <summary>
/// Gets the history panel view model for raw and aggregate history queries.
/// </summary>
public HistoryViewModel? History { get; private set; }
/// <summary>
/// Gets the subscriptions tab header, including the current active subscription count when nonzero.
/// </summary>
public string SubscriptionsTabHeader => SubscriptionCount > 0
? $"Subscriptions ({SubscriptionCount})"
: "Subscriptions";
/// <summary>
/// Gets the alarms tab header, including the current active alarm count when nonzero.
/// </summary>
public string AlarmsTabHeader => ActiveAlarmCount > 0
? $"Alarms ({ActiveAlarmCount})"
: "Alarms";
@@ -355,6 +389,9 @@ public partial class MainWindowViewModel : ObservableObject
_savedAlarmSourceNodeId = s.AlarmSourceNodeId;
}
/// <summary>
/// Persists the current connection, subscription, and alarm-monitoring settings for the next UI session.
/// </summary>
public void SaveSettings()
{
_settingsService.Save(new UserSettings
@@ -381,4 +418,4 @@ public partial class MainWindowViewModel : ObservableObject
.Where(u => !string.IsNullOrEmpty(u))
.ToArray();
}
}
}