MotionCacher.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. /// DI 模块集
  42. /// </summary>
  43. public List<MotionIODev> MotionDiDevs { get; set; } = new List<MotionIODev>();
  44. /// <summary>
  45. /// DO 模块集
  46. /// </summary>
  47. public List<MotionIODev> MotionDoDevs { get; set; } = new List<MotionIODev>();
  48. /// <summary>
  49. /// AO 数据点集
  50. /// </summary>
  51. public List<MotionAO> MotionAos { get; set; } = new List<MotionAO>();
  52. /// <summary>
  53. /// SDO 数据集
  54. /// </summary>
  55. public List<MotionSdo> MotionSdos { get; set; } = new List<MotionSdo>();
  56. /// <summary>
  57. /// 可写PDO数据集
  58. /// </summary>
  59. public List<MotionPdo> MotionWritePdos { get; set; } = new List<MotionPdo>();
  60. /// <summary>
  61. /// 只读PDO数据集
  62. /// </summary>
  63. public List<MotionPdo> MotionReadPdos { get; set; } = new List<MotionPdo>();
  64. public abstract MotionIO GetMotionDi(string code);
  65. public abstract MotionIO GetMotionDo(string code);
  66. public abstract MotionIO GetMotionDio(string code);
  67. public abstract MotionAO GetMotionAO(string code);
  68. public abstract MotionPdo GetMotionWritePdo(string code);
  69. public abstract MotionPdo GetMotionReadPdo(string code);
  70. public abstract MotionAxis GetMotionAxis(string axisCode);
  71. public abstract MotionAxis GetMotionAxis(short axisNo);
  72. }
  73. }