MotionCacher.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. /// 运动控制卡接口层
  15. /// </summary>
  16. public IMotionDriver MotionDriver { get; set; }
  17. /// <summary>
  18. /// 运动控制卡高级接口层
  19. /// </summary>
  20. public IMotionDriverAdvance MotionDriverAdvance { get; set; }
  21. /// <summary>
  22. /// 运动控制高级接口
  23. /// </summary>
  24. public IMotionControl MotionControl { get; set; }
  25. private int _ecatStatusNow;
  26. /// <summary>
  27. /// Ecat总线当前状态,0为正常,非0为异常码
  28. /// </summary>
  29. public int MotionEcatStatusNow
  30. {
  31. get { return _ecatStatusNow; }
  32. set { _ecatStatusNow = value; RaisePropertyChanged(); }
  33. }
  34. private int _ecatStatusLatch;
  35. /// <summary>
  36. /// Ecat总线状态锁存,0为正常,非0为异常码。只要检测到一次Ecat连接异常就不为0直到重连总线或者重启程序并连接成功
  37. /// </summary>
  38. public int MotionEcatStatusLatch
  39. {
  40. get { return _ecatStatusLatch; }
  41. set { _ecatStatusLatch = value; RaisePropertyChanged(); }
  42. }
  43. /// <summary>
  44. /// Axis对象集
  45. /// </summary>
  46. public List<MotionAxis> MotionAxises { get; set; } = new List<MotionAxis>();
  47. /// <summary>
  48. /// DI 模块集
  49. /// </summary>
  50. public List<MotionIODev> MotionDiDevs { get; set; } = new List<MotionIODev>();
  51. /// <summary>
  52. /// DO 模块集
  53. /// </summary>
  54. public List<MotionIODev> MotionDoDevs { get; set; } = new List<MotionIODev>();
  55. /// <summary>
  56. /// AO 数据点集
  57. /// </summary>
  58. public List<MotionAO> MotionAos { get; set; } = new List<MotionAO>();
  59. /// <summary>
  60. /// SDO 数据集
  61. /// </summary>
  62. public List<MotionSdo> MotionSdos { get; set; } = new List<MotionSdo>();
  63. /// <summary>
  64. /// 可写PDO数据集
  65. /// </summary>
  66. public List<MotionPdo> MotionWritePdos { get; set; } = new List<MotionPdo>();
  67. /// <summary>
  68. /// 只读PDO数据集
  69. /// </summary>
  70. public List<MotionPdo> MotionReadPdos { get; set; } = new List<MotionPdo>();
  71. public abstract MotionIO GetMotionDi(string code);
  72. public abstract MotionIO GetMotionDo(string code);
  73. public abstract MotionIO GetMotionDio(string code);
  74. public abstract MotionAO GetMotionAO(string code);
  75. public abstract MotionPdo GetMotionWritePdo(string code);
  76. public abstract MotionPdo GetMotionReadPdo(string code);
  77. public abstract MotionAxis GetMotionAxis(string axisCode);
  78. public abstract MotionAxis GetMotionAxis(short axisNo);
  79. }
  80. }