Browse Source

去除DefaultParam节点

wb_han 5 years ago
parent
commit
a69544e0ff

+ 0 - 3
HOZProject/App.config

@@ -44,7 +44,4 @@
       <!--是否PT沉积-->
       <!--是否PT沉积-->
       <add key="PT_Depostion" value="False"/>
       <add key="PT_Depostion" value="False"/>
     </appSettings>
     </appSettings>
-  <DefaultParam>
-    <add key ="FIB" value ="C:/HOZ/FIB.ELY"/>
-    </DefaultParam>
 </configuration>
 </configuration>

+ 8 - 6
HOZProject/MeasureMsgDispose/MeasureMsgManage.cs

@@ -24,7 +24,7 @@ namespace HOZProject
                     //设置图像
                     //设置图像
                     formHOZ.pbImage.Image = null;
                     formHOZ.pbImage.Image = null;
                     //流程内容
                     //流程内容
-                    formHOZ.lblFlowContent.Text = "1";
+                    formHOZ.lblFlowContent.Text = "1-3";
                     break;
                     break;
                 default:
                 default:
                     //设置图像
                     //设置图像
@@ -34,9 +34,11 @@ namespace HOZProject
                     break;
                     break;
 
 
             }
             }
+            //修改切孔中流程状态
+            ChageCutHoleFlowNodeState(formHOZ, args);
         }
         }
 
 
-        #region 测试修改切孔中流程节点状态
+        #region 修改切孔中流程状态
         /// <summary>
         /// <summary>
         /// 修改切孔中流程状态
         /// 修改切孔中流程状态
         /// </summary>
         /// </summary>
@@ -45,7 +47,7 @@ namespace HOZProject
         /// <param name="Code">流程编号</param>
         /// <param name="Code">流程编号</param>
         /// <param name="state">状态</param>
         /// <param name="state">状态</param>
         /// <returns></returns>
         /// <returns></returns>
-        public static bool ChageCutHoleFlowNodeState(FormHOZMain formHOZ, string cutHoleName, string Code, int state)
+        public static bool ChageCutHoleFlowNodeState(FormHOZMain formHOZ, ThreadStatusEventArgs args)
         {
         {
             if (formHOZ.plPrarInfo.Controls.Count > 0)
             if (formHOZ.plPrarInfo.Controls.Count > 0)
             {
             {
@@ -53,15 +55,15 @@ namespace HOZProject
                 {
                 {
                     if (item is UserControl)
                     if (item is UserControl)
                     {
                     {
-                        if (item.Name == cutHoleName)
+                        if (item.Name == args.HoleName)
                         {
                         {
                             UControl_ParaInfo uControl_ParaInfo = (UControl_ParaInfo)item;
                             UControl_ParaInfo uControl_ParaInfo = (UControl_ParaInfo)item;
                             TimeLineItem[] ParaItem = uControl_ParaInfo.TlItem;
                             TimeLineItem[] ParaItem = uControl_ParaInfo.TlItem;
                             foreach (TimeLineItem tlItem in ParaItem)
                             foreach (TimeLineItem tlItem in ParaItem)
                             {
                             {
-                                if (tlItem.Code == Code)
+                                if (tlItem.Code == args.Step_Code)
                                 {
                                 {
-                                    tlItem.State = state;
+                                    tlItem.State = Convert.ToInt32(args.State);
                                     break;
                                     break;
                                 }
                                 }
                             }
                             }

+ 98 - 90
HOZProject/UserControls/UControl_Init.cs

@@ -185,101 +185,109 @@ namespace HOZProject
         /// </summary>
         /// </summary>
         public void EditConfig()
         public void EditConfig()
         {
         {
-            //设置数据源信息
-            //样品类型
-            List<String> _sT = sT.ToList();
-            if (_sT.IndexOf(cbbWYP.Text) < 0)
-            {
-                _sT.Add(cbbWYP.Text);
-                string wsT = string.Join(",", _sT.ToArray());
-                config.AppSettings.Settings["Sample_Type"].Value = wsT;
-            }
-            //厂商
-            List<String> _firms = firms.ToList();
-            if (_firms.IndexOf(cbbWCS.Text) < 0)
-            {
-                _firms.Add(cbbWCS.Text);
-                string wFirms = string.Join(",", _firms.ToArray());
-                config.AppSettings.Settings["Firm"].Value = wFirms;
-            }
-            //拍照电压
-            List<String> _WPZD = WPZD.ToList();
-            if (_WPZD.IndexOf(cbbWPZD.Text) < 0)
-            {
-                _WPZD.Add(cbbWPZD.Text);
-                string wWPZD = string.Join(",", _WPZD.ToArray());
-                config.AppSettings.Settings["WPZD"].Value = wWPZD;
-            }
-            //拍照放大位数
-            List<String> _WPZF = WPZF.ToList();
-            if (_WPZF.IndexOf(cbbWPZF.Text) < 0)
-            {
-                _WPZF.Add(cbbWPZF.Text);
-                string wWPZF = string.Join(",", _WPZF.ToArray());
-                config.AppSettings.Settings["WPZF"].Value = wWPZF;
-            }
-            //定位切割电压
-            List<String> _WQGD = WQGD.ToList();
-            if (_WQGD.IndexOf(cbbWQGD.Text) < 0)
-            {
-                _WQGD.Add(cbbWQGD.Text);
-                string wWQGD = string.Join(",", _WQGD.ToArray());
-                config.AppSettings.Settings["WQGD"].Value = wWQGD;
-            }
-            //定位切割放大位数
-            List<String> _WQGF = WQGF.ToList();
-            if (_WQGF.IndexOf(cbbWQGF.Text) < 0)
-            {
-                _WQGF.Add(cbbWQGF.Text);
-                string wWQGF = string.Join(",", _WQGF.ToArray());
-                config.AppSettings.Settings["WQGF"].Value = wWQGF;
-            }
-            //拉直操作放大位数
-            List<String> _WLZ = WLZ.ToList();
-            if (_WLZ.IndexOf(cbbWLZ.Text) < 0)
+            try
             {
             {
-                _WLZ.Add(cbbWLZ.Text);
-                string wWLZ = string.Join(",", _WLZ.ToArray());
-                config.AppSettings.Settings["WLZ"].Value = wWLZ;
-            }
+                //设置数据源信息
+                //样品类型
+                List<String> _sT = sT.ToList();
+                if (_sT.IndexOf(cbbWYP.Text) < 0)
+                {
+                    _sT.Add(cbbWYP.Text);
+                    string wsT = string.Join(",", _sT.ToArray());
+                    config.AppSettings.Settings["Sample_Type"].Value = wsT;
+                }
+                //厂商
+                List<String> _firms = firms.ToList();
+                if (_firms.IndexOf(cbbWCS.Text) < 0)
+                {
+                    _firms.Add(cbbWCS.Text);
+                    string wFirms = string.Join(",", _firms.ToArray());
+                    config.AppSettings.Settings["Firm"].Value = wFirms;
+                }
+                //拍照电压
+                List<String> _WPZD = WPZD.ToList();
+                if (_WPZD.IndexOf(cbbWPZD.Text) < 0)
+                {
+                    _WPZD.Add(cbbWPZD.Text);
+                    string wWPZD = string.Join(",", _WPZD.ToArray());
+                    config.AppSettings.Settings["WPZD"].Value = wWPZD;
+                }
+                //拍照放大位数
+                List<String> _WPZF = WPZF.ToList();
+                if (_WPZF.IndexOf(cbbWPZF.Text) < 0)
+                {
+                    _WPZF.Add(cbbWPZF.Text);
+                    string wWPZF = string.Join(",", _WPZF.ToArray());
+                    config.AppSettings.Settings["WPZF"].Value = wWPZF;
+                }
+                //定位切割电压
+                List<String> _WQGD = WQGD.ToList();
+                if (_WQGD.IndexOf(cbbWQGD.Text) < 0)
+                {
+                    _WQGD.Add(cbbWQGD.Text);
+                    string wWQGD = string.Join(",", _WQGD.ToArray());
+                    config.AppSettings.Settings["WQGD"].Value = wWQGD;
+                }
+                //定位切割放大位数
+                List<String> _WQGF = WQGF.ToList();
+                if (_WQGF.IndexOf(cbbWQGF.Text) < 0)
+                {
+                    _WQGF.Add(cbbWQGF.Text);
+                    string wWQGF = string.Join(",", _WQGF.ToArray());
+                    config.AppSettings.Settings["WQGF"].Value = wWQGF;
+                }
+                //拉直操作放大位数
+                List<String> _WLZ = WLZ.ToList();
+                if (_WLZ.IndexOf(cbbWLZ.Text) < 0)
+                {
+                    _WLZ.Add(cbbWLZ.Text);
+                    string wWLZ = string.Join(",", _WLZ.ToArray());
+                    config.AppSettings.Settings["WLZ"].Value = wWLZ;
+                }
 
 
-            MeasureParam cfm = new MeasureParam();
-            cfm.Is_Photograph = chkWIsP.Checked;
-            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);
-            cfm.Photograph_Magnification = Convert.ToDouble(cbbWPZF.Text);
-            cfm.Photograph_Voltage = Convert.ToDouble(cbbWPZD.Text);
-            if (cbbWXZ.SelectedIndex == 0)
-            {
-                cfm.Correction_Angle = 36.0;
+                MeasureParam cfm = new MeasureParam();
+                cfm.Is_Photograph = chkWIsP.Checked;
+                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);
+                cfm.Photograph_Magnification = Convert.ToDouble(cbbWPZF.Text);
+                cfm.Photograph_Voltage = Convert.ToDouble(cbbWPZD.Text);
+                if (cbbWXZ.SelectedIndex == 0)
+                {
+                    cfm.Correction_Angle = 36.0;
+                }
+                else
+                {
+                    cfm.Correction_Angle = 54.0;
+                }
+
+                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.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["SampleName"].Value = cfm.SampleName;
+                config.AppSettings.Settings["Firms"].Value = cfm.Firm;
+
+                config.Save(ConfigurationSaveMode.Modified);
+                ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
             }
             }
-            else
+            catch (Exception ex)
             {
             {
-                cfm.Correction_Angle = 54.0;
-            }
-
-            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.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["SampleName"].Value = cfm.SampleName;
-            config.AppSettings.Settings["Firms"].Value = cfm.Firm;
 
 
-            config.Save(ConfigurationSaveMode.Modified);
-            ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
+                throw;
+            }
         }
         }
 
 
         /// <summary>
         /// <summary>