Skip to content

Commit

Permalink
Merge pull request #193 from SainsburyWellcomeCentre/datetime-conversion
Browse files Browse the repository at this point in the history
Add overload to convert raw timestamp to DateTime
  • Loading branch information
glopesdev authored Dec 7, 2023
2 parents 81cb2aa + 9192657 commit 255a2d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Aeon.Acquisition/Aeon.Acquisition.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageTags>Bonsai Rx Project Aeon Acquisition</PackageTags>
<TargetFramework>net472</TargetFramework>
<VersionPrefix>0.5.0</VersionPrefix>
<VersionSuffix>build231201</VersionSuffix>
<VersionSuffix>build231202</VersionSuffix>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,7 +20,7 @@
<PackageReference Include="Harp.Behavior" Version="0.1.0" />
<PackageReference Include="Harp.CameraControllerGen2" Version="0.1.0" />
<PackageReference Include="Harp.ClockSynchronizer" Version="0.1.0" />
<PackageReference Include="Harp.OutputExpander" Version="0.2.0-build231203" />
<PackageReference Include="Harp.OutputExpander" Version="0.2.0-build231204" />
<PackageReference Include="Harp.TimestampGeneratorGen3" Version="0.1.0" />
<PackageReference Include="Bonsai.Osc" Version="2.7.0" />
<PackageReference Include="Bonsai.Pylon" Version="0.3.0" />
Expand Down
5 changes: 5 additions & 0 deletions src/Aeon.Acquisition/GetDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ static DateTime FromSeconds(double seconds)
return GroupByTime.ReferenceTime.AddSeconds(seconds);
}

public static IObservable<DateTime> Process(IObservable<double> source)
{
return source.Select(FromSeconds);
}

public IObservable<DateTime> Process(IObservable<HarpMessage> source)
{
return source.Select(message => FromSeconds(message.GetTimestamp()));
Expand Down

0 comments on commit 255a2d0

Please sign in to comment.