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

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