Пример #1
0
        private void HandleBikeData(Measurement m)
        {
            if (patientform.InvokeRequired)
            {
                patientform.Invoke((new Action(() => HandleBikeData(m))));
            }
            else
            {
                //fill graph pulse
                bpmPoints.Add(new DataPoint(m.Time.ToOADate(), Convert.ToDouble(m.Pulse)));
                patientform.bpmChart.Series[0].Points.Clear();
                for (int i = 0; i < bpmPoints.Count; i++)
                    patientform.bpmChart.Series[0].Points.Add(bpmPoints[i]);
                if (bpmPoints.Count > 25)
                    bpmPoints.RemoveAt(0);
                patientform.bpmChart.Update();

                //fill graph rpm
                rpmPoints.Add(new DataPoint(m.Time.ToOADate(), Convert.ToDouble(m.PedalRpm)));
                patientform.rpmChart.Series[0].Points.Clear();
                for (int i = 0; i < rpmPoints.Count; i++)
                    patientform.rpmChart.Series[0].Points.Add(rpmPoints[i]);
                if (rpmPoints.Count > 25)
                    rpmPoints.RemoveAt(0);
                patientform.rpmChart.Update();
            }
        }
Пример #2
0
        private void HandleBikeData(Measurement m)
        {
            //fill graph pulse
            bpmPoints.Add(new DataPoint(m.Time.ToOADate(), Convert.ToDouble(m.Pulse)));
            crtPulse.Series[0].Points.Clear();
            for (int i = 0; i < bpmPoints.Count; i++)
                crtPulse.Series[0].Points.Add(bpmPoints[i]);
            if (bpmPoints.Count > 25)
                bpmPoints.RemoveAt(0);
            crtPulse.Update();

            //fill graph rpm
            rpmPoints.Add(new DataPoint(m.Time.ToOADate(), Convert.ToDouble(m.PedalRpm)));
            crtRPM.Series[0].Points.Clear();
            for (int i = 0; i < rpmPoints.Count; i++)
                crtRPM.Series[0].Points.Add(rpmPoints[i]);
            if (rpmPoints.Count > 25)
                rpmPoints.RemoveAt(0);
            crtRPM.Update();
        }
Пример #3
0
 private void SerialDataReceived(Measurement m)
 {
     Controller.RunClient();
     var packet = new SerialDataPacket(m, Username);
     Send(packet);
     Controller.ReceiveTransmissionAsync();
 }
Пример #4
0
 private static void OnIncomingDataEvent(Measurement measurement)
 {
     DataDelegate handler = IncomingDataEvent;
     if (handler != null) handler(measurement);
 }
Пример #5
0
 private void handleBikeValues(string buffer)
 {
     Measurement m = new Measurement(buffer);
     bufferIn = buffer.Split('\t');
     OnIncomingDataEvent(m);
 }
 private void Initialize(Measurement measurement, string username)
 {
     Measurement = measurement;
     Username = username;
 }
 public SerialDataPushPacket(Measurement measurement, string username) : base(DefCmd)
 {
     Initialize(measurement, username);
 }
 private void Initialize(Measurement measurement, string patientUsername)
 {
     Measurement = measurement;
     PatientUsername = patientUsername;
 }
 public SerialDataPacket(Measurement measurement, string patientUsername) : base(DefCmd)
 {
     Initialize(measurement, patientUsername);
 }
Пример #10
0
        public ReturnValue AddMeasurementToLastBikeTest(Measurement m)
        {
            if (TestStatus == BikeTestStatus.Started)
            {
                if (_lastBikeTestBuff != null)
                {
                    _lastBikeTestBuff.AddMeasurement(m);
                    return ReturnValue.Success;
                }
                else return ReturnValue.Error;
            }
            else if (TestStatus == BikeTestStatus.Stopped) return ReturnValue.NotStarted;
            else return ReturnValue.Error;

        }
Пример #11
0
 public void AddMeasurement(Measurement measurement)
 {
     Measurements.Add(measurement);
     Heartbeat = measurement.Pulse;
 }