123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Runtime.Serialization;
- using Aitex.Core.Util;
- namespace Aitex.Core.RT.Event
- {
- [DataContract]
- [Serializable]
- public enum EventLevel
- {
- [EnumMember]
- Information = 0,
- [EnumMember]
- Warning,
- [EnumMember]
- Alarm
- }
- [DataContract]
- [Serializable]
- public enum EventType
- {
- /// <summary>
- /// 在TopView显示一条记录
- /// </summary>
- [EnumMember]
- EventUI_Notify,
- /// <summary>
- /// 弹出对话框
- /// </summary>
- [EnumMember]
- Dialog_Nofity,
- /// <summary>
- ///
- /// </summary>
- [EnumMember]
- KickOut_Notify,
- /// <summary>
- ///
- /// </summary>
- [EnumMember]
- Sound_Notify,
- /// <summary>
- /// 在屏幕左下角弹出一个提醒的悬浮窗口,自动消失
- /// </summary>
- [EnumMember]
- UIMessage_Notify,
- [EnumMember]
- OperationLog,
- [EnumMember]
- HostNotification,
- }
- [DataContract]
- [Serializable]
- public class EventItem
- {
- [DataMember]
- public int Id { get; set; }
- [DataMember]
- public string EventEnum { get; set; } //
- [DataMember]
- public EventType Type { get; set; }
- [DataMember]
- public EventLevel Level { get; set; }
- [DataMember]
- public string Source { get; set; } //Which module send out this event
- [DataMember]
- public string Description { get; set; } //detail text
- [DataMember]
- public DateTime OccuringTime { get; set; } //
- [DataMember]
- public bool IsAcknowledged { get; set; }
- [DataMember]
- public string Explaination { get; set; }
- [DataMember]
- public string Solution { get; set; }
- [DataMember]
- public string GlobalDescription_en
- {
- get;
- set;
- }
- [DataMember]
- public string GlobalDescription_zh
- {
- get;
- set;
- }
- [DataMember]
- public SerializableDictionary<string, string> DVID
- {
- get;
- set;
- }
-
- public SerializableDictionary<string, object> ObjDVID
- {
- get;
- set;
- }
- public bool IsTriggered
- {
- get
- {
- return !IsAcknowledged;
- }
- }
- public EventItem Clone()
- {
- EventItem result = new EventItem();
- result.Description = Description;
- result.EventEnum = EventEnum;
- result.Explaination = Explaination;
- result.Id = Id;
- result.IsAcknowledged = IsAcknowledged;
- result.Level = Level;
- result.OccuringTime = OccuringTime;
- result.Solution = Solution;
- result.Source = Source;
- result.Type = Type;
- result.GlobalDescription_en = GlobalDescription_en;
- result.GlobalDescription_zh = GlobalDescription_zh;
- result.DVID = DVID;
- result.ObjDVID = ObjDVID;
- return result;
- }
- public EventItem Clone(SerializableDictionary<string, object> objDvid)
- {
- EventItem result = new EventItem();
- result.Description = Description;
- result.EventEnum = EventEnum;
- result.Explaination = Explaination;
- result.Id = Id;
- result.IsAcknowledged = IsAcknowledged;
- result.Level = Level;
- result.OccuringTime = OccuringTime;
- result.Solution = Solution;
- result.Source = Source;
- result.Type = Type;
- result.GlobalDescription_en = GlobalDescription_en;
- result.GlobalDescription_zh = GlobalDescription_zh;
- result.DVID = DVID;
- result.ObjDVID = objDvid;
- return result;
- }
- public EventItem()
- {
- }
- public EventItem (string name )
- : this(0, "System", name, "", EventLevel.Information, EventType.EventUI_Notify)
- {
- }
- public EventItem(string name, string description)
- : this(0, "System", name, description, EventLevel.Information, EventType.EventUI_Notify)
- {
- }
- public EventItem(string source, string name, string description)
- :this(0, source,name,description, EventLevel.Information, EventType.EventUI_Notify)
- {
- }
- public EventItem(string name, EventType type, EventLevel level)
- : this(0,"System", name, "", level, type)
- {
- }
- public EventItem(string source, string name, string description, EventLevel level, EventType type)
- : this (0, source,name, description, level, type)
- {
- }
- public EventItem(int id, string source, string name, string description, EventLevel level, EventType type)
- {
- EventEnum = name;
- Type = type;
- Level = level;
- Source = source;
- Description = description;
- Id = id;
- }
- }
- }
|