123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Aitex.Core.RT.Event;
- using Aitex.Core.UI.MVVM;
- using Aitex.Core.UI.View.Common;
- using Aitex.Triton160.Common;
- using Aitex.Triton160.UI;
- using Aitex.Triton160.UI.ViewModel;
- namespace Triton160.UI.ViewModel
- {
- class JetEventViewModel : UIViewModelBase
- {
- string AlarmEventParam = ModuleNameString.System + "." + StateData.AlarmEvent.ToString();
- public MonitorViewModel MonitorVM { get; set; }
- public EventViewModel EventVM { get; set; }
- public JetEventViewModel()
- : base("JetEventViewModel")
- {
- MonitorVM = new MonitorViewModel();
- EventVM = new EventViewModel();
- Subscribe(AlarmEventParam);
- EventVM.QueryDBEventFunc = (sql) => Triton160UiSystem.Instance.WCF.Query.QueryDBEvent(sql);
- EventVM.QueryEventList = () =>
- {
- List<string> result = new List<string>();
- foreach (var eventName in Enum.GetNames(typeof(EventEnum)))
- result.Add(eventName);
- return result;
- };
- }
- protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
- {
- if (data.ContainsKey(AlarmEventParam))
- MonitorVM.UpdateAlarmEvent((List<EventItem>)data[AlarmEventParam]);
- }
- }
- }
|