From bb34bd1372d5292e5f7149dbeb450068b3ba8c6f Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 16 Oct 2023 22:16:29 +0100 Subject: [PATCH 1/2] Add operators for monitoring device synch status --- src/Aeon.Acquisition/Aeon.Acquisition.csproj | 2 +- src/Aeon.Acquisition/HeartbeatMonitor.bonsai | 75 +++++++++ .../SynchronizerMonitor.bonsai | 145 ++++++++++++++++++ 3 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 src/Aeon.Acquisition/HeartbeatMonitor.bonsai create mode 100644 src/Aeon.Acquisition/SynchronizerMonitor.bonsai diff --git a/src/Aeon.Acquisition/Aeon.Acquisition.csproj b/src/Aeon.Acquisition/Aeon.Acquisition.csproj index 782ab54..ff30574 100644 --- a/src/Aeon.Acquisition/Aeon.Acquisition.csproj +++ b/src/Aeon.Acquisition/Aeon.Acquisition.csproj @@ -6,7 +6,7 @@ Bonsai Rx Project Aeon Acquisition net472 0.5.0 - build231007 + build231008 diff --git a/src/Aeon.Acquisition/HeartbeatMonitor.bonsai b/src/Aeon.Acquisition/HeartbeatMonitor.bonsai new file mode 100644 index 0000000..3d9bcce --- /dev/null +++ b/src/Aeon.Acquisition/HeartbeatMonitor.bonsai @@ -0,0 +1,75 @@ + + + Captures the sequence of heartbeats from the specified source as a named group. + + + + + + + + + + + + + + DeviceEvents + + + + + + + + + Source1 + + + + + + Name + DeviceEvents + + + + + + Item2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Aeon.Acquisition/SynchronizerMonitor.bonsai b/src/Aeon.Acquisition/SynchronizerMonitor.bonsai new file mode 100644 index 0000000..f7db6fe --- /dev/null +++ b/src/Aeon.Acquisition/SynchronizerMonitor.bonsai @@ -0,0 +1,145 @@ + + + Provides continuous statistics and reports current time and device synchronization state. + + + + Source1 + + + + + + HeartbeatSources + + + + + + + + + + PT0.2S + + + + SynchronizerEvents + + + Include + + + + + + PT0.4S + + + + UnwrapTimestamps + + + + Source1 + + + + + + Seconds + + + + + + {0}@{1} + Value,Seconds + + + + + + + + + + + + + + + + + + + + + + + Item1 + + + + + + Item2 + + + + + + new( +Item1 as Stats, +Item2 as Names) + + + HeartbeatSources + + + Length + + + + + + new( +Item1.Stats.Mean as MeanRawTimestamp, +DateTime(1904, 1, 1) + TimeSpan.FromSeconds(Item1.Stats.Mean) as MeanTimestamp, +Item2 as ExpectedDeviceCount, +Item1.Stats.Count as DeviceCount, +Item1.Stats.Maximum - Item1.Stats.Minimum as MaxDifference, +string.Join("\t", Item1.Names) as Elements) + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 72c4de2568fef888e5ea50752d2424068ae7de84 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 16 Oct 2023 22:22:32 +0100 Subject: [PATCH 2/2] Rename monitor data fields --- src/Aeon.Acquisition/SynchronizerMonitor.bonsai | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Aeon.Acquisition/SynchronizerMonitor.bonsai b/src/Aeon.Acquisition/SynchronizerMonitor.bonsai index f7db6fe..c6ad44b 100644 --- a/src/Aeon.Acquisition/SynchronizerMonitor.bonsai +++ b/src/Aeon.Acquisition/SynchronizerMonitor.bonsai @@ -110,8 +110,8 @@ Item2 as Names) new( -Item1.Stats.Mean as MeanRawTimestamp, -DateTime(1904, 1, 1) + TimeSpan.FromSeconds(Item1.Stats.Mean) as MeanTimestamp, +Item1.Stats.Mean as MeanTimestamp, +DateTime(1904, 1, 1) + TimeSpan.FromSeconds(Item1.Stats.Mean) as MeanUtcTimestamp, Item2 as ExpectedDeviceCount, Item1.Stats.Count as DeviceCount, Item1.Stats.Maximum - Item1.Stats.Minimum as MaxDifference,