Beispiel #1
0
        void eegPlotData_dataAcquired(object sender)
        {
            //if (lfpGraph.InvokeRequired)
            //{
            //    lfpGraph.BeginInvoke(new plotData_dataAcquiredDelegate(lfpPlotData_dataAcquired), sender);
            //}
            //else
            //{
            PlotData pd = (PlotData)sender;

            if (eegGraph.Visible && !checkBox_freeze.Checked)
            {
                float[][] data = pd.read();
                for (int i = 0; i < data.Length; ++i)
                {
                    //lfpGraph.Plots.Item(i + 1).PlotY(data[i], (double)pd.downsample / (double)lfpSamplingRate,
                    //    (double)pd.downsample / (double)lfpSamplingRate);
                    eegGraph.plotY(data[i], 0F, 1F, NRBrainbow, i);
                }
                eegGraph.Invalidate();
            }
            else
            {
                pd.skipRead();
            }
            //}
        }
Beispiel #2
0
        private void spikePlotData_dataAcquired(object sender)
        {
            PlotData pd = (PlotData)sender;

            if (spikeGraph.Visible && !checkBox_freeze.Checked)
            {
                float[][] data          = pd.read();
                float[][] currentThresh = spikeDet.spikeDetector.GetCurrentThresholds();
                float[][] threshdata1   = pd.readthresh(currentThresh[0]);
                float[][] threshdata2   = pd.readthresh(currentThresh[1]);

                for (int i = 0; i < data.Length; ++i)
                {
                    spikeGraph.plotYWithThresh(data[i], threshdata1[i], threshdata2[i],
                                               0, 1, NRBrainbow, pd.numSamplesPerPlot,
                                               Microsoft.Xna.Framework.Color.SlateGray, i);
                }
                spikeGraph.Invalidate();
            }

            else
            {
                pd.skipRead();
            }

            #region Recording_LED
            if (switch_record.Value)
            {
                //Toggle recording light
                if (recordingLEDState++ == 1)
                {
                    if (led_recording.OnColor == Color.DarkGreen)
                    {
                        led_recording.OnColor = Color.Lime;
                    }
                    else
                    {
                        led_recording.OnColor = Color.DarkGreen;
                    }
                }
                recordingLEDState %= 2;
            }
            #endregion
        }
Beispiel #3
0
        void muaPlotData_dataAcquired(object sender)
        {
            PlotData pd = (PlotData)sender;

            if (muaGraph.Visible && !checkBox_freeze.Checked)
            {
                float[][] data = pd.read();
                for (int i = 0; i < data.Length; ++i)
                {
                    //lfpGraph.Plots.Item(i + 1).PlotY(data[i], (double)pd.downsample / (double)lfpSamplingRate,
                    //    (double)pd.downsample / (double)lfpSamplingRate);
                    muaGraph.plotY(data[i], 0F, 1F, NRBrainbow, i);
                }
                muaGraph.Invalidate();
            }
            else
            {
                pd.skipRead();
            }
        }