UserInching.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Newtonsoft.Json;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using TeamAAS_VP.Enums;
  9. namespace TeamAAS_VP.Models
  10. {
  11. /// <summary>
  12. /// 用户点动
  13. /// </summary>
  14. [JsonObject(MemberSerialization.OptOut)]
  15. public class UserInching : BindableBase
  16. {
  17. private Guid _ID;
  18. public Guid ID
  19. {
  20. get { return _ID; }
  21. set { SetProperty(ref _ID,value); }
  22. }
  23. private string _Name;
  24. public string Name
  25. {
  26. get { return _Name; }
  27. set { SetProperty(ref _Name, value); }
  28. }
  29. private ModbusDataStore _DataStore;
  30. public ModbusDataStore DataStore
  31. {
  32. get { return _DataStore; }
  33. set { SetProperty(ref _DataStore, value); }
  34. }
  35. private ushort _DataAddress;
  36. /// <summary>
  37. /// 地址
  38. /// </summary>
  39. public ushort DataAddress
  40. {
  41. get { return _DataAddress; }
  42. set { SetProperty(ref _DataAddress, value); }
  43. }
  44. private ushort _OnValue;
  45. public ushort OnValue
  46. {
  47. get { return _OnValue; }
  48. set { SetProperty(ref _OnValue, value); }
  49. }
  50. private ushort _OffValue;
  51. public ushort OffValue
  52. {
  53. get { return _OffValue; }
  54. set { SetProperty(ref _OffValue, value); }
  55. }
  56. private bool _State;
  57. /// <summary>
  58. /// 状态
  59. /// </summary>
  60. [JsonIgnore]
  61. public bool State
  62. {
  63. get { return _State; }
  64. set { SetProperty(ref _State, value); }
  65. }
  66. public UserInching Clone()
  67. {
  68. return JsonConvert.DeserializeObject<UserInching>(JsonConvert.SerializeObject(this)); ;
  69. }
  70. }
  71. }