Users pick which data items each machine monitors. Catalog comes from the protocol probe; selection is opt-in and filters persistence (only selected items are read/kept/saved). Whole solution green, 138 tests + 2 docker integration. Domain: - Machine.MonitoredItemIds (opt-in, empty = monitor nothing); backward-compatible optional ctor param + With override. - DataItemDescriptor (protocol-agnostic catalog entry). - IProtocolDriver.ProbeAsync → full unfiltered item catalog. MTConnect: - MtconnectDriver.ProbeAsync (GET /probe → parser → descriptors). - ReadCurrentAsync filters snapshot items to selected ids (ConnectionState preserved); factory passes selection into driver. Persistence: - machines.MonitoredItemIdsJson column + idempotent ALTER-if-missing migration. - Repository maps selection (System.Text.Json); round-tripped. Core: - IMachineMonitor.ProbeAsync(machine) exposes catalog to the UI via the plugin factory. App: - Config: "Load items" probes the machine, shows a checklist (select all/none), pre-selects existing choices in edit mode, offline fallback, saves selection. - Detail: empty-state hint when a machine has no monitored items. PAUL: v0.3 Phase 3 shipped; Phase 3.1 (theming/UX) next. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
namespace Junction.Domain.Protocols
|
|
{
|
|
/// <summary>
|
|
/// Protocol-agnostic catalog entry describing a single selectable data item a machine exposes.
|
|
/// Returned (unfiltered) by <see cref="IProtocolDriver.ProbeAsync"/> so the config screen can
|
|
/// present the full set of items the user may choose to monitor. Immutable; nulls collapse to "".
|
|
/// </summary>
|
|
public sealed class DataItemDescriptor
|
|
{
|
|
/// <summary>Stable identifier of the data item (e.g. MTConnect dataItemId).</summary>
|
|
public string Id { get; }
|
|
|
|
/// <summary>Human-readable name (may be empty).</summary>
|
|
public string Name { get; }
|
|
|
|
/// <summary>Protocol type (e.g. MTConnect POSITION, EXECUTION, AVAILABILITY).</summary>
|
|
public string Type { get; }
|
|
|
|
/// <summary>Category (e.g. MTConnect SAMPLE, EVENT, CONDITION). Kept as string to stay generic.</summary>
|
|
public string Category { get; }
|
|
|
|
/// <summary>Units (may be empty).</summary>
|
|
public string Units { get; }
|
|
|
|
public DataItemDescriptor(string id, string name, string type, string category, string units)
|
|
{
|
|
Id = id ?? "";
|
|
Name = name ?? "";
|
|
Type = type ?? "";
|
|
Category = category ?? "";
|
|
Units = units ?? "";
|
|
}
|
|
}
|
|
}
|