节点
This commit is contained in:
parent
465d76d0db
commit
4b5ac96b7c
|
|
@ -93,7 +93,6 @@ public partial class MainWindow : Window
|
||||||
// 清空之前图表数据
|
// 清空之前图表数据
|
||||||
chartManager.ClearAllCharts();
|
chartManager.ClearAllCharts();
|
||||||
sensorManager.Start();
|
sensorManager.Start();
|
||||||
//chartManager.Start(); // 启动图表刷新
|
|
||||||
BtnSensorControl.Content = "检测确定";
|
BtnSensorControl.Content = "检测确定";
|
||||||
isDetecting = true;
|
isDetecting = true;
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +100,6 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
// 停止检测
|
// 停止检测
|
||||||
sensorManager.Stop();
|
sensorManager.Stop();
|
||||||
//chartManager.Stop(); // 停止图表刷新
|
|
||||||
BtnSensorControl.Content = "检测开始";
|
BtnSensorControl.Content = "检测开始";
|
||||||
isDetecting = false;
|
isDetecting = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
using guoke;
|
using guoke;
|
||||||
using LiveCharts;
|
using LiveCharts;
|
||||||
using LiveCharts.Wpf;
|
using LiveCharts.Wpf;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using WpfApp.src.config;
|
|
||||||
|
|
||||||
namespace WpfApp.Services
|
namespace WpfApp.Services;
|
||||||
|
|
||||||
|
public class ChartManager
|
||||||
{
|
{
|
||||||
public class ChartManager
|
|
||||||
{
|
|
||||||
private readonly Dispatcher dispatcher;
|
private readonly Dispatcher dispatcher;
|
||||||
private readonly LogService log;
|
private readonly LogService log;
|
||||||
private readonly DatabaseService db;
|
private readonly DatabaseService db;
|
||||||
|
|
@ -195,5 +192,4 @@ namespace WpfApp.Services
|
||||||
{
|
{
|
||||||
even?.AddEventHandler(SENSOR_DATA_EVENT, OnSensorDataReceived);
|
even?.AddEventHandler(SENSOR_DATA_EVENT, OnSensorDataReceived);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using WpfApp.src.components;
|
using WpfApp.src.components;
|
||||||
|
|
||||||
namespace WpfApp.Services
|
namespace WpfApp.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SensorChart 管理器 - 负责传感器数据采集和更新
|
||||||
|
/// </summary>
|
||||||
|
public class SensorChartManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// SensorChart 管理器 - 负责传感器数据采集和更新
|
|
||||||
/// </summary>
|
|
||||||
public class SensorChartManager
|
|
||||||
{
|
|
||||||
private readonly Window dispatcherOwner;
|
private readonly Window dispatcherOwner;
|
||||||
private CancellationTokenSource cts;
|
private CancellationTokenSource cts;
|
||||||
private readonly Random rand = new Random();
|
private readonly Random rand = new Random();
|
||||||
|
|
@ -92,5 +92,4 @@ namespace WpfApp.Services
|
||||||
even.TriggerEvent(SENSOR_DATA_EVENT, this, eventArgs);
|
even.TriggerEvent(SENSOR_DATA_EVENT, this, eventArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user