|
@@ -92,7 +92,7 @@ namespace HOZProject
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- #region 加载PT模板文件,生成切孔列表
|
|
|
+ #region 加载PT模板文件
|
|
|
private void pbTemplateFile_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
string FilePathName;
|
|
@@ -110,12 +110,12 @@ namespace HOZProject
|
|
|
{
|
|
|
FilePathName = System.IO.Path.GetFullPath(pOpenFileDialog.FileName); //绝对路径
|
|
|
fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(FilePathName);
|
|
|
- this.txtWPTF.Text = fileNameWithoutExtension;
|
|
|
+ this.txtWPTF.Text = FilePathName;
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- #region 加载FIB模板文件,生成切孔列表
|
|
|
+ #region 加载FIB模板文件
|
|
|
private void pbFIBTemplateFile_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
string FilePathName;
|
|
@@ -133,7 +133,7 @@ namespace HOZProject
|
|
|
{
|
|
|
FilePathName = System.IO.Path.GetFullPath(pOpenFileDialog.FileName); //绝对路径
|
|
|
fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(FilePathName);
|
|
|
- this.txtWFIBF.Text = fileNameWithoutExtension;
|
|
|
+ this.txtWFIBF.Text = FilePathName;
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -145,11 +145,11 @@ namespace HOZProject
|
|
|
}
|
|
|
private void SaveTemplateFile()
|
|
|
{
|
|
|
- ConfigFile cfm = new ConfigFile();
|
|
|
+ MeasureParam cfm = new MeasureParam();
|
|
|
cfm.Is_Photograph = chkWIsP.Checked;
|
|
|
- cfm.PT_Depostion = chkWPT.Checked;
|
|
|
- cfm.PT_ELYFile = txtWPTF.Text;
|
|
|
- cfm.FIB_ELYFile = txtWFIBF.Text;
|
|
|
+ cfm.PT = chkWPT.Checked;
|
|
|
+ cfm.PTTemp = txtWPTF.Text;
|
|
|
+ cfm.FIBTemp = txtWFIBF.Text;
|
|
|
cfm.Stretch_Magnification = Convert.ToDouble(cbbWLZ.Text);
|
|
|
cfm.Location_Magnification = Convert.ToDouble(cbbWQGF.Text);
|
|
|
cfm.Location_Voltage = Convert.ToDouble(cbbWQGD.Text);
|
|
@@ -164,14 +164,14 @@ namespace HOZProject
|
|
|
cfm.Correction_Angle = 54.0;
|
|
|
}
|
|
|
|
|
|
- cfm.Sample_Type = cbbWYP.Text;
|
|
|
+ cfm.SampleName = cbbWYP.Text;
|
|
|
cfm.Firm = cbbWCS.Text;
|
|
|
-
|
|
|
+ ConfigFile cf = new ConfigFile(cfm);
|
|
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
|
saveFileDialog.Filter = "样品参数文件|*.cfg";
|
|
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
|
|
{
|
|
|
- cfm.Save(saveFileDialog.FileName);
|
|
|
+ cf.Save(saveFileDialog.FileName);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -243,11 +243,11 @@ namespace HOZProject
|
|
|
config.AppSettings.Settings["WLZ"].Value = wWLZ;
|
|
|
}
|
|
|
|
|
|
- ConfigFile cfm = new ConfigFile();
|
|
|
+ MeasureParam cfm = new MeasureParam();
|
|
|
cfm.Is_Photograph = chkWIsP.Checked;
|
|
|
- cfm.PT_Depostion = chkWPT.Checked;
|
|
|
- cfm.PT_ELYFile = txtWPTF.Text;
|
|
|
- cfm.FIB_ELYFile = txtWFIBF.Text;
|
|
|
+ cfm.PT = chkWPT.Checked;
|
|
|
+ cfm.PTTemp = txtWPTF.Text;
|
|
|
+ cfm.FIBTemp = txtWFIBF.Text;
|
|
|
cfm.Stretch_Magnification = Convert.ToDouble(cbbWLZ.Text);
|
|
|
cfm.Location_Magnification = Convert.ToDouble(cbbWQGF.Text);
|
|
|
cfm.Location_Voltage = Convert.ToDouble(cbbWQGD.Text);
|
|
@@ -261,26 +261,25 @@ namespace HOZProject
|
|
|
{
|
|
|
cfm.Correction_Angle = 54.0;
|
|
|
}
|
|
|
- cfm.Sample_Type = cbbWYP.Text;
|
|
|
- cfm.Firm = cbbWCS.Text;
|
|
|
|
|
|
+ cfm.SampleName = cbbWYP.Text;
|
|
|
+ cfm.Firm = cbbWCS.Text;
|
|
|
//设置配置文件默认值
|
|
|
config.AppSettings.Settings["Is_Photograph"].Value = cfm.Is_Photograph.ToString();
|
|
|
- config.AppSettings.Settings["PT_Depostion"].Value = cfm.PT_Depostion.ToString();
|
|
|
- config.AppSettings.Settings["PT_ELYFile"].Value = cfm.PT_ELYFile;
|
|
|
- config.AppSettings.Settings["FIB_ELYFile"].Value = cfm.FIB_ELYFile;
|
|
|
+ config.AppSettings.Settings["PT_Depostion"].Value = cfm.PT.ToString();
|
|
|
+ config.AppSettings.Settings["PT_ELYFile"].Value = cfm.PTTemp;
|
|
|
+ config.AppSettings.Settings["FIB_ELYFile"].Value = cfm.FIBTemp;
|
|
|
config.AppSettings.Settings["Stretch_Magnification"].Value = cfm.Stretch_Magnification.ToString();
|
|
|
config.AppSettings.Settings["Location_Magnification"].Value = cfm.Location_Magnification.ToString();
|
|
|
config.AppSettings.Settings["Location_Voltage"].Value = cfm.Location_Voltage.ToString();
|
|
|
config.AppSettings.Settings["Photograph_Magnification"].Value = cfm.Photograph_Magnification.ToString();
|
|
|
config.AppSettings.Settings["Photograph_Voltage"].Value = cfm.Photograph_Voltage.ToString();
|
|
|
config.AppSettings.Settings["Correction_Angle"].Value = cfm.Correction_Angle.ToString();
|
|
|
- config.AppSettings.Settings["Sample_Type"].Value = cfm.Sample_Type;
|
|
|
- config.AppSettings.Settings["Firm"].Value = cfm.Firm;
|
|
|
+ config.AppSettings.Settings["SampleName"].Value = cfm.SampleName;
|
|
|
+ config.AppSettings.Settings["Firms"].Value = cfm.Firm;
|
|
|
|
|
|
config.Save(ConfigurationSaveMode.Modified);
|
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
|
- ReloadConfig();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -380,13 +379,13 @@ namespace HOZProject
|
|
|
cbbWQGF.Items.Clear();
|
|
|
cbbWLZ.Items.Clear();
|
|
|
|
|
|
- string sample_Type = config.AppSettings.Settings["Sample_Type"].ToString();
|
|
|
- string firm = config.AppSettings.Settings["Firm"].ToString();
|
|
|
- string WPZDTemp = config.AppSettings.Settings["WPZD"].ToString();
|
|
|
- string WPZFTemp = config.AppSettings.Settings["WPZF"].ToString();
|
|
|
- string WQGDTemp = config.AppSettings.Settings["WQGD"].ToString();
|
|
|
- string WQGFTemp = config.AppSettings.Settings["WQGF"].ToString();
|
|
|
- string WLZTemp = config.AppSettings.Settings["WLZ"].ToString();
|
|
|
+ string sample_Type = config.AppSettings.Settings["Sample_Type"].Value.ToString();
|
|
|
+ string firm = config.AppSettings.Settings["Firm"].Value.ToString();
|
|
|
+ string WPZDTemp = config.AppSettings.Settings["WPZD"].Value.ToString();
|
|
|
+ string WPZFTemp = config.AppSettings.Settings["WPZF"].Value.ToString();
|
|
|
+ string WQGDTemp = config.AppSettings.Settings["WQGD"].Value.ToString();
|
|
|
+ string WQGFTemp = config.AppSettings.Settings["WQGF"].Value.ToString();
|
|
|
+ string WLZTemp = config.AppSettings.Settings["WLZ"].Value.ToString();
|
|
|
//样品类型
|
|
|
sT = sample_Type.Split(',');
|
|
|
BindComboxData(cbbWYP, sT);
|
|
@@ -408,15 +407,20 @@ namespace HOZProject
|
|
|
//拉直操作放大位数
|
|
|
WLZ = WLZTemp.Split(',');
|
|
|
BindComboxData(cbbWLZ, WLZ);
|
|
|
-
|
|
|
- cbbWYP.SelectedIndex = 0;
|
|
|
- cbbWCS.SelectedIndex = 0;
|
|
|
- cbbWXZ.SelectedIndex = 0;
|
|
|
- cbbWPZD.SelectedIndex = 0;
|
|
|
- cbbWPZF.SelectedIndex = 0;
|
|
|
- cbbWLZ.SelectedIndex = 0;
|
|
|
- cbbWQGD.SelectedIndex = 0;
|
|
|
- cbbWQGF.SelectedIndex = 0;
|
|
|
+
|
|
|
+ //设置配置文件默认值
|
|
|
+ chkWIsP.Checked=Convert.ToBoolean(config.AppSettings.Settings["Is_Photograph"].Value);
|
|
|
+ chkWPT.Checked = Convert.ToBoolean(config.AppSettings.Settings["PT_Depostion"].Value);
|
|
|
+ txtWPTF.Text = config.AppSettings.Settings["PT_ELYFile"].Value;
|
|
|
+ txtWFIBF.Text = config.AppSettings.Settings["FIB_ELYFile"].Value;
|
|
|
+ cbbWLZ.Text = config.AppSettings.Settings["Stretch_Magnification"].Value;
|
|
|
+ cbbWQGF.Text = config.AppSettings.Settings["Location_Magnification"].Value;
|
|
|
+ cbbWQGD.Text = config.AppSettings.Settings["Location_Voltage"].Value;
|
|
|
+ cbbWPZF.Text = config.AppSettings.Settings["Photograph_Magnification"].Value;
|
|
|
+ cbbWPZD.Text = config.AppSettings.Settings["Photograph_Voltage"].Value;
|
|
|
+ cbbWXZ.Text = config.AppSettings.Settings["Correction_Angle"].Value;
|
|
|
+ cbbWYP.Text = config.AppSettings.Settings["SampleName"].Value;
|
|
|
+ cbbWCS.Text = config.AppSettings.Settings["Firms"].Value;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -427,20 +431,20 @@ namespace HOZProject
|
|
|
if (!ReadConfigPath.Equals(""))
|
|
|
{
|
|
|
ReloadConfig();
|
|
|
- ConfigFile cfm = new ConfigFile();
|
|
|
+ ConfigFile cfm = new ConfigFile(new MeasureParam());
|
|
|
cfm.Read(ReadConfigPath);
|
|
|
- chkWIsP.Checked = cfm.Is_Photograph;
|
|
|
- chkWPT.Checked = cfm.PT_Depostion;
|
|
|
- txtWPTF.Text = cfm.PT_ELYFile;
|
|
|
- txtWFIBF.Text = cfm.FIB_ELYFile;
|
|
|
- cbbWLZ.Text = cfm.Stretch_Magnification.ToString();
|
|
|
- cbbWQGF.Text = cfm.Location_Magnification.ToString();
|
|
|
- cbbWQGD.Text = cfm.Location_Voltage.ToString();
|
|
|
- cbbWPZF.Text = cfm.Photograph_Magnification.ToString();
|
|
|
- cbbWPZD.Text = cfm.Photograph_Voltage.ToString();
|
|
|
- cbbWXZ.Text = cfm.Correction_Angle.ToString();
|
|
|
- cbbWYP.Text = cfm.Sample_Type;
|
|
|
- cbbWCS.Text = cfm.Firm;
|
|
|
+ chkWIsP.Checked = cfm.m_Config.Is_Photograph;
|
|
|
+ chkWPT.Checked = cfm.m_Config.PT;
|
|
|
+ txtWPTF.Text = cfm.m_Config.PTTemp;
|
|
|
+ txtWFIBF.Text = cfm.m_Config.FIBTemp;
|
|
|
+ cbbWLZ.Text = cfm.m_Config.Stretch_Magnification.ToString();
|
|
|
+ cbbWQGF.Text = cfm.m_Config.Location_Magnification.ToString();
|
|
|
+ cbbWQGD.Text = cfm.m_Config.Location_Voltage.ToString();
|
|
|
+ cbbWPZF.Text = cfm.m_Config.Photograph_Magnification.ToString();
|
|
|
+ cbbWPZD.Text = cfm.m_Config.Photograph_Voltage.ToString();
|
|
|
+ cbbWXZ.Text = cfm.m_Config.Correction_Angle.ToString();
|
|
|
+ cbbWYP.Text = cfm.m_Config.SampleName;
|
|
|
+ cbbWCS.Text = cfm.m_Config.Firm;
|
|
|
}
|
|
|
}
|
|
|
#endregion
|