/// <summary>
        /// Event handler
        /// Fired when data has been collected.
        /// </summary>
        private void SampleCollector_DataReady(object sender, ScopeEventArgs e)
        {
            lock (SampleDataLock)
            {
                _scopeData = e.ScopeData;
            }

            // Execute FFT form sollected data. Will call FFTAnalyzer_RenderFFT when ready.
            if (_scopeData != null)
            {
                _fftAnalyzer.ExecuteFftAsync(_scopeData.Voltages, SamplingSettings.Fs, FftAverages, WindowType);
            }
            else
            {
                OnRenderFft(new FFTEventArgs(null)); // Scope data is null so render empty fft
            }
            OnRenderScope(new ScopeEventArgs(_scopeData));
        }
        /// <summary>
        /// Fire DataReady event
        /// </summary>
        /// <param name="e">arguments</param>
        private void OnDataReady(ScopeEventArgs e)
        {
            EventHandler <ScopeEventArgs> handler = DataReady;

            handler?.Invoke(this, e);
        }
        /// <summary>
        /// Fire RenderScope event
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnRenderScope(ScopeEventArgs e)
        {
            EventHandler <ScopeEventArgs> handler = RenderScope;

            handler?.Invoke(this, e);
        }