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

104 lines
2.7 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 MainShell.Models;
using MwFramework.ManagerService;
using Stylet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MainShell.Recipe.Models
{
public class SubstrateInfo : PropertyChangedBase, IParameterItem
{
private MxSize _substrateSize = new MxSize();
public MxSize SubstrateSize
{
get { return _substrateSize; }
set { SetAndNotify(ref _substrateSize, value); }
}
private MxSize _padSize;
public MxSize PadSize
{
get { return _padSize; }
set { SetAndNotify(ref _padSize, value); }
}
private double _thickness;
public double ThickNess
{
get { return _thickness; }
set { SetAndNotify(ref _thickness, value); }
}
private double _pitchX;
public double PitchX
{
get { return _pitchX; }
set { SetAndNotify(ref _pitchX, value); }
}
private double _pitchY;
public double PitchY
{
get { return _pitchY; }
set { SetAndNotify(ref _pitchY, value); }
}
private int _rowNumber;
public int RowNumber
{
get { return _rowNumber; }
set { SetAndNotify(ref _rowNumber, value); }
}
private int _colNumber;
public int ColNumber
{
get { return _colNumber; }
set { SetAndNotify(ref _colNumber, value); }
}
private double _recheckPitch;
public double RecheckPitch
{
get { return _recheckPitch; }
set { SetAndNotify(ref _recheckPitch, value); }
}
public IParameterItem Clone()
{
// 1. 首先执行浅拷贝,复制所有值类型字段(如 Thickness, PitchX 等)
var clone = this.MemberwiseClone() as SubstrateInfo;
// 2. 手动深拷贝引用类型对象 (MxSize)
// 如果不这样做clone 和原对象将指向内存中的同一个 MxSize 实例
if (this.SubstrateSize != null)
{
clone.SubstrateSize = new MxSize
{
Width = this.SubstrateSize.Width,
Height = this.SubstrateSize.Height
};
}
if (this.PadSize != null)
{
clone.PadSize = new MxSize
{
Width = this.PadSize.Width,
Height = this.PadSize.Height
};
}
return clone;
}
}
}