增加监控界面

This commit is contained in:
2024-07-12 10:39:55 +08:00
parent 1e0cba7b53
commit c9f4e88e04
11 changed files with 892 additions and 141 deletions

View File

@@ -1,14 +1,39 @@
using CapMachine.Core;
using CapMachine.Wpf.Models;
using CapMachine.Wpf.PrismEvent;
using Prism.Events;
namespace CapMachine.Wpf.ViewModels
{
public class MonitorViewModel : NavigationViewModel
{
public MonitorViewModel()
public MonitorViewModel(IEventAggregator eventAggregator)
{
//事件服务
_EventAggregator = eventAggregator;
_EventAggregator.GetEvent<ChartRtEvent>().Subscribe(GetChartRtEvent);
}
private IEventAggregator _EventAggregator { get; set; }
public List<ChartRtValue> ListChartRtValue { get; set; } = new List<ChartRtValue>()
{
new ChartRtValue(){ Name="温度",Value=12.3,Unit="℃"},
new ChartRtValue(){ Name="压力",Value=12.3,Unit="bar"},
new ChartRtValue(){ Name="湿度",Value=12.3,Unit="%"},
};
/// <summary>
/// 获取曲线的实时值
/// 数据是发布过来
/// </summary>
/// <param name="value"></param>
/// <exception cref="NotImplementedException"></exception>
private void GetChartRtEvent(List<ChartRtValue> RtData)
{
//ListChartRtValue = RtData;
}
}
}