Quellcode durchsuchen

加载配置与导入模板文件

wb_han vor 5 Jahren
Ursprung
Commit
d8dd82003a

+ 5 - 5
HOZProject/App.config

@@ -17,16 +17,16 @@
       <!--定位切割位置的放大倍数_数据源-->
       <add key="WQGF" value="100,200,300"/>
       <!--拉直操作需要的放大倍数_数据源-->
-      <add key="WLZ" value="类型A,类型B,类型C"/>
+      <add key="WLZ" value="100,200,300"/>
       <add key="ConfigFilePath" value="E:/ConfigFile"/>
       <!--PT使用的ELY文件-->
       <add key="PT_ELYFile" value=""/>
       <!--FIB使用的ELY文件-->
       <add key="FIB_ELYFile" value=""/>
       <!--拉直操作需要的放大倍数-->
-      <add key="Strectch_Magnification" value=""/>
+      <add key="Stretch_Magnification" value=""/>
       <!--定位切割位置的放大倍数-->
-      <add key="Locatio_Magnification" value=""/>
+      <add key="Location_Magnification" value=""/>
       <!--定位切割位置的工作电压-->
       <add key="Location_Voltage" value=""/>
       <!--拍照的放大倍数-->
@@ -36,9 +36,9 @@
       <!--校正角度选择-->
       <add key="Correction_Angle" value=""/>
       <!--样品类型-->
-      <add key="Sample_Type" value=""/>
+      <add key="SampleName" value=""/>
       <!--厂商-->
-      <add key="Firm" value=""/>
+      <add key="Firms" value=""/>
       <!--是否仅拍照-->
       <add key="Is_Photograph" value=""/>
       <!--是否PT沉积-->

+ 11 - 10
HOZProject/FormHOZMain.Designer.cs

@@ -183,8 +183,8 @@
             this.plTop.Controls.Add(this.pbLog);
             this.plTop.Controls.Add(this.pbInit);
             this.plTop.Controls.Add(this.pbSave);
-            this.plTop.Controls.Add(this.pbNew);
             this.plTop.Controls.Add(this.pbOpen);
+            this.plTop.Controls.Add(this.pbNew);
             this.plTop.Dock = System.Windows.Forms.DockStyle.Top;
             this.plTop.Location = new System.Drawing.Point(0, 0);
             this.plTop.Name = "plTop";
@@ -196,7 +196,7 @@
             this.pbStop.BackgroundImage = global::HOZProject.Properties.Resources.Stop;
             this.pbStop.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStop.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbStop.Location = new System.Drawing.Point(595, 6);
+            this.pbStop.Location = new System.Drawing.Point(521, 4);
             this.pbStop.Name = "pbStop";
             this.pbStop.Size = new System.Drawing.Size(68, 71);
             this.pbStop.TabIndex = 8;
@@ -208,7 +208,7 @@
             this.pbPause.BackgroundImage = global::HOZProject.Properties.Resources.Pause;
             this.pbPause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbPause.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbPause.Location = new System.Drawing.Point(521, 6);
+            this.pbPause.Location = new System.Drawing.Point(447, 4);
             this.pbPause.Name = "pbPause";
             this.pbPause.Size = new System.Drawing.Size(68, 71);
             this.pbPause.TabIndex = 8;
@@ -219,7 +219,7 @@
             this.pbStart.BackgroundImage = global::HOZProject.Properties.Resources.Start;
             this.pbStart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStart.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbStart.Location = new System.Drawing.Point(447, 6);
+            this.pbStart.Location = new System.Drawing.Point(373, 4);
             this.pbStart.Name = "pbStart";
             this.pbStart.Size = new System.Drawing.Size(68, 71);
             this.pbStart.TabIndex = 8;
@@ -276,7 +276,7 @@
             this.pbImportTemplateFile.BackgroundImage = global::HOZProject.Properties.Resources.ImportConfigFile;
             this.pbImportTemplateFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbImportTemplateFile.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbImportTemplateFile.Location = new System.Drawing.Point(374, 6);
+            this.pbImportTemplateFile.Location = new System.Drawing.Point(300, 4);
             this.pbImportTemplateFile.Name = "pbImportTemplateFile";
             this.pbImportTemplateFile.Size = new System.Drawing.Size(68, 71);
             this.pbImportTemplateFile.TabIndex = 6;
@@ -288,7 +288,7 @@
             this.pbLog.BackgroundImage = global::HOZProject.Properties.Resources.Log;
             this.pbLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbLog.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbLog.Location = new System.Drawing.Point(301, 6);
+            this.pbLog.Location = new System.Drawing.Point(227, 4);
             this.pbLog.Name = "pbLog";
             this.pbLog.Size = new System.Drawing.Size(68, 71);
             this.pbLog.TabIndex = 6;
@@ -300,7 +300,7 @@
             this.pbInit.BackgroundImage = global::HOZProject.Properties.Resources.init;
             this.pbInit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbInit.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbInit.Location = new System.Drawing.Point(227, 6);
+            this.pbInit.Location = new System.Drawing.Point(153, 4);
             this.pbInit.Name = "pbInit";
             this.pbInit.Size = new System.Drawing.Size(68, 71);
             this.pbInit.TabIndex = 5;
@@ -312,7 +312,7 @@
             this.pbSave.BackgroundImage = global::HOZProject.Properties.Resources.save;
             this.pbSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbSave.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbSave.Location = new System.Drawing.Point(153, 6);
+            this.pbSave.Location = new System.Drawing.Point(79, 4);
             this.pbSave.Name = "pbSave";
             this.pbSave.Size = new System.Drawing.Size(68, 71);
             this.pbSave.TabIndex = 4;
@@ -324,11 +324,12 @@
             this.pbNew.BackgroundImage = global::HOZProject.Properties.Resources.New;
             this.pbNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbNew.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbNew.Location = new System.Drawing.Point(5, 6);
+            this.pbNew.Location = new System.Drawing.Point(5, 4);
             this.pbNew.Name = "pbNew";
             this.pbNew.Size = new System.Drawing.Size(68, 71);
             this.pbNew.TabIndex = 3;
             this.pbNew.TabStop = false;
+            this.pbNew.Visible = false;
             this.pbNew.Click += new System.EventHandler(this.pbNew_Click);
             // 
             // pbOpen
@@ -336,7 +337,7 @@
             this.pbOpen.BackgroundImage = global::HOZProject.Properties.Resources.open;
             this.pbOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbOpen.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbOpen.Location = new System.Drawing.Point(79, 6);
+            this.pbOpen.Location = new System.Drawing.Point(5, 4);
             this.pbOpen.Name = "pbOpen";
             this.pbOpen.Size = new System.Drawing.Size(68, 71);
             this.pbOpen.TabIndex = 3;

+ 1 - 2
HOZProject/FormHOZMain.cs

@@ -249,6 +249,7 @@ namespace HOZProject
             {
                 //清空切孔列表用户控件
                 plLeftContent.Controls.Clear();
+                //加载配置文件
             }
         }
 
@@ -447,7 +448,5 @@ namespace HOZProject
                 uControl_Init.ReadConfigInfo();
             }
         }
-
-        
     }
 }

+ 14 - 12
HOZProject/FormUnitControl.cs

@@ -1398,11 +1398,11 @@ namespace HOZProject
 
         private void btnCreateConfig_Click(object sender, EventArgs e)
         {
-            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);
@@ -1417,11 +1417,12 @@ 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);
             
-            cfm.Save(@"E:\test.cfg");
+            cf.Save(@"E:\test.cfg");
 
             List<String> _sT = sT.ToList();
             if(_sT.IndexOf(cbbWYP.Text)<0)
@@ -1456,19 +1457,20 @@ namespace HOZProject
 
         private void btnReadConfig_Click(object sender, EventArgs e)
         {
-            ConfigFile cfm = new ConfigFile();
-            cfm.Read(@"E:\test.cfg");
+            MeasureParam cfm = new MeasureParam();
+            ConfigFile cf = new ConfigFile(cfm);
+            cf.Read(@"E:\test.cfg");
             chkRIsP.Checked = cfm.Is_Photograph;
-            chkRPT.Checked = cfm.PT_Depostion;
-            txtRPTF.Text = cfm.PT_ELYFile;
-            txtRFIBF.Text = cfm.FIB_ELYFile;
+            chkRPT.Checked = cfm.PT;
+            txtRPTF.Text = cfm.PTTemp;
+            txtRFIBF.Text = cfm.FIBTemp;
             txtRLZ.Text = cfm.Stretch_Magnification.ToString();
             txtRQGF.Text = cfm.Location_Magnification.ToString();
             txtRQGD.Text = cfm.Location_Voltage.ToString();
             txtRPZF.Text = cfm.Photograph_Magnification.ToString();
             txtRPZD.Text = cfm.Photograph_Voltage.ToString();
             txtRXZ.Text = cfm.Correction_Angle.ToString();
-            txtRYP.Text = cfm.Sample_Type;
+            txtRYP.Text = cfm.SampleName;
             txtRCS.Text = cfm.Firm;
 
         }

+ 56 - 52
HOZProject/UserControls/UControl_Init.cs

@@ -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

+ 27 - 126
MeasureData/ConfigFile.cs

@@ -13,111 +13,12 @@ namespace MeasureData
     public class ConfigFile : ISlo
     {
         #region 内容
-        //是否仅拍照
-        private Boolean is_Photograph;
-        public Boolean Is_Photograph
-        {
-            get { return this.is_Photograph; }
-            set { this.is_Photograph = value; }
-        }
-
-        //是否PT沉积
-        private Boolean pt_Depostion;
-        public Boolean PT_Depostion
-        {
-            get { return this.pt_Depostion; }
-            set { this.pt_Depostion = value; }
-        }
-
-        //PT使用的ELY文件
-        private String pt_ELYFile;
-        public String PT_ELYFile
-        {
-            get { return this.pt_ELYFile; }
-            set { this.pt_ELYFile = value; }
-        }
-
-        //FIB使用的ELY文件
-        private String fib_ELYFile;
-        public String FIB_ELYFile
-        {
-            get { return this.fib_ELYFile; }
-            set { this.fib_ELYFile = value; }
-        }
-
-        //拉直操作需要的放大倍数
-        private double stretch_Magnification;
-        public double Stretch_Magnification
-        {
-            get { return this.stretch_Magnification; }
-            set { this.stretch_Magnification = value; }
-        }
-
-        //定位切割位置的放大倍数
-        private double location_Magnification;
-        public double Location_Magnification
-        {
-            get { return this.location_Magnification; }
-            set { this.location_Magnification = value; }
-        }
-
-        //定位切割位置的工作电压
-        private double location_Voltage;
-        public double Location_Voltage
-        {
-            get { return this.location_Voltage; }
-            set { this.location_Voltage = value; }
-        }
-
-        //拍照的放大倍数
-        private double photograph_Magnification;
-        public double Photograph_Magnification
-        {
-            get { return this.photograph_Magnification; }
-            set { this.photograph_Magnification = value; }
-        }
-
-        //拍照的工作电压
-        private double photograph_Voltage;
-        public double Photograph_Voltage
-        {
-            get { return this.photograph_Voltage; }
-            set { this.photograph_Voltage = value; }
-        }
-
-        //校正角度选择
-        private double correction_Angle;
-        public double Correction_Angle
-        {
-            get { return this.correction_Angle; }
-            set { this.correction_Angle = value; }
-        }
-
-        //样品类型
-        private String sample_Type;
-        public String Sample_Type
-        {
-            get { return this.sample_Type; }
-            set { this.sample_Type = value; }
-        }
-
-        //厂商
-        private String firm;
-        public String Firm
-        {
-            get { return this.firm; }
-            set { this.firm = value; }
-        }
-
-        //对焦参数
-
-        //能谱参数
-
+        public MeasureParam m_Config;
         #endregion
 
-        public ConfigFile()
+        public ConfigFile(MeasureParam mp)
         {
-            
+            this.m_Config = mp;
         }
 
 
@@ -194,15 +95,15 @@ namespace MeasureData
 
             xBool isPhotograph = new xBool();
             xBool ptDepostion = new xBool();
-            isPhotograph.AssignValue(this.is_Photograph);
-            ptDepostion.AssignValue(this.pt_Depostion);
+            isPhotograph.AssignValue(m_Config.Is_Photograph);
+            ptDepostion.AssignValue(m_Config.PT);
             sFile.Register("Is_Photograph", isPhotograph);
             sFile.Register("PT_Depostion", ptDepostion);
 
             xString ptELYFile = new xString();
             xString fibELYFile = new xString();
-            ptELYFile.AssignValue(this.pt_ELYFile);
-            fibELYFile.AssignValue(this.fib_ELYFile);
+            ptELYFile.AssignValue(m_Config.PTTemp);
+            fibELYFile.AssignValue(m_Config.FIBTemp);
             sFile.Register("PT_ELYFile", ptELYFile);
             sFile.Register("FIB_ELYFile", fibELYFile);
 
@@ -211,11 +112,11 @@ namespace MeasureData
             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);
+            stretchMagnification.AssignValue(m_Config.Stretch_Magnification);
+            locationMagnification.AssignValue(m_Config.Location_Magnification);
+            locationVoltage.AssignValue(m_Config.Location_Voltage);
+            photographMagnification.AssignValue(m_Config.Photograph_Magnification);
+            photographVoltage.AssignValue(m_Config.Photograph_Voltage);
             sFile.Register("Strectch_Magnification", stretchMagnification);
             sFile.Register("Locatio_Magnification", locationMagnification);
             sFile.Register("Location_Voltage", locationVoltage);
@@ -223,13 +124,13 @@ namespace MeasureData
             sFile.Register("Photograph_Voltage", photographVoltage);
 
             xDouble correctionAngle = new xDouble();
-            correctionAngle.AssignValue(this.correction_Angle);
+            correctionAngle.AssignValue(m_Config.Correction_Angle);
             sFile.Register("Correction_Angle", correctionAngle);
 
             xString sampleType = new xString();
             xString _firm = new xString();
-            sampleType.AssignValue(this.sample_Type);
-            _firm.AssignValue(this.firm);
+            sampleType.AssignValue(m_Config.SampleName);
+            _firm.AssignValue(m_Config.Firm);
             sFile.Register("Sample_Type", sampleType);
             sFile.Register("Firm", _firm);
 
@@ -241,22 +142,22 @@ namespace MeasureData
             {
                 sFile.Serialize(false, xml, rootNode);
 
-                this.is_Photograph = isPhotograph.value();
-                this.pt_Depostion = ptDepostion.value();
+                m_Config.Is_Photograph = isPhotograph.value();
+                m_Config.PT = ptDepostion.value();
 
-                this.pt_ELYFile = ptELYFile.value();
-                this.fib_ELYFile = fibELYFile.value();
+                m_Config.PTTemp = ptELYFile.value();
+                m_Config.FIBTemp = fibELYFile.value();
 
-                this.stretch_Magnification = stretchMagnification.value();
-                this.location_Magnification = locationMagnification.value();
-                this.location_Voltage = locationVoltage.value();
-                this.photograph_Magnification = photographMagnification.value();
-                this.photograph_Voltage = photographVoltage.value();
+                m_Config.Stretch_Magnification = stretchMagnification.value();
+                m_Config.Location_Magnification = locationMagnification.value();
+                m_Config.Location_Voltage = locationVoltage.value();
+                m_Config.Photograph_Magnification = photographMagnification.value();
+                m_Config.Photograph_Voltage = photographVoltage.value();
 
-                this.correction_Angle = correctionAngle.value();
+                m_Config.Correction_Angle = correctionAngle.value();
 
-                this.sample_Type = sampleType.value();
-                this.firm = _firm.value();
+                m_Config.SampleName = sampleType.value();
+                m_Config.Firm = _firm.value();
             }
         }
     }

+ 70 - 1
MeasureData/MeasureParam.cs

@@ -19,7 +19,7 @@ namespace MeasureData
         #region 内容
         //工作条件,一次测量的全部切孔都是一类的
 
-        // 样品
+        // 样品类型
         private string m_SampleName;
         public string SampleName
         {
@@ -27,6 +27,14 @@ namespace MeasureData
             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
@@ -58,6 +66,67 @@ namespace MeasureData
             get { return m_fMode; }
             set { m_fMode = value; }
         }
+
+        //拉直操作需要的放大位数
+        private double stretch_Magnification;
+        public double Stretch_Magnification
+        {
+            get { return this.stretch_Magnification; }
+            set { this.stretch_Magnification = value; }
+        }
+
+        //定位切割位置的放大倍数
+        private double location_Magnification;
+        public double Location_Magnification
+        {
+            get { return this.location_Magnification; }
+            set { this.location_Magnification = value; }
+        }
+
+        //定位切割位置的工作电压
+        private double location_Voltage;
+        public double Location_Voltage
+        {
+            get { return this.location_Voltage; }
+            set { this.location_Voltage = value; }
+        }
+
+        //拍照的放大倍数
+        private double photograph_Magnification;
+        public double Photograph_Magnification
+        {
+            get { return this.photograph_Magnification; }
+            set { this.photograph_Magnification = value; }
+        }
+
+        //拍照的工作电压
+        private double photograph_Voltage;
+        public double Photograph_Voltage
+        {
+            get { return this.photograph_Voltage; }
+            set { this.photograph_Voltage = value; }
+        }
+
+        //校正角度选择
+        private double correction_Angle;
+        public double 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; }
+        }
+
+        //对焦参数
+
+        //能谱参数
+
         #endregion
 
         //构造函数