protected virtual void OnRawDataReceived(int value, byte signalQuality)
 {
     if (NewDataPoint != null)
     {
         RawDataValue newValue = new RawDataValue(value, signalQuality);
         NewDataPoint(this, newValue);
     }
 }
Exemplo n.º 2
0
        public void OnNewDataValueReceived(object source, EventArgs e)
        {
            RawDataValue newData       = (RawDataValue)e;
            long         y             = newData.getRawValue();
            long         time          = (DateTime.Now.Ticks - start.Ticks) / TimeSpan.TicksPerMillisecond;
            byte         signalQuality = newData.getSignalQuality();

            if (time > (int)this.silentReadTimeNumericalUpDown.Value * 1000)
            {
                if (!isPlaying)
                {
                    openMusicThread();
                    isPlaying = true;
                }
            }
            if (time > readTimeMS)// Time has ended
            {
                updateChart();

                stopDataFeed();
                enableControls(true);
                if (isPlaying)
                {
                    wplayer.controls.stop();
                    isPlaying = false;
                }

                //Save Json file
                currentCapture.exportJson(JSON_DIR, fileNameTextBox.Text);

                //Save chart image
                SaveChart();
            }

            if (!isPlaying)
            {
                currentCapture.addSilentPoint(y, signalQuality);
            }
            else
            {
                currentCapture.addEventPoint(y, signalQuality);
            }
        }