//时间:20200618 //作者:郝爽 //功能:测量参数 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using FileManager; using System.Xml; using System.IO; namespace MeasureData { public class MeasureParam : ISlo { #region 内容 //工作条件,一次测量的全部切孔都是一类的 // 样品类型 private string m_SampleName; public string SampleName { get { return this.m_SampleName; } set { this.m_SampleName = value; } } //是否仅拍照 private Boolean is_Photograph; public Boolean Is_Photograph { get { return this.is_Photograph; } set { this.is_Photograph = value; } } //是否有pt工序 private Boolean m_pt; public Boolean PT { get { return this.m_pt; } set { this.m_pt = value; } } //FIB使用的ELY文件 private string m_fibTemp; public string FIBTemp { get { return this.m_fibTemp; } set { this.m_fibTemp = value; } } //PT使用的ELY文件 private string m_ptTemp; public string PTTemp { get { return this.m_ptTemp; } set { this.m_ptTemp = value; } } //对焦方式,自动对焦还是手动对焦,手动对焦是1,自有自动对焦2,客户自动对焦3 private int m_fMode; public int FocusMode { get { return m_fMode; } set { m_fMode = value; } } //拉直操作需要的放大位数 private float stretch_Magnification; public float Stretch_Magnification { get { return this.stretch_Magnification; } set { this.stretch_Magnification = value; } } //定位切割位置的放大倍数 private float location_Magnification; public float Location_Magnification { get { return this.location_Magnification; } set { this.location_Magnification = value; } } //定位切割位置的工作电压 private float location_Voltage; public float Location_Voltage { get { return this.location_Voltage; } set { this.location_Voltage = value; } } //拍照的放大倍数 private float photograph_Magnification; public float Photograph_Magnification { get { return this.photograph_Magnification; } set { this.photograph_Magnification = value; } } //拍照的工作电压 private float photograph_Voltage; public float Photograph_Voltage { get { return this.photograph_Voltage; } set { this.photograph_Voltage = value; } } //校正角度选择 private float correction_Angle; public float Correction_Angle { get { return this.correction_Angle; } set { this.correction_Angle = value; } } //厂商 private String firm; public String Firm { get { return this.firm; } set { this.firm = value; } } //对焦参数 private FocusParam focusP; public FocusParam AutoFocus { get { return this.focusP; } set { this.focusP = value; } } //能谱参数 #endregion //构造函数 public MeasureParam() { Init(); } public void Init() { this.SampleName = @""; this.PT = false; this.FIBTemp = @""; this.PTTemp = @""; this.FocusMode = 2; this.AutoFocus = new FocusParam(); } //XML文件保存测量参数 public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode) { Slo sFile = new Slo(); //是否拍照和PT xBool isPhotograph = new xBool(); xBool ptDepostion = new xBool(); isPhotograph.AssignValue(this.is_Photograph); ptDepostion.AssignValue(this.m_pt); sFile.Register("Is_Photograph", isPhotograph); sFile.Register("PT_Depostion", ptDepostion); //ELY文件 xString ptELYFile = new xString(); xString fibELYFile = new xString(); ptELYFile.AssignValue(this.m_ptTemp); fibELYFile.AssignValue(this.m_fibTemp); sFile.Register("PT_ELYFile", ptELYFile); sFile.Register("FIB_ELYFile", fibELYFile); //对焦方式 xInt focusmode = new xInt(); focusmode.AssignValue(this.m_fMode); sFile.Register("FocusMode", focusmode); //放大倍数和电压参数 xDouble stretchMagnification = new xDouble(); xDouble locationMagnification = new xDouble(); xDouble locationVoltage = new xDouble(); xDouble photographMagnification = new xDouble(); xDouble photographVoltage = new xDouble(); stretchMagnification.AssignValue(this.stretch_Magnification); locationMagnification.AssignValue(this.location_Magnification); locationVoltage.AssignValue(this.location_Voltage); photographMagnification.AssignValue(this.photograph_Magnification); photographVoltage.AssignValue(this.photograph_Voltage); sFile.Register("Strectch_Magnification", stretchMagnification); sFile.Register("Locatio_Magnification", locationMagnification); sFile.Register("Location_Voltage", locationVoltage); sFile.Register("Photograph_Magnification", photographMagnification); sFile.Register("Photograph_Voltage", photographVoltage); //校正角度 xDouble correctionAngle = new xDouble(); correctionAngle.AssignValue(this.correction_Angle); sFile.Register("Correction_Angle", correctionAngle); //样品名称和厂商 xString sampleType = new xString(); xString _firm = new xString(); sampleType.AssignValue(this.m_SampleName); _firm.AssignValue(this.firm); sFile.Register("Sample_Type", sampleType); sFile.Register("Firm", _firm); //对焦参数 sFile.Register("Focus_Param", this.focusP); if (isStoring) { sFile.Serialize(true, xml, rootNode); } else { sFile.Serialize(false, xml, rootNode); this.is_Photograph = isPhotograph.value(); this.m_pt = ptDepostion.value(); this.m_ptTemp = ptELYFile.value(); this.m_fibTemp = fibELYFile.value(); this.m_fMode = focusmode.value(); this.stretch_Magnification = Convert.ToSingle(stretchMagnification.value()); this.location_Magnification = Convert.ToSingle(locationMagnification.value()); this.location_Voltage = Convert.ToSingle(locationVoltage.value()); this.photograph_Magnification = Convert.ToSingle(photographMagnification.value()); this.photograph_Voltage = Convert.ToSingle(photographVoltage.value()); this.correction_Angle = Convert.ToSingle(correctionAngle.value()); this.m_SampleName = sampleType.value(); this.firm = _firm.value(); } } } }