public MockEmpaticaHandler() { Console.WriteLine("MockEmpaticaHandler"); _devices = new List <EmpaticaDevice> { new EmpaticaDevice("1", "1", "1", "1", "1"), new EmpaticaDevice("2", "2", "2", "2", "2") }; var random = new Random(); _observer = Observable.Interval(TimeSpan.FromSeconds(1)) .ObserveOn(RxApp.MainThreadScheduler) .Where(_ => _isCapturing) .Do(_ => { var time = DateTimeOffset.Now.ToUnixTimeSeconds() - _startedTime; var bvp = new Bvp(2 * (float)random.NextDouble(), time); BvpAction?.Invoke(bvp); var ibi = new Ibi(750 + 100 * (float)random.NextDouble(), time); IbiAction?.Invoke(ibi); var gsr = new Gsr((float)random.NextDouble(), time); GsrAction?.Invoke(gsr); var temperature = new Temperature(35.5f + (float)random.NextDouble(), time); TemperatureAction?.Invoke(temperature); }); }
public override void DidReceiveGSR(float gsr, double timestamp, EmpaticaDeviceManager device) { if (!_isCapturing) { return; } GsrAction?.Invoke(new Gsr(gsr, timestamp - _startedTime)); }
public void DidReceiveGSR(float gsr, double timestamp) { if (!_isCapturing) { return; } GsrAction?.Invoke(new Gsr(gsr, timestamp - _startedTime)); }