Added timestamping to incoming values and timeout to signal descriptor

Added timestamping to ValueDescriptor to be able to record on a
timebase, timebase uses monotonic_ns() which is a system wide timebase
that can be called by connectors written in a host of languages

Added timeout to signal descriptors, live values now return None when
they are timed out
This commit is contained in:
2026-08-06 11:36:12 +01:00
parent 87c88c3f3d
commit 1690032f5b
5 changed files with 37 additions and 13 deletions
+3 -6
View File
@@ -4,7 +4,7 @@ import threading
from concurrent.futures import CancelledError as FutureCancelledError
from concurrent.futures import TimeoutError as FutureTimeoutError
from statistics import mean
from time import monotonic, perf_counter
from time import monotonic, monotonic_ns, perf_counter
from uuid import UUID, uuid4
from rich.logging import RichHandler
@@ -117,8 +117,7 @@ def value_sender_thread(
next_send_time += period
value = ValueDescriptor(
signal_id=signal_id,
value=2.0,
signal_id=signal_id, value=2.0, timestamp=monotonic_ns()
)
message = ValueBatch(
@@ -216,9 +215,7 @@ async def perform_handshake(
connector_version=CONNECTOR_VERSION.get_version(),
signals=[
SignalDescriptor(
id=signal_id,
name="Dummy signal",
type="number",
id=signal_id, name="Dummy signal", type="number", timeout_ms=5000
)
],
)