|
@@ -283,7 +283,14 @@ namespace HOZProject
|
|
|
#region 创建与读取样品参数、配置文件
|
|
|
private void btnCreateConfig_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- SaveTemplateFile();
|
|
|
+ if (Convert.ToInt32(cbbWFIB.Text) < 200)
|
|
|
+ {
|
|
|
+ MessageBox.Show("FIB最小放大倍数为200倍");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SaveTemplateFile();
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取测量参数,初始化窗体中的控件信息
|
|
@@ -350,7 +357,17 @@ namespace HOZProject
|
|
|
if (!Directory.Exists(m_TemplateFilePath))
|
|
|
{
|
|
|
//创建路径
|
|
|
- Directory.CreateDirectory(m_TemplateFilePath);
|
|
|
+ //Directory.CreateDirectory(m_TemplateFilePath);
|
|
|
+ FolderBrowserDialog dialog = new FolderBrowserDialog();
|
|
|
+ dialog.Description = "请选择文件路径";
|
|
|
+ //dialog.RootFolder = Environment.SpecialFolder.Programs;
|
|
|
+ if (dialog.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ m_TemplateFilePath = dialog.SelectedPath;
|
|
|
+ config.AppSettings.Settings["TemplateFilePath"].Value = m_TemplateFilePath;
|
|
|
+ config.Save(ConfigurationSaveMode.Modified);
|
|
|
+ ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
@@ -692,9 +709,16 @@ namespace HOZProject
|
|
|
/// <param name="e"></param>
|
|
|
private void btnSaveDefalutPara_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (EditConfig())
|
|
|
+ if (Convert.ToInt32(cbbWFIB.Text) < 200)
|
|
|
+ {
|
|
|
+ MessageBox.Show("FIB最小放大倍数为200倍");
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ if (EditConfig())
|
|
|
+ {
|
|
|
+ MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
#endregion
|