private void Add(Series series, double[] y) { for (int i = 0; i < y.Length; ++i) { series.Points.Add(new DataPoint() { XValue = CPARDevice.CountToTime(i), YValues = new double[] { y[i] } }); } }
private void Add(Series series, double y) { double time = CPARDevice.CountToTime(series.Points.Count); series.Points.Add(new DataPoint() { XValue = time, YValues = new double[] { y } }); if (time > chartArea.AxisX.Maximum) { chartArea.AxisX.Maximum = time; } }
protected override void Process(StatusMessage msg) { if (msg.Condition == StatusMessage.StopCondition.STOPCOND_NO_CONDITION || initializing) { var force = SECOND_CUFF ? (msg.ActualPressure01 + msg.ActualPressure02) / 2 : PrimaryChannel == 0 ? msg.ActualPressure01 : msg.ActualPressure02; result.Add(force, 0, msg.VasScore); Visualizer.Update(force, 0, msg.VasScore); if (msg.Condition == StatusMessage.StopCondition.STOPCOND_NO_CONDITION) { initializing = false; } } else if ((msg.Condition == StatusMessage.StopCondition.STOPCOND_STIMULATION_COMPLETED || msg.Condition == StatusMessage.StopCondition.STOPCOND_STOP_BUTTON_PRESSED) && !initializing) { var force = SECOND_CUFF ? (msg.ActualPressure01 + msg.ActualPressure02) / 2 : PrimaryChannel == 0 ? msg.ActualPressure01 : msg.ActualPressure02; result.Add(force, 0, msg.VasScore); Visualizer.Update(force, 0, msg.VasScore); if (result.AbortCount > 0) { if (CPARDevice.CountToTime(result.Length - result.AbortCount) >= TailDuration) { Pending(); } } else { result.AbortCount = result.Length; } } else { Abort(); } }