Example #1
0
        int userID = -1;  // userID is used to uniquely identify a user's headset

        public Form1()
        {
            InitializeComponent();

            buttonStart.Enabled = false;

            labelMovement.Text = "netral";

            channelStringToInt = new Dictionary <string, int>();
            for (int i = 0; i < channelsEeg.Length; i++)
            {
                channelStringToInt.Add(channelsEeg[i], i);
            }

            fft = new FFTSignalTransform();
            dsp = new BasicSignalProcessor();

            ms = new ModelStorage();
            LoadModelData();

            timer.Enabled       = false;
            timerEmotiv.Enabled = false;
            counter             = 1;

            chartEeg.Series.Clear();
            chartEeg.ChartAreas.Add("all");
            totalChannels = channelsEeg.Count();

            chartEeg.ChartAreas[0].AxisX.LabelStyle.Enabled        = false;
            chartDeltaTheta.ChartAreas[0].AxisX.LabelStyle.Enabled = false;
            chartAlpha.ChartAreas[0].AxisX.LabelStyle.Enabled      = false;
            chartBeta.ChartAreas[0].AxisX.LabelStyle.Enabled       = false;
            chartGamma.ChartAreas[0].AxisX.LabelStyle.Enabled      = false;

            chartEeg.ChartAreas[0].AxisX.MajorGrid.LineWidth        = 0;
            chartDeltaTheta.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
            chartAlpha.ChartAreas[0].AxisX.MajorGrid.LineWidth      = 0;
            chartBeta.ChartAreas[0].AxisX.MajorGrid.LineWidth       = 0;
            chartGamma.ChartAreas[0].AxisX.MajorGrid.LineWidth      = 0;

            //chartEeg.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
            chartDeltaTheta.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
            chartAlpha.ChartAreas[0].AxisY.MajorGrid.LineWidth      = 0;
            chartBeta.ChartAreas[0].AxisY.MajorGrid.LineWidth       = 0;
            chartGamma.ChartAreas[0].AxisY.MajorGrid.LineWidth      = 0;

            for (int i = 0; i < totalChannels; i++)
            {
                //chartEeg.ChartAreas[0].AxisY.Maximum = 200;
                //chartEeg.ChartAreas[0].AxisY.Minimum = -200;

                chartEeg.Series.Add(channelsEeg[i]);
                chartEeg.Series[channelsEeg[i]].ChartType         = SeriesChartType.FastLine;
                chartEeg.Series[channelsEeg[i]].IsVisibleInLegend = true;
            }

            EEG_Starter();
        }
Example #2
0
        public FormCreateModel(Form1 f)
        {
            InitializeComponent();

            mainForm = f;

            ms = new ModelStorage();

            timerProgress.Enabled = false;

            model = new Model();
            fft   = new FFTSignalTransform();
            dsp   = new BasicSignalProcessor();

            phase = 1;

            groupBoxClass.Enabled       = false;
            buttonPhase2.Enabled        = false;
            groupBoxLoadDataSet.Enabled = false;
            buttonTrain.Enabled         = false;

            channelsIndex = new Dictionary <string, int>();
            for (int i = 0; i < channelsEeg.Count(); i++)
            {
                channelsIndex.Add(channelsEeg[i], i);
            }

            allData           = new List <List <double[]> >();
            classesIndex      = new Dictionary <string, int>();
            classesDataLoaded = new Dictionary <string, bool>();
            for (int i = 0; i < classesCommand.Count(); i++)
            {
                classesIndex.Add(classesCommand[i], i);
                classesDataLoaded.Add(classesCommand[i], false);
                allData.Add(null);
            }

            textBoxClasses = new Dictionary <string, TextBox>();
            textBoxClasses.Add("netral", textBoxNetral);
            textBoxClasses.Add("maju", textBoxMaju);
            textBoxClasses.Add("mundur", textBoxMundur);
            textBoxClasses.Add("kanan", textBoxKanan);
            textBoxClasses.Add("kiri", textBoxKiri);
        }