using Edge.Core.Database.Models; using System; using System.Collections.Generic; using System.Text; namespace Edge.Core.UniversalApi { /// /// litefcccore fire an event to notify outside clients. /// public class EventDescriptor { public string Name { get; set; } public object Data { get; set; } public IEnumerable ToClients { get; set; } } public class HubClient { } public enum GenericAlarmSeverity { Fatal, Error, Warning, Information } /// /// Used for send a simple and unified alarm data to UI. /// public class GenericAlarm { public const string UniversalApiEventName = "OnGenericAlarm"; //public string Originator { get; set; } /// /// Gets or sets the alarm message title, LocalizedContent format is support. /// please keep this shorter for better user exp in UI, and fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界. /// public string Title { get; set; } /// /// Gets or sets the alarm message detail, LocalizedContent format is support. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界. /// public string Detail { get; set; } /// /// Abstract description for a serial of alarms that could help to group alarms, LocalizedContent format is support. /// this is mostly used by UI app that providing a group box to group similar alarms. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界. /// public string Category { get; set; } /// /// Abstract description for a serial of alarms that could help to further group alarms besides Category, LocalizedContent format is support. /// this is mostly used by UI app that providing a group box to group similar alarms. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界. /// public string SubCategory { get; set; } /// /// Used to store specific business data that the caller may use it when get the historical generic alarms. /// /// /// could be anything that recognized by front end(mostly the Web html/javascript). /// public string Action { get; set; } public GenericAlarmSeverity Severity { get; set; } /// /// alarms with same identity will be treat as the same alarm, thus only the earliest fired single alarm will be persist, following alarms will be ignore for persist. /// leave this value null or empty will treat every fired alarm is a new one, thus each alarm will be persist. /// //public string Identity { get; set; } //public DateTime OpeningTimestamp { get; set; } //public string ClosedReason { get; set; } //public DateTime? ClosedTimestamp { get; set; } } }