public void Update(SignalValue signal) { mut.WaitOne(); switch (signal.Type) { case SignalType.HR: { ((HRPlot)plots[0]).InsertData(signal); break; } case SignalType.T: { ((TPlot)plots[1]).InsertData(signal); break; } case SignalType.SBP: { ((BPPlot)plots[2]).InsertData(signal); break; } case SignalType.DBP: { ((BPPlot)plots[2]).InsertData(signal); break; } } mut.ReleaseMutex(); }
public override void InsertData(SignalValue signal) { if (signal.Type == SignalType.SBP) { for (int i = dati.Length - 1; i >= 1; i--) { dati[i].Y = dati[i - 1].Y; } dati[0].Y = signal.Value; } else { for (int i = dati2.Length - 1; i >= 1; i--) { dati2[i].Y = dati2[i - 1].Y; } dati2[0].Y = signal.Value; } if (Refresh) { InvalidatePlot(true); } GC.Collect(); }
public SignalValue String2SignalValue(string[] svalue) { DateTime timestamp = DateTime.Parse(svalue[2]); double value = Convert.ToDouble(svalue[1]); int status = int.Parse(svalue[3]); SignalValue signalvalue = new SignalValue(timestamp, value, status); return(signalvalue); }
public virtual void InsertData(SignalValue signal) { for (int i = dati.Length - 1; i >= 1; i--) { dati[i].Y = dati[i - 1].Y; } dati[0].Y = signal.Value; if (Refresh) { InvalidatePlot(true); } GC.Collect(); }
//辅助函数:数据格式转换 #region 为写入当前值(即时值、快照值)准备的转换函数,将PValue转换为SignalValue public SignalValue PValue2SignalValue(PValue pvalue) public SignalValue PValue2SignalValue(PValue pvalue) { SignalValue signalvalue = new SignalValue(pvalue.Timestamp, pvalue.Value, (int)pvalue.Status); return(signalvalue); }