40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using CapMachine.Core;
|
|
using CapMachine.Wpf.Models;
|
|
using CapMachine.Wpf.PrismEvent;
|
|
using Prism.Events;
|
|
|
|
namespace CapMachine.Wpf.ViewModels
|
|
{
|
|
public class MonitorViewModel : NavigationViewModel
|
|
{
|
|
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;
|
|
|
|
}
|
|
}
|
|
}
|