Files
test_demo/MX-PD-盘古 - new/PanGu.DieBonderApp/MainShell/Recipe/ViewModel/ProcessCompensationViewModel.cs
Shi.Ji e31d3560bb 添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
2026-05-18 11:43:09 +08:00

109 lines
3.3 KiB
C#

using MainShell.Recipe.Models;
using Stylet;
namespace MainShell.Recipe.ViewModel
{
public class ProcessCompensationViewModel : PropertyChangedBase
{
private ProcessRecipe _processRecipe;
public ProcessRecipe ProcessRecipe
{
get { return _processRecipe; }
set
{
if (SetAndNotify(ref _processRecipe, value))
{
NotifyCompensationPropertiesChanged();
}
}
}
public double PhsX1Compensation
{
get { return GetCompensationParameter().PhsX1Compensation; }
set
{
ProcessAxisCompensationParameter parameter = GetCompensationParameter();
if (parameter.PhsX1Compensation == value)
{
return;
}
parameter.PhsX1Compensation = value;
NotifyOfPropertyChange(nameof(PhsX1Compensation));
}
}
public double PhsY1Compensation
{
get { return GetCompensationParameter().PhsY1Compensation; }
set
{
ProcessAxisCompensationParameter parameter = GetCompensationParameter();
if (parameter.PhsY1Compensation == value)
{
return;
}
parameter.PhsY1Compensation = value;
NotifyOfPropertyChange(nameof(PhsY1Compensation));
}
}
public double WsXCompensation
{
get { return GetCompensationParameter().WsXCompensation; }
set
{
ProcessAxisCompensationParameter parameter = GetCompensationParameter();
if (parameter.WsXCompensation == value)
{
return;
}
parameter.WsXCompensation = value;
NotifyOfPropertyChange(nameof(WsXCompensation));
}
}
public double StageYCompensation
{
get { return GetCompensationParameter().StageYCompensation; }
set
{
ProcessAxisCompensationParameter parameter = GetCompensationParameter();
if (parameter.StageYCompensation == value)
{
return;
}
parameter.StageYCompensation = value;
NotifyOfPropertyChange(nameof(StageYCompensation));
}
}
private ProcessAxisCompensationParameter GetCompensationParameter()
{
if (ProcessRecipe == null)
{
return new ProcessAxisCompensationParameter();
}
if (ProcessRecipe.ProcessAxisCompensationParameter == null)
{
ProcessRecipe.ProcessAxisCompensationParameter = new ProcessAxisCompensationParameter();
}
return ProcessRecipe.ProcessAxisCompensationParameter;
}
private void NotifyCompensationPropertiesChanged()
{
NotifyOfPropertyChange(nameof(PhsX1Compensation));
NotifyOfPropertyChange(nameof(PhsY1Compensation));
NotifyOfPropertyChange(nameof(WsXCompensation));
NotifyOfPropertyChange(nameof(StageYCompensation));
}
}
}