using Prism.Mvvm;
using SKMC.Api.Motion.Control;
using SKMC.Api.Motion.Driver;
using SKMC.Api.Motion.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace SKMC.Api.Motion
{
///
/// 运动控制缓存
///
public abstract class MotionCacher : BindableBase
{
public IMotionDriver MotionDriver { get; set; }
public IMotionDriverAdvance MotionDriverAdvance { get; set; }
public IMotionControl MotionControl { get; set; }
private int _ecatStatusNow;
///
/// Ecat总线当前状态,0为正常,非0为异常码
///
public int MotionEcatStatusNow
{
get { return _ecatStatusNow; }
set { _ecatStatusNow = value; RaisePropertyChanged(); }
}
private int _ecatStatusLatch;
///
/// Ecat总线状态锁存,0为正常,非0为异常码。只要检测到一次Ecat连接异常就不为0直到重连总线或者重启程序并连接成功
///
public int MotionEcatStatusLatch
{
get { return _ecatStatusLatch; }
set { _ecatStatusLatch = value; RaisePropertyChanged(); }
}
///
/// Axis对象集
///
public List MotionAxises { get; set; } = new List();
///
/// Axis轨迹运动数据集
///
//public List MotionTrajects { get; set; } = new List();
///
/// DI 模块集
///
public List MotionDiDevs { get; set; } = new List();
///
/// DO 模块集
///
public List MotionDoDevs { get; set; } = new List();
///
/// AO 数据点集
///
public List MotionAos { get; set; } = new List();
///
/// SDO 数据集
///
public List MotionSdos { get; set; } = new List();
///
/// 可写PDO数据集
///
public List MotionWritePdos { get; set; } = new List();
///
/// 只读PDO数据集
///
public List MotionReadPdos { get; set; } = new List();
public abstract MotionIO GetMotionDi(string code);
public abstract MotionIO GetMotionDo(string code);
public abstract MotionIO GetMotionDio(string code);
public abstract MotionAO GetMotionAO(string code);
public abstract MotionPdo GetMotionWritePdo(string code);
public abstract MotionPdo GetMotionReadPdo(string code);
[Obsolete("此方法已废弃")]
public abstract void SetMotionDi(string code, byte value, bool testMode = false);
[Obsolete("此方法已废弃")]
public abstract void SetMotionDo(string code, byte value, bool testMode = false);
public abstract MotionAxis GetMotionAxis(string axisCode);
public abstract MotionAxis GetMotionAxis(short axisNo);
}
}