This commit is contained in:
YONGYE 2025-10-14 12:38:10 +08:00
parent 465d76d0db
commit 4b5ac96b7c
4 changed files with 240 additions and 247 deletions

View File

@ -93,7 +93,6 @@ public partial class MainWindow : Window
// 清空之前图表数据
chartManager.ClearAllCharts();
sensorManager.Start();
//chartManager.Start(); // 启动图表刷新
BtnSensorControl.Content = "检测确定";
isDetecting = true;
}
@ -101,7 +100,6 @@ public partial class MainWindow : Window
{
// 停止检测
sensorManager.Stop();
//chartManager.Stop(); // 停止图表刷新
BtnSensorControl.Content = "检测开始";
isDetecting = false;
}

View File

@ -1,13 +1,10 @@
using guoke;
using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Windows.Threading;
using WpfApp.src.config;
namespace WpfApp.Services
{
namespace WpfApp.Services;
public class ChartManager
{
private readonly Dispatcher dispatcher;
@ -196,4 +193,3 @@ namespace WpfApp.Services
even?.AddEventHandler(SENSOR_DATA_EVENT, OnSensorDataReceived);
}
}
}

View File

@ -2,8 +2,8 @@
using System.Windows;
using WpfApp.src.components;
namespace WpfApp.Services
{
namespace WpfApp.Services;
/// <summary>
/// SensorChart 管理器 - 负责传感器数据采集和更新
/// </summary>
@ -93,4 +93,3 @@ namespace WpfApp.Services
}
}
}
}