// ------------------------------------------------------------------------------------------------------
        public EEGChannels(uint buffersize)
        {
            alpha1 = new EEGChannelBuffer("AlphaL", buffersize);
            alpha2 = new EEGChannelBuffer("AlphaH", buffersize);
            beta1 = new EEGChannelBuffer("BetaL", buffersize);
            beta2 = new EEGChannelBuffer("BetaH", buffersize);
            delta = new EEGChannelBuffer("Delta", buffersize);
            gamma1 = new EEGChannelBuffer("GammaL", buffersize);
            gamma2 = new EEGChannelBuffer("GammaH", buffersize);
            theta = new EEGChannelBuffer("Theta", buffersize);
            meditation = new EEGChannelBuffer("Meditation", buffersize);
            attention = new EEGChannelBuffer("Attention", buffersize);

            alpha1.Enabled = true;
            alpha2.Enabled = true;
            beta1.Enabled = true;
            beta2.Enabled = true;
            gamma1.Enabled = true;
            gamma2.Enabled = true;
            delta.Enabled = true;
            theta.Enabled = true;
            meditation.Enabled = true;
            attention.Enabled = true;
        }
 public ChannelGraph(DataSource ds, EEGChannelBuffer bf)
 {
     EEGChannelBuffer = bf;
     dataSource = ds;
 }
 // ------------------------------------------------------------------------------------------------------
 private void _updateDataSource(DataSource ds, EEGChannelBuffer buf)
 {
     cPoint[] dest = ds.Samples;
     for (uint i = 0; i < buf.BufferSize; i++)
     {
         EEGChannelBuffer.sample s = buf.getSample(i);
         dest[i].x = s.time;
         dest[i].y = s.value;
     }
 }
        // ------------------------------------------------------------------------------------------------------
        private void _addChannelGraph(EEGChannelBuffer buf)
        {
            DataSource ds = new DataSource();
            display.DataSources.Add(ds);
            ds.OnRenderXAxisLabel += _onRenderXLabel;
            ds.OnRenderYAxisLabel = _onRenderYLabel;
            ds.Name = buf.Name;
            ds.Length = (int)buf.Length;
            ds.XAutoScaleOffset = 0;

            ds.AutoScaleX = true;
            ds.AutoScaleY = false;

            ds.SetDisplayRangeY(-300, 300);
            ds.SetGridDistanceY(100);

            channelGraphs.Add(new ChannelGraph(ds, buf));
        }
 public ChannelConfiguration(EEGChannelBuffer buf, bool updateYR, float ymin, float ymax)
 {
     autoUpdateYRange = updateYR;
     yMin = ymin;
     yMax = ymax;
     buffer = buf;
 }
            // ------------------------------------------------------------------------------------------------------
            public ChannelWrapper(EEGChannelBuffer org)
            {
                uint buffersize = org.BufferSize;
                original = org;
                data = new EEGChannelBuffer("Actual", buffersize);
                average5 = new EEGChannelBuffer("Avg5", buffersize);
                average15 = new EEGChannelBuffer("Avg15", buffersize);
                average30 = new EEGChannelBuffer("Avg30", buffersize);
                average60 = new EEGChannelBuffer("Avg60", buffersize);

                data.Enabled = true;
                average5.Enabled = true;
                average15.Enabled = true;
                average30.Enabled = true;
                average60.Enabled = true;
            }