Esempio n. 1
0
        public async void UpdateContent(double maxFreq, double minFreq,
                                        IList <double> channelData, IList <double> spectrum, IList <double> freqs, double avgSpectrum, CoreDispatcher uiDisp)
        {
            Debug.WriteLine("Updating RT charts conent");
            await uiDisp.RunAsync(CoreDispatcherPriority.Normal, () => {
                MaxFreqText       = $"Max inst frequency = {maxFreq}";
                MinFreqText       = $"Min inst frequency = {minFreq}";
                AvgSpectrumText   = $"Avg Hilbert spectrum = {avgSpectrum}";
                EnsembleCountText = $"Ensemble count = {DataManager.Current.EnsembleCount}";

                //AppendDataSeries(MaxFreqValues, maxFreq);
                //AppendDataSeries(MinFreqValues, minFreq);
                AppendDataSeries(AvgSpectrumValues, avgSpectrum);

                ChannelData.Clear();
                for (int i = 0; i < channelData.Count; ++i)
                {
                    ChannelData.Add(new Point(i, channelData[i]));
                }
                ChannelData.NotifyCollectionReset();

                SpectrumValues.Clear();
                for (int i = 0; i < spectrum.Count; ++i)
                {
                    SpectrumValues.Add(new Point(freqs[i], spectrum[i]));
                }
                SpectrumValues.NotifyCollectionReset();
            });
        }