Rigbox icon indicating copy to clipboard operation
Rigbox copied to clipboard

Logging UDPs when Timeline is running on expServer

Open k1o0 opened this issue 4 years ago • 0 comments

UDPs sent events may be logged in Timeline by your services:

In prepareExp, if your srv.Service object has a Timeline property, it is assigned a handle to srv.expServer's hw.Timeline instance.
https://github.com/cortex-lab/Rigbox/blob/cd888f0ae2653ac78651243b22d566ab67a6fb60/%2Bsrv/prepareExp.m#L17-L31

When the services are started (a callback of the experimentInit event) or stopped (a callback of the experimentCleanup event), the start and stop methods of your service object may log the event with using Timeline's record method.

What service subclasses are people using (e.g. srv.PrimitiveUDPService)? It's here that you need to add the logic for recording the UDP events. See the code for srv.RemoteMPEPService:

https://github.com/cortex-lab/Rigbox/blob/cd888f0ae2653ac78651243b22d566ab67a6fb60/cortexlab/%2Bsrv/RemoteMPEPService.m#L222-L234

Note that the block file contains the timestamps for the experiment events, which will be in Timeline time if it's running for that experiment. These timestamps will tell you when the tart and stop methods were called, which should be just before the UDPs are sent.

k1o0 avatar May 05 '20 16:05 k1o0