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.
 
 

73 lines
2.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Microsoft.Toolkit.Mvvm.ComponentModel;
  9. using Newtonsoft.Json;
  10. using HBLConsole.Service;
  11. namespace HBLConsole.Model
  12. {
  13. /// <summary>
  14. /// 变量信息
  15. /// </summary>
  16. [Table(nameof(VariableInfo))]
  17. public class VariableInfo : ObservableObject
  18. {
  19. [Key]
  20. public int ID { get { return _mID; } set { _mID = value; OnPropertyChanged(); } }
  21. private int _mID;
  22. /// <summary>
  23. /// 变量名
  24. /// </summary>
  25. public string VarName
  26. {
  27. get { return _mVarName; }
  28. set
  29. {
  30. _mVarName = value;
  31. OnPropertyChanged();
  32. ActionManage.GetInstance.Send("VarNameChanged", _mID);
  33. }
  34. }
  35. private string _mVarName;
  36. /// <summary>
  37. /// 地址
  38. /// </summary>
  39. public string Address { get { return _mAddress; } set { _mAddress = value; OnPropertyChanged(); } }
  40. private string _mAddress;
  41. /// <summary>
  42. /// 数据类型
  43. /// </summary>
  44. public string DataType { get { return _mDataType; } set { _mDataType = value; OnPropertyChanged(); } }
  45. private string _mDataType;
  46. /// <summary>
  47. /// 是否启用报警
  48. /// </summary>
  49. public bool IsEnableAlarm { get { return _mIsEnableAlarm; } set { _mIsEnableAlarm = value; OnPropertyChanged(); } }
  50. private bool _mIsEnableAlarm;
  51. /// <summary>
  52. /// 当前值
  53. /// </summary>
  54. public string CurrentValue { get { return _mCurrentValue; } set { _mCurrentValue = value; OnPropertyChanged(); } }
  55. private string _mCurrentValue;
  56. /// <summary>
  57. /// 报警设置信息
  58. /// </summary>
  59. public AlarmSet AlarmSetProp { get { return _mAlarmSetProp; } set { _mAlarmSetProp = value; OnPropertyChanged(); } }
  60. private AlarmSet _mAlarmSetProp = new AlarmSet();
  61. }
  62. }