Exemplo n.º 1
0
 void frv_FieldTripChanged(object sender, FieldTripChangeEventArgs e)
 {
     double[] values = e.Channels;
     if (dsp != null)
     {
         dsp.DoWork(ref values);
     }
     Values(values);
 }
Exemplo n.º 2
0
        void er_Values(double[] rawData)
        {
            //1. Filter signal
            if (dsp != null)
            {
                dsp.DoWork(ref rawData);
            }

            //2. Generate feature vector
            double[] featureVectors = rawData;

            if (Values != null)
            {
                Values(featureVectors);
            }
        }
Exemplo n.º 3
0
        public void Update()
        {
            if (file == null)
            {
                return;
            }

            double[] result = new double[14];

            string line = file.ReadLine();

            if (line != null)
            {
                string[] columns = line.Split(',');

                for (int i = 0; i < 14; i++)
                {
                    result[i] = double.Parse(columns[i + 2], System.Globalization.CultureInfo.InvariantCulture);
                }

                counter++;

                if (dsp != null)
                {
                    dsp.DoWork(ref result);
                }

                System.Threading.Thread.Sleep(2);//delay is on purpose

                Values(result);
            }
            else
            {
                file.Close();
                file = null;
            }
        }
Exemplo n.º 4
0
        //    string header = "COUNTER,INTERPOLATED,RAW_CQ,AF3,F7,F3, FC5, T7, P7, O1, O2,P8" +
        //                    ", T8, FC6, F4,F8, AF4,GYROX, GYROY, TIMESTAMP, ES_TIMESTAMP" +
        //                    "FUNC_ID, FUNC_VALUE, MARKER, SYNC_SIGNAL,";

        public void Update()
        {
            // Handle any waiting events
            engine.ProcessEvents();

            // If the user has not yet connected, do not proceed
            if ((int)userID == -1)
            {
                return;
            }

            Dictionary <EdkDll.EE_DataChannel_t, double[]> data = engine.GetData((uint)userID);

            if (data == null)
            {
                return;
            }

            int _bufferSize = data[EdkDll.EE_DataChannel_t.TIMESTAMP].Length;

            for (int i = 0; i < _bufferSize; i++)
            {
                double[] result = new double[14];
                for (int j = 3; j <= 16; j++)
                {
                    result[j - 3] = data[(EdkDll.EE_DataChannel_t)j][i];
                }

                if (dsp != null)
                {
                    dsp.DoWork(ref result);
                }

                Values(result);
            }
        }