MotionCacher.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using Prism.Mvvm;
  2. using SKMC.Api.Motion.Control;
  3. using SKMC.Api.Motion.Driver;
  4. using SKMC.Api.Motion.Model;
  5. using System.Collections.Generic;
  6. namespace SKMC.Api.Motion
  7. {
  8. /// <summary>
  9. /// 运动控制缓存
  10. /// </summary>
  11. public abstract class MotionCacher : BindableBase
  12. {
  13. /// <summary>
  14. /// DI模块数量
  15. /// </summary>
  16. public int DevDiNum { get; set; }
  17. /// <summary>
  18. /// DO模块数量
  19. /// </summary>
  20. public int DevDoNum { get; set; }
  21. /// <summary>
  22. /// 运动控制卡数据解析层
  23. /// </summary>
  24. public IMotionDriverParser MotionDriverParser { get; set; }
  25. /// <summary>
  26. /// 运动控制卡接口层
  27. /// </summary>
  28. public IMotionDriver MotionDriver { get; set; }
  29. /// <summary>
  30. /// 运动控制卡高级接口层
  31. /// </summary>
  32. public IMotionDriverAdvance MotionDriverAdvance { get; set; }
  33. /// <summary>
  34. /// 运动控制高级接口
  35. /// </summary>
  36. public IMotionControl MotionControl { get; set; }
  37. private int _ecatStatusNow;
  38. /// <summary>
  39. /// Ecat总线当前状态,0为正常,非0为异常码
  40. /// </summary>
  41. public int MotionEcatStatusNow
  42. {
  43. get { return _ecatStatusNow; }
  44. set { _ecatStatusNow = value; RaisePropertyChanged(); }
  45. }
  46. private int _ecatStatusLatch;
  47. /// <summary>
  48. /// Ecat总线状态锁存,0为正常,非0为异常码。只要检测到一次Ecat连接异常就不为0直到重连总线或者重启程序并连接成功
  49. /// </summary>
  50. public int MotionEcatStatusLatch
  51. {
  52. get { return _ecatStatusLatch; }
  53. set { _ecatStatusLatch = value; RaisePropertyChanged(); }
  54. }
  55. /// <summary>
  56. /// Axis对象集
  57. /// </summary>
  58. public List<MotionAxis> MotionAxises { get; set; } = new List<MotionAxis>();
  59. /// <summary>
  60. /// DI 模块集
  61. /// </summary>
  62. public List<MotionIODev> MotionDiDevs { get; set; } = new List<MotionIODev>();
  63. /// <summary>
  64. /// DO 模块集
  65. /// </summary>
  66. public List<MotionIODev> MotionDoDevs { get; set; } = new List<MotionIODev>();
  67. /// <summary>
  68. /// AO 数据点集
  69. /// </summary>
  70. public List<MotionAO> MotionAos { get; set; } = new List<MotionAO>();
  71. /// <summary>
  72. /// SDO 数据集
  73. /// </summary>
  74. public List<MotionSdo> MotionSdos { get; set; } = new List<MotionSdo>();
  75. /// <summary>
  76. /// 可写PDO数据集
  77. /// </summary>
  78. public List<MotionPdo> MotionWritePdos { get; set; } = new List<MotionPdo>();
  79. /// <summary>
  80. /// 只读PDO数据集
  81. /// </summary>
  82. public List<MotionPdo> MotionReadPdos { get; set; } = new List<MotionPdo>();
  83. public abstract MotionIO GetMotionDi(string code);
  84. public abstract MotionIO GetMotionDo(string code);
  85. public abstract MotionIO GetMotionDio(string code);
  86. public abstract MotionAO GetMotionAO(string code);
  87. public abstract MotionPdo GetMotionWritePdo(string code);
  88. public abstract MotionPdo GetMotionReadPdo(string code);
  89. public abstract MotionAxis GetMotionAxis(string axisCode);
  90. public abstract MotionAxis GetMotionAxis(short axisNo);
  91. }
  92. }