From a2d86b667ed12ba07c746459283284cbf93430e5 Mon Sep 17 00:00:00 2001 From: xyy <544939200@qq.com> Date: Mon, 8 Jun 2026 17:58:19 +0800 Subject: [PATCH] --- ViewModels/D7896ViewModel.cs | 13 ++++++++++++- Window1.xaml | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ViewModels/D7896ViewModel.cs b/ViewModels/D7896ViewModel.cs index 17d95b5..fe2e2d8 100644 --- a/ViewModels/D7896ViewModel.cs +++ b/ViewModels/D7896ViewModel.cs @@ -784,7 +784,18 @@ public partial class D7896ViewModel : ObservableObject CurrentMeasurementIndex = 0; StatusMessage = "已重置"; TestDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); - TemperatureCurveModel = null; + + // 清空曲线:新建一个空白的 PlotModel 替换原来的 + TemperatureCurveModel = new PlotModel + { + Title = "温升与冷却曲线", + Background = OxyColors.White + }; + TemperatureCurveModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = "时间 (s)" }); + TemperatureCurveModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = "温升 (℃)" }); + TemperatureCurveModel.InvalidatePlot(true); + + CurveTitle = "温升曲线"; } [RelayCommand] diff --git a/Window1.xaml b/Window1.xaml index b9eb523..a7e94d8 100644 --- a/Window1.xaml +++ b/Window1.xaml @@ -38,7 +38,7 @@