增加监控界面
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user