MotionDeviceConfig.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using TeamAAS.Global.Devices;
  5. namespace TeamAAS.Motion
  6. {
  7. /// <summary>运动/IO 设备类型(品牌适配器按类型注册)。</summary>
  8. public enum MotionDeviceType
  9. {
  10. /// <summary>仿真运动卡(无硬件可用,联调/演示)。</summary>
  11. 仿真运动卡 = 0,
  12. /// <summary>仿真 IO 卡(16进/16出,无硬件可用)。</summary>
  13. 仿真IO卡 = 1,
  14. /// <summary>雷赛运动控制卡(待适配)。</summary>
  15. 雷赛运动卡 = 10,
  16. /// <summary>固高运动控制卡(待适配)。</summary>
  17. 固高运动卡 = 11,
  18. /// <summary>IMC60G 系列 PCIe 运动控制板卡(待适配)。</summary>
  19. IMC60G运动卡 = 12,
  20. /// <summary>GR20T-ECT-1616ETN EtherCAT IO 模块(待适配)。</summary>
  21. GR20T_IO模块 = 13,
  22. }
  23. /// <summary>单台运动/IO 设备的配置(持久化为 Config\MotionDevices.json)。</summary>
  24. [Serializable]
  25. public class MotionDeviceConfig
  26. {
  27. /// <summary>设备名称(唯一,状态栏/绑定树显示用)。</summary>
  28. [DisplayName("设备名称")]
  29. [Description("设备唯一名称")]
  30. public string Name { get; set; } = "运动卡1";
  31. /// <summary>设备类型(决定实例化哪个品牌适配器)。</summary>
  32. [DisplayName("设备类型")]
  33. [Description("品牌/型号适配器类型")]
  34. public MotionDeviceType DeviceType { get; set; } = MotionDeviceType.仿真运动卡;
  35. /// <summary>板卡号/设备号(品牌适配器解释,如卡号 0)。</summary>
  36. [DisplayName("板卡号")]
  37. [Description("品牌适配器的板卡/设备索引")]
  38. public int BoardIndex { get; set; } = 0;
  39. /// <summary>轴数量(IO 卡忽略)。</summary>
  40. [DisplayName("轴数量")]
  41. [Description("运动卡轴数量")]
  42. public int AxisCount { get; set; } = 4;
  43. /// <summary>输入点数(IO 卡用)。</summary>
  44. [DisplayName("输入点数")]
  45. [Description("IO 卡输入点数量")]
  46. public int InputCount { get; set; } = 16;
  47. /// <summary>输出点数(IO 卡用)。</summary>
  48. [DisplayName("输出点数")]
  49. [Description("IO 卡输出点数量")]
  50. public int OutputCount { get; set; } = 16;
  51. /// <summary>连接参数(IP/串口等,品牌适配器解释;EtherCAT 模块填 ENI/IP)。</summary>
  52. [DisplayName("连接参数")]
  53. [Description("IP / 串口 / EtherCAT 配置等,由品牌适配器解释")]
  54. public string ConnectionString { get; set; } = "";
  55. }
  56. }