GlobalEventConfig.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.ObjectModel;
  4. namespace TeamAAS.Communication.Config
  5. {
  6. [Serializable]
  7. public class GlobalEventConfig : BindableBase
  8. {
  9. private ObservableCollection<HeartbeatConfig> _heartbeats = new ObservableCollection<HeartbeatConfig>();
  10. public ObservableCollection<HeartbeatConfig> Heartbeats
  11. {
  12. get => _heartbeats;
  13. set => SetProperty(ref _heartbeats, value);
  14. }
  15. private ObservableCollection<ProductSwitchEvent> _productSwitchEvents = new ObservableCollection<ProductSwitchEvent>();
  16. public ObservableCollection<ProductSwitchEvent> ProductSwitchEvents
  17. {
  18. get => _productSwitchEvents;
  19. set => SetProperty(ref _productSwitchEvents, value);
  20. }
  21. }
  22. [Serializable]
  23. public class HeartbeatConfig : BindableBase
  24. {
  25. private Guid _deviceId;
  26. public Guid DeviceId
  27. {
  28. get => _deviceId;
  29. set => SetProperty(ref _deviceId, value);
  30. }
  31. private string _deviceName = "";
  32. public string DeviceName
  33. {
  34. get => _deviceName;
  35. set => SetProperty(ref _deviceName, value);
  36. }
  37. private string _deviceType = "";
  38. public string DeviceType
  39. {
  40. get => _deviceType;
  41. set => SetProperty(ref _deviceType, value);
  42. }
  43. private bool _enabled = true;
  44. public bool Enabled
  45. {
  46. get => _enabled;
  47. set => SetProperty(ref _enabled, value);
  48. }
  49. private int _intervalMs = 3000;
  50. public int IntervalMs
  51. {
  52. get => _intervalMs;
  53. set => SetProperty(ref _intervalMs, value);
  54. }
  55. private int _timeoutMs = 1000;
  56. public int TimeoutMs
  57. {
  58. get => _timeoutMs;
  59. set => SetProperty(ref _timeoutMs, value);
  60. }
  61. }
  62. [Serializable]
  63. public class ProductSwitchEvent : BindableBase
  64. {
  65. private int _sequence;
  66. public int Sequence
  67. {
  68. get => _sequence;
  69. set => SetProperty(ref _sequence, value);
  70. }
  71. private string _productName = "";
  72. public string ProductName
  73. {
  74. get => _productName;
  75. set => SetProperty(ref _productName, value);
  76. }
  77. }
  78. }