终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

74 satır
1.9 KiB

  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. void WriteData(string address, object value);
  52. //void ReadData(string address);
  53. /// <summary>
  54. /// 初始化
  55. /// </summary>
  56. void Init();
  57. /// <summary>
  58. /// 驱动开启
  59. /// </summary>
  60. void Start();
  61. /// <summary>
  62. /// 驱动停止
  63. /// </summary>
  64. void Stop();
  65. }
  66. }