public IBFSample GetBandPower(double band) { if (BandPowers.ContainsKey(band.BandPowerKey())) { return(BandPowers[band.BandPowerKey()]); } return(null); }
/// <summary> /// Start band power monitor task /// </summary> public async Task StartBandPowerMonitorAsync() { if (CancelTokenSource == null) { Log?.Invoke(this, new LogEventArgs(Name, this, "StartSignalFiltering", $"You must start the processor first.", LogLevel.ERROR)); return; } await BandPowers.StartMonitorAsync(); }
/// <summary> /// Stop the data processor async task, and all component processor tasks /// </summary> public async Task StopDataProcessorAsync(bool flush = false) { FlushQueue = flush; if (CancelTokenSource != null) { await StopRealTimeSignalProcessingAsync(); await BandPowers.StopMonitorAsync(); CancelTokenSource.Cancel(); await Task.WhenAll(RawDataQueueProcessorTask, DataMonitorTask, PeriodicProcessorTask); CancelTokenSource = null; RawDataQueueProcessorTask = null; PeriodicProcessorTask = null; DataMonitorTask = null; Log?.Invoke(this, new LogEventArgs(Name, this, "StopDataProcessor", $"Stopped Brainflow data processor for {Name}.", LogLevel.INFO)); } }
/// <summary> /// Get current band powers at specified frequency band (in Hz) /// </summary> public IBFSample GetBandPower(double band) { return(BandPowers.GetBandPower(band)); }
/// <summary> /// Set the band power processor ranges /// supply a list of tuples: lowFrequency,highFrequency in each range /// </summary> /// <param name="rangeList"></param> public void SetBandPowerRangeList(List <Tuple <double, double> > rangeList) { BandPowers.SetBandPowerRangeList(rangeList); }
/// <summary> /// Stop band power monitor task /// </summary> public async Task StopBandPowerMonitorAsync() { await BandPowers.StopMonitorAsync(); }