Files
SE-UGW/src/Gateway.Api/Domain/Points.cs
T
jhartworks 98c48d9d78 Add comprehensive smoke and feature tests for Gateway API
- Introduced LtdFeatureTests to validate BACnet and OPC UA point updates, trend logging, and alarm rule functionality.
- Added OpcUaClientTests to ensure proper OPC UA client configuration, point value synchronization, and session management.
- Created OpcUaFeatureTests to test OPC UA server capabilities, including browsing, reading, writing, and subscription notifications.
- Implemented native_bacnet_test.py for isolated BACnet wire testing, covering discovery, read/write operations, and command processing.
- Added ui-theme-tabs.test.cjs to verify theme switching, tab interactions, and protocol form accessibility in the UI.
2026-11-19 16:06:54 +01:00

110 lines
2.4 KiB
C#

using System.Text.Json;
namespace Gateway.Api.Domain;
public enum PointProtocol
{
Bacnet,
OpcUa,
Modbus,
Knx,
Mqtt,
Internal
}
public enum PointScope
{
External,
Gateway,
Internal
}
/// <summary>
/// BACnet object types that the gateway can materialize. Event/Alarm behavior is
/// represented by Event Enrollment plus Notification Class, not by a proprietary alarm object.
/// </summary>
public enum BacnetObjectKind
{
AnalogInput,
AnalogOutput,
AnalogValue,
BinaryInput,
BinaryOutput,
BinaryValue,
MultiStateInput,
MultiStateOutput,
MultiStateValue,
Schedule,
Calendar,
EventEnrollment,
NotificationClass,
TrendLog
}
public sealed record GatewayPoint(
Guid Id,
string DisplayName,
PointProtocol Protocol,
PointScope Scope,
string ValueType,
bool Readable,
bool Writable,
string? ExternalIdentity,
JsonElement Address,
DateTimeOffset CreatedAtUtc,
BacnetObjectKind? BacnetObjectKind = null,
uint? BacnetObjectInstance = null);
public sealed record CreatePointRequest(
string DisplayName,
PointProtocol Protocol,
PointScope Scope,
string ValueType,
bool Readable,
bool Writable,
string? ExternalIdentity,
JsonElement Address,
BacnetObjectKind? BacnetObjectKind = null,
uint? BacnetObjectInstance = null);
public sealed record PointDependencies(int Mappings, int MqttMappings, int Alarms, int TrendLogs)
{
public string Confirmation => $"{Mappings}-{MqttMappings}-{Alarms}-{TrendLogs}";
}
public sealed record PointValue(
Guid PointId,
JsonElement Value,
PointProtocol SourceProtocol,
DateTimeOffset UpdatedAtUtc,
string? Status,
Guid? OriginPointId = null);
public enum MappingDirection
{
OneWay,
Bidirectional
}
public sealed record PointMapping(
Guid Id,
Guid SourcePointId,
Guid TargetPointId,
MappingDirection Direction,
bool Enabled,
int? BacnetPriority,
bool AcknowledgeMultipleExternalWriters,
JsonElement Transform,
DateTimeOffset CreatedAtUtc);
public sealed record CreateMappingRequest(
Guid SourcePointId,
Guid TargetPointId,
MappingDirection Direction,
bool Enabled,
int? BacnetPriority,
bool AcknowledgeMultipleExternalWriters,
JsonElement Transform);
public sealed record CreateMappingResponse(PointMapping Mapping, IReadOnlyList<string> Warnings);