Feiyu/Model/MotionControl/HomePer.cs
2025-12-10 17:55:48 +08:00

212 lines
5.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Community;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.MotionControl
{
public class HomePer : NotificationObject
{
public int ID { get; set; }
/// <summary>
/// 轴ID
/// </summary>
public int AxisID { get; set; }
#region 回原点模式 (0:一次回零/1:一次回零加回找/2:二次回零)
private ushort mode;
/// <summary>
/// 雷赛回原点模式 (0:一次回零/1:一次回零加回找/2:二次回零)
/// 正运动回原点模式 (0:z相正向回零 1:z相负向回零/2:原点正向回零+回找 3:原点负向回零+回找 4:原点正向回零 5:原点负向回零)
/// </summary>
public ushort Mode
{
get { return mode; }
set
{
mode = value;
this.RaisePropertyChanged("Mode");
}
}
#endregion
#region 原点有效电平 (0=L/1=H)
private ushort logic;
/// <summary>
/// 原点有效电平 (0=L/1=H)
/// </summary>
public ushort Logic
{
get { return logic; }
set
{
logic = value;
this.RaisePropertyChanged("Logic");
}
}
#endregion
#region 回原点速度模式 0:低速1:高速
private ushort speedMode;
/// <summary>
/// 回原点速度模式 0:低速1:高速
/// </summary>
public ushort SpeedMode
{
get { return speedMode; }
set
{
speedMode = value;
this.RaisePropertyChanged("SpeedMode");
}
}
#endregion
#region 回原点的方向0:正1:负
private ushort direction;
/// <summary>
/// 回原点的方向0:正1:负
/// </summary>
public ushort Direction
{
get { return direction; }
set
{
direction = value;
this.RaisePropertyChanged("Direction");
}
}
#endregion
#region 原点完成后重置坐标方法(0:不重置/1:先重置再定位/2:定位后重置)
private ushort resetMode;
/// <summary>
/// 原点归零模式(0:不重置/1:先重置再定位/2:定位后重置)
/// </summary>
public ushort ResetMode
{
get { return resetMode; }
set
{
resetMode = value;
this.RaisePropertyChanged("ResetMode");
}
}
#endregion
#region 起始速度
private double startSpeed;
/// <summary>
/// 起始速度
/// </summary>
public double StartSpeed
{
get { return startSpeed; }
set
{
startSpeed = value;
this.RaisePropertyChanged("StartSpeed");
}
}
#endregion
#region 运行速度
private double runSpeed;
/// <summary>
/// 运行速度
/// </summary>
public double RunSpeed
{
get { return runSpeed; }
set
{
runSpeed = value;
this.RaisePropertyChanged("RunSpeed");
}
}
#endregion
#region 停止速度
private double stopSpeed;
/// <summary>
/// 停止速度
/// </summary>
public double StopSpeed
{
get { return stopSpeed; }
set
{
stopSpeed = value;
this.RaisePropertyChanged("StopSpeed");
}
}
#endregion
#region 加速时间
private double accTime;
/// <summary>
/// 加速时间
/// </summary>
public double AccTime
{
get { return accTime; }
set
{
accTime = value;
this.RaisePropertyChanged("AccTime");
}
}
#endregion
#region 减速时间
private double decTime;
/// <summary>
/// 减速时间
/// </summary>
public double DecTime
{
get { return decTime; }
set
{
decTime = value;
this.RaisePropertyChanged("DecTime");
}
}
#endregion
private double sramp;
/// <summary>
/// S曲线时间 用于加减速平滑 单位未毫秒0-250
/// </summary>
public double Sramp
{
get { return sramp; }
set
{
sramp = value;
this.RaisePropertyChanged("Sramp");
}
}
public HomePer()
{
Logic = 0;
Mode = 2;
SpeedMode = 0;
Direction = 0;
ResetMode = 2;
StartSpeed = 100;
RunSpeed = 1000;
StopSpeed = 0;
AccTime = 0.05;
DecTime = 0.05;
}
}
}