private void expTransfer_FET_dataArrived(object sender, ExpDataArrivedEventArgs e) { var settings = expStartInfo as FET_IVModel; if (e.Data.Contains("Vds") || dsMeasurement == null) { dsMeasurement = new Microsoft.Research.DynamicDataDisplay.DataSources.ObservableDataSource <Point>(); dsMeasurement.SetXYMapping(p => p); Dispatcher.BeginInvoke(new Action(() => { (measurementInterface as FET_IV).expTransfer_FET_Chart.AddLineGraph(dsMeasurement, 1.5, e.Data); })); } else { var dataPoint = Array.ConvertAll(e.Data.TrimEnd(delim).Split(sep, StringSplitOptions.RemoveEmptyEntries), s => double.Parse(s, NumberFormatInfo.InvariantInfo)); dsMeasurement.AppendAsync(Dispatcher, new Point(dataPoint[0], dataPoint[1])); } }
private void expIV_FET_dataArrived(object sender, ExpDataArrivedEventArgs e) { var settings = expStartInfo as FET_IVModel; if (e.Data.Contains("Vg") || dsMeasurement == null) { var CurrentLinePen = new Pen(); dsMeasurement = new Microsoft.Research.DynamicDataDisplay.DataSources.ObservableDataSource <Point>(); dsMeasurement.SetXYMapping(p => p); Dispatcher.BeginInvoke(new Action(() => { CurrentLinePen = (measurementInterface as FET_IV).expIV_FET_Chart.AddLineGraph(dsMeasurement, 1.5, e.Data).LinePen; CurrentLinePen = new Pen(CurrentLinePen.Brush, 1.0); })); } else { var dataPoint = Array.ConvertAll(e.Data.Split("\t\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries), s => double.Parse(s, NumberFormatInfo.InvariantInfo)); if (settings.MeasureLeakage == true) { dsMeasurement.AppendAsync(Dispatcher, new Point(dataPoint[0], dataPoint[1])); } else { var iv_query = from ivPoint in e.Data.FromStringExtension() select new Point(ivPoint.Voltage, ivPoint.Current); Dispatcher.BeginInvoke(new Action(() => { dsMeasurement.AppendMany(iv_query); })); } } }