终端一体化运控平台
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.
 
 
 

64 lines
1.5 KiB

  1. using BPA.Message.Enum;
  2. using BPASmartClient.Peripheral;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Reflection;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace BPASmartClient.Device
  10. {
  11. /// <summary>
  12. /// 设备基类
  13. /// </summary>
  14. public abstract class BaseDevice : IDevice
  15. {
  16. public BaseDevice()
  17. {
  18. }
  19. /// <summary>
  20. /// 设备ID
  21. /// </summary>
  22. public int DeviceId { get; set; }
  23. /// <summary>
  24. /// 设备所有状态
  25. /// </summary>
  26. public DeviceStatus Status { get; set; } = new DeviceStatus();
  27. /// <summary>
  28. /// 设备名称
  29. /// </summary>
  30. public string Name { get; set; }
  31. /// <summary>
  32. /// 设备类型
  33. /// </summary>
  34. public abstract DeviceClientType DeviceType { get; }
  35. /// <summary>
  36. /// 是否忙碌
  37. /// </summary>
  38. public bool IsBusy { get; protected set; }
  39. /// <summary>
  40. /// 是否健康
  41. /// </summary>
  42. public bool IsHealth { get; protected set; }
  43. public void Initliaze()
  44. {
  45. }
  46. public void Initliaze(List<IPeripheral> peripherals)
  47. {
  48. peripherals.ForEach(p =>
  49. {
  50. p.DeviceId = this.DeviceId;
  51. p.Init();
  52. });
  53. }
  54. public abstract void StartMain();
  55. public abstract void Stop();
  56. }
  57. }