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.

61 lines
1.9 KiB

8 months ago
  1. using Mirle.Component.MPLC.DataBlocks;
  2. using System.Collections.Generic;
  3. namespace Mirle.Component.MPLC
  4. {
  5. /// <summary>
  6. /// 控制器資訊
  7. /// </summary>
  8. public class PLCHostInfo
  9. {
  10. /// <summary>
  11. /// 建構式
  12. /// </summary>
  13. /// <param name="hostID">控制器編號</param>
  14. /// <param name="actLogicalStationNo">控制器站點編號</param>
  15. /// <param name="blockInfos">區塊資訊</param>
  16. public PLCHostInfo(string hostID, int actLogicalStationNo, IEnumerable<BlockInfo> blockInfos)
  17. {
  18. HostID = hostID;
  19. IPAddress = string.Empty;
  20. TcpPort = 0;
  21. ActLogicalStationNo = actLogicalStationNo;
  22. BlockInfos = blockInfos;
  23. }
  24. /// <summary>
  25. /// 建構式
  26. /// </summary>
  27. /// <param name="hostID">控制器編號</param>
  28. /// <param name="ipAddress">網路位址</param>
  29. /// <param name="tcpPort">通訊埠口</param>
  30. /// <param name="blockInfos">區塊資訊</param>
  31. public PLCHostInfo(string hostID, string ipAddress, int tcpPort, IEnumerable<BlockInfo> blockInfos)
  32. {
  33. HostID = hostID;
  34. IPAddress = ipAddress;
  35. TcpPort = tcpPort;
  36. ActLogicalStationNo = 0;
  37. BlockInfos = blockInfos;
  38. }
  39. /// <summary>
  40. /// 控制器編號
  41. /// </summary>
  42. public string HostID { get; }
  43. /// <summary>
  44. /// 網路位址
  45. /// </summary>
  46. public string IPAddress { get; }
  47. /// <summary>
  48. /// 通訊埠口
  49. /// </summary>
  50. public int TcpPort { get; }
  51. /// <summary>
  52. /// 控制器站點編號
  53. /// </summary>
  54. public int ActLogicalStationNo { get; }
  55. /// <summary>
  56. /// 區塊資訊
  57. /// </summary>
  58. public IEnumerable<BlockInfo> BlockInfos { get; }
  59. }
  60. }