using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using TeamAAS.Global.Devices;
using TeamAAS.Motion.AdapterFactorys;
using TeamAAS.Motion.Interfaces;
using TeamAAS.Motion.Models;
using TeamAAS.Motion.Motions;
namespace TeamAAS.Motion
{
///
/// 运动控制设备管理器(懒汉单例)。
/// 职责:加载/保存 Config\MotionDevices.json;按配置实例化品牌适配器(仿真/雷赛/固高/IMC60G/GR20T);
/// 对上层(主程序状态栏、流程节点、调试页)提供统一的 IMotionCard/IIOCard 访问。
/// 与 CameraManager/RobotManager 同构:App 启动时 LoadConfig,退出时 CloseAll。
///
public class MotionManager
{
private static MotionManager _instance;
public static MotionManager Instance => _instance ?? (_instance = new MotionManager());
private DevicePluginManager _DevicePluginManager=new DevicePluginManager();
public DevicePluginManager DevicePluginManager { get => _DevicePluginManager; set => _DevicePluginManager = value; }
private readonly object _sync = new object();
/// 全部运动/IO 设备实例(含运动卡与 IO 卡)。
public List