Auto: twincat-4.1 — nested UDT browse via online type walker

Closes #315
This commit is contained in:
Joseph Doherty
2026-04-26 07:28:52 -04:00
parent da6e19d07d
commit 0444cb699d
15 changed files with 1067 additions and 19 deletions

View File

@@ -361,9 +361,18 @@ internal class FakeTwinCATClient : ITwinCATClient
public List<TwinCATDiscoveredSymbol> BrowseResults { get; } = new();
public bool ThrowOnBrowse { get; set; }
/// <summary>
/// PR 4.1 / #315 — captures the most recent <c>maxArrayExpansion</c> the driver passed
/// so tests can assert the option threaded through. Defaults to <c>-1</c> until the
/// first browse call; <c>0</c> would be a meaningful (degenerate) caller value.
/// </summary>
public int LastBrowseMaxArrayExpansion { get; private set; } = -1;
public virtual async IAsyncEnumerable<TwinCATDiscoveredSymbol> BrowseSymbolsAsync(
int maxArrayExpansion,
[EnumeratorCancellation] CancellationToken cancellationToken)
{
LastBrowseMaxArrayExpansion = maxArrayExpansion;
if (ThrowOnBrowse) throw Exception ?? new InvalidOperationException("fake browse failure");
await Task.CompletedTask;
foreach (var sym in BrowseResults)