|
|
@@ -665,31 +665,31 @@ namespace TeamAAS_VP.ViewModels
|
|
|
{
|
|
|
//更新对应传感器的曲线图
|
|
|
|
|
|
- App.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
- {
|
|
|
- var model = PressurePlotModel;
|
|
|
- var series = model.Series[0] as LineSeries;
|
|
|
- series.Points.Clear();
|
|
|
- //第一个点的时间作为X轴起点
|
|
|
- DateTime xAxisStart = tuple.values[0].Timestamp;
|
|
|
- foreach (var dataPoint in tuple.values)
|
|
|
- {
|
|
|
- // 计算相对于起点的秒数作为X轴坐标
|
|
|
- double xValue = (dataPoint.Timestamp - xAxisStart).TotalSeconds;
|
|
|
- series.Points.Add(new OxyPlot.DataPoint(xValue, dataPoint.Value));
|
|
|
- }
|
|
|
- // 重置所有轴的范围以适应新数据
|
|
|
- model.ResetAllAxes();
|
|
|
- model.InvalidatePlot(true);
|
|
|
- if (!string.IsNullOrEmpty(tuple.SavePath))
|
|
|
- {
|
|
|
- if (!Directory.Exists(Path.GetDirectoryName(tuple.SavePath)))
|
|
|
- {
|
|
|
- Directory.CreateDirectory(Path.GetDirectoryName(tuple.SavePath));
|
|
|
- }
|
|
|
- PngExporter.Export(model, tuple.SavePath, (int)model.Width, (int)model.Height);
|
|
|
- }
|
|
|
- }));
|
|
|
+ //App.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
+ //{
|
|
|
+ // var model = PressurePlotModel;
|
|
|
+ // var series = model.Series[0] as LineSeries;
|
|
|
+ // series.Points.Clear();
|
|
|
+ // //第一个点的时间作为X轴起点
|
|
|
+ // DateTime xAxisStart = tuple.values[0].Timestamp;
|
|
|
+ // foreach (var dataPoint in tuple.values)
|
|
|
+ // {
|
|
|
+ // // 计算相对于起点的秒数作为X轴坐标
|
|
|
+ // double xValue = (dataPoint.Timestamp - xAxisStart).TotalSeconds;
|
|
|
+ // series.Points.Add(new OxyPlot.DataPoint(xValue, dataPoint.Value));
|
|
|
+ // }
|
|
|
+ // // 重置所有轴的范围以适应新数据
|
|
|
+ // model.ResetAllAxes();
|
|
|
+ // model.InvalidatePlot(true);
|
|
|
+ // if (!string.IsNullOrEmpty(tuple.SavePath))
|
|
|
+ // {
|
|
|
+ // if (!Directory.Exists(Path.GetDirectoryName(tuple.SavePath)))
|
|
|
+ // {
|
|
|
+ // Directory.CreateDirectory(Path.GetDirectoryName(tuple.SavePath));
|
|
|
+ // }
|
|
|
+ // PngExporter.Export(model, tuple.SavePath, (int)model.Width, (int)model.Height);
|
|
|
+ // }
|
|
|
+ //}));
|
|
|
}
|
|
|
|
|
|
|