M3 R3.2: AddHistoricalValuesAsync supports Double + Int (Int2/Int4/UInt4)
Extended the historical-write serializer from Float-only to all five analog types EnsureTagAsync supports. Captured each type's "ON" buffer live from the native client (sandbox tag per type, written + captured + deleted): - The 4-byte value descriptor (C0 10 01 00) is CONSTANT across types — it does not encode the type. - The value is u32(0) + native-width value, width by the tag's declared type: Float->float32, Double->double64, Int2->int16, Int4->int32, UInt4->uint32. HistorianHistoricalWriteProtocol.SerializeAddStreamValuesBuffer now takes the HistorianDataType and encodes accordingly (unsupported types throw ProtocolEvidenceMissingException). The orchestrator resolves the type from the tag-info NativeDataTypeDescriptor via MapDataType. Harness capture-write gained --data-type. Golden-tested against all five live captures + the gated write/read-back test validated each type end-to-end through the pure-managed SDK; 281 unit tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B6mcaT2PjRFKcogzp9UkfC
This commit is contained in:
@@ -189,9 +189,10 @@ public sealed class HistorianGrpcIntegrationTests
|
||||
|
||||
HistorianClient client = new(BuildOptions(host));
|
||||
|
||||
// A backfill sample at a fixed historical second, with a distinctive value.
|
||||
// A backfill sample at a fixed historical second, with a distinctive whole-number value so
|
||||
// it round-trips for any analog tag type (Float/Double/Int2/Int4/UInt4).
|
||||
DateTime stamp = new DateTime(DateTime.UtcNow.Year, 1, 2, 3, 4, 5, DateTimeKind.Utc);
|
||||
const double expected = 222.5;
|
||||
const double expected = 7777;
|
||||
bool wrote = await client.AddHistoricalValuesAsync(
|
||||
sandboxTag!,
|
||||
[new HistorianHistoricalValue(stamp, expected)],
|
||||
|
||||
Reference in New Issue
Block a user