You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
1.5 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace HBLConsole.Model
  10. {
  11. [Table(nameof(AlarmSet))]
  12. public class AlarmSet
  13. {
  14. public AlarmSet()
  15. {
  16. AnalogAlarmModels.Clear();
  17. foreach (var item in Enum.GetNames(typeof(EAnalogAlarmType)))
  18. {
  19. AnalogAlarmModels.Add(new AnalogAlarmModel()
  20. {
  21. AlarmTag = item,
  22. SortTag = (EAnalogAlarmType)Enum.Parse(typeof(EAnalogAlarmType), item)
  23. });
  24. }
  25. }
  26. [Key]
  27. public int Id { get; set; }
  28. /// <summary>
  29. /// 模拟量报警信息
  30. /// </summary>
  31. public ObservableCollection<AnalogAlarmModel> AnalogAlarmModels { get; set; } = new ObservableCollection<AnalogAlarmModel>();
  32. /// <summary>
  33. /// 离散量报警信息
  34. /// </summary>
  35. public DiscreteAlarmInfo DiscreteAlarmInfoSet { get; set; } = new DiscreteAlarmInfo();
  36. /// <summary>
  37. /// 设置外键
  38. /// </summary>
  39. [ForeignKey("VariableInfoId")]
  40. public int VariableInfoId { get; set; }
  41. /// <summary>
  42. /// 设置导航属性
  43. /// </summary>
  44. public VariableInfo VariableInfo { get; set; }
  45. }
  46. }