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

IPeripheral.cs 2.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using BPASmartClient.Model;
  2. using System;
  3. using System.Collections.Concurrent;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace BPASmartClient.Peripheral
  10. {
  11. /// <summary>
  12. /// 外设接口
  13. /// </summary>
  14. public interface IPeripheral
  15. {
  16. /// <summary>
  17. /// 是否已连接
  18. /// </summary>
  19. bool IsConnected { get; set; }
  20. /// <summary>
  21. /// 是否工作正常
  22. /// </summary>
  23. bool IsWork { get; set; }
  24. /// <summary>
  25. /// 设备ID
  26. /// </summary>
  27. int DeviceId { get; set; }
  28. /// <summary>
  29. /// 获取指定状态值
  30. /// </summary>
  31. /// <param name="statusName">状态名称</param>
  32. /// <returns>状态值</returns>
  33. object? GetStatus(string statusName);
  34. /// <summary>
  35. /// 获取所有状态
  36. /// </summary>
  37. /// <returns>状态值</returns>
  38. ConcurrentDictionary<string, object> GetAllStatus();
  39. /// <summary>
  40. /// 设备变量数据
  41. /// </summary>
  42. ObservableCollection<Variable> variables { get; set; }
  43. /// <summary>
  44. /// 通讯参数
  45. /// </summary>
  46. CommunicationPar communicationPar { get; set; }
  47. /// <summary>
  48. /// 设备数据,key:地址,value:数据
  49. /// </summary>
  50. ConcurrentDictionary<string, object> status { get; set; }
  51. ConcurrentDictionary<string, Variable> tempVar { get; set; }
  52. ConcurrentDictionary<string, Variable> GetVariable();
  53. void WriteData(string address, object value);
  54. //void AddVarInfo(string add, int len);
  55. //void ReadData(string address);
  56. /// <summary>
  57. /// 初始化
  58. /// </summary>
  59. void Init();
  60. /// <summary>
  61. /// 驱动开启
  62. /// </summary>
  63. void Start();
  64. /// <summary>
  65. /// 驱动停止
  66. /// </summary>
  67. void Stop();
  68. }
  69. }