MotionCacher.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. namespace SKMC.Api.Motion
  9. {
  10. /// <summary>
  11. /// 运动控制缓存
  12. /// </summary>
  13. public abstract class MotionCacher : BindableBase
  14. {
  15. public IMotionDriver MotionDriver { get; set; }
  16. public IMotionDriverAdvance MotionDriverAdvance { get; set; }
  17. public IMotionControl MotionControl { get; set; }
  18. private int _ecatStatusNow;
  19. /// <summary>
  20. /// Ecat总线当前状态,0为正常,非0为异常码
  21. /// </summary>
  22. public int MotionEcatStatusNow
  23. {
  24. get { return _ecatStatusNow; }
  25. set { _ecatStatusNow = value; RaisePropertyChanged(); }
  26. }
  27. private int _ecatStatusLatch;
  28. /// <summary>
  29. /// Ecat总线状态锁存,0为正常,非0为异常码。只要检测到一次Ecat连接异常就不为0直到重连总线或者重启程序并连接成功
  30. /// </summary>
  31. public int MotionEcatStatusLatch
  32. {
  33. get { return _ecatStatusLatch; }
  34. set { _ecatStatusLatch = value; RaisePropertyChanged(); }
  35. }
  36. /// <summary>
  37. /// Axis对象集
  38. /// </summary>
  39. public List<MotionAxis> MotionAxises { get; set; } = new List<MotionAxis>();
  40. /// <summary>
  41. /// Axis轨迹运动数据集
  42. /// </summary>
  43. //public List<MotionTraject> MotionTrajects { get; set; } = new List<MotionTraject>();
  44. /// <summary>
  45. /// DI 模块集
  46. /// </summary>
  47. public List<MotionIODev> MotionDiDevs { get; set; } = new List<MotionIODev>();
  48. /// <summary>
  49. /// DO 模块集
  50. /// </summary>
  51. public List<MotionIODev> MotionDoDevs { get; set; } = new List<MotionIODev>();
  52. /// <summary>
  53. /// AO 数据点集
  54. /// </summary>
  55. public List<MotionAO> MotionAos { get; set; } = new List<MotionAO>();
  56. /// <summary>
  57. /// SDO 数据集
  58. /// </summary>
  59. public List<MotionSdo> MotionSdos { get; set; } = new List<MotionSdo>();
  60. /// <summary>
  61. /// 可写PDO数据集
  62. /// </summary>
  63. public List<MotionPdo> MotionWritePdos { get; set; } = new List<MotionPdo>();
  64. /// <summary>
  65. /// 只读PDO数据集
  66. /// </summary>
  67. public List<MotionPdo> MotionReadPdos { get; set; } = new List<MotionPdo>();
  68. public abstract MotionIO GetMotionDi(string code);
  69. public abstract MotionIO GetMotionDo(string code);
  70. public abstract MotionIO GetMotionDio(string code);
  71. public abstract MotionAO GetMotionAO(string code);
  72. public abstract MotionPdo GetMotionWritePdo(string code);
  73. public abstract MotionPdo GetMotionReadPdo(string code);
  74. [Obsolete("此方法已废弃")]
  75. public abstract void SetMotionDi(string code, byte value, bool testMode = false);
  76. [Obsolete("此方法已废弃")]
  77. public abstract void SetMotionDo(string code, byte value, bool testMode = false);
  78. public abstract MotionAxis GetMotionAxis(string axisCode);
  79. public abstract MotionAxis GetMotionAxis(short axisNo);
  80. }
  81. }