Bladeren bron

张佳鑫更改FIB放大保护和流程失败进度条显示。

@wang_qi0307 4 jaren geleden
bovenliggende
commit
68153f67c1

+ 2 - 1
HOZProject/FormHOZMain.Designer.cs

@@ -479,8 +479,9 @@
             this.Controls.Add(this.plMain);
             this.Controls.Add(this.plMain);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Margin = new System.Windows.Forms.Padding(4);
+            this.MinimumSize = new System.Drawing.Size(1365, 925);
             this.Name = "FormHOZMain";
             this.Name = "FormHOZMain";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "FormHOZMain";
             this.Text = "FormHOZMain";
             this.Load += new System.EventHandler(this.FormHOZMain_Load);
             this.Load += new System.EventHandler(this.FormHOZMain_Load);
             this.Resize += new System.EventHandler(this.FormHOZMain_Resize);
             this.Resize += new System.EventHandler(this.FormHOZMain_Resize);

+ 6 - 0
HOZProject/FormHOZMain.cs

@@ -727,6 +727,8 @@ namespace HOZProject
                                 //失败
                                 //失败
                                 case (int)ThreadState.Failed:
                                 case (int)ThreadState.Failed:
                                     uControl_ParaInfo.lblShowState.Text = "失败";
                                     uControl_ParaInfo.lblShowState.Text = "失败";
+                                    uControl_ParaInfo.pbMeasure.Value = 100;
+                                    uControl_ParaInfo.lblCompletedAmount.Text = "100%";
                                     break;
                                     break;
                             }
                             }
                             break;
                             break;
@@ -878,6 +880,10 @@ namespace HOZProject
             plMain.Top = 12;
             plMain.Top = 12;
             plMain.Width = this.Width - 24;
             plMain.Width = this.Width - 24;
             plMain.Height = this.Height - 24;
             plMain.Height = this.Height - 24;
+            plFill.Width = plMain.Width - plLeft.Width - 4;
+            plFill.Height = plMain.Height - plTop.Height - 4;
+            plFill.Left = plLeft.Width + 4;
+            plFill.Top = plTop.Height + 4;
         }
         }
     }
     }
 }
 }

+ 28 - 4
HOZProject/UserControls/UControl_Init.cs

@@ -283,7 +283,14 @@ namespace HOZProject
         #region 创建与读取样品参数、配置文件
         #region 创建与读取样品参数、配置文件
         private void btnCreateConfig_Click(object sender, EventArgs e)
         private void btnCreateConfig_Click(object sender, EventArgs e)
         {
         {
-            SaveTemplateFile();
+            if (Convert.ToInt32(cbbWFIB.Text) < 200)
+            {
+                MessageBox.Show("FIB最小放大倍数为200倍");
+            }
+            else
+            {
+                SaveTemplateFile();
+            }
         }
         }
         /// <summary>
         /// <summary>
         /// 获取测量参数,初始化窗体中的控件信息
         /// 获取测量参数,初始化窗体中的控件信息
@@ -350,7 +357,17 @@ namespace HOZProject
                 if (!Directory.Exists(m_TemplateFilePath))
                 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();
             SaveFileDialog saveFileDialog = new SaveFileDialog();
@@ -692,9 +709,16 @@ namespace HOZProject
         /// <param name="e"></param>
         /// <param name="e"></param>
         private void btnSaveDefalutPara_Click(object sender, EventArgs e)
         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
         #endregion

+ 2 - 2
HOZProject/UserControls/UControl_ParaInfo.Designer.cs

@@ -628,13 +628,13 @@
         private System.Windows.Forms.ImageList imageList1;
         private System.Windows.Forms.ImageList imageList1;
         private System.Windows.Forms.Panel panel3;
         private System.Windows.Forms.Panel panel3;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.ProgressBar pbMeasure;
+        public System.Windows.Forms.ProgressBar pbMeasure;
         private System.Windows.Forms.Panel panel4;
         private System.Windows.Forms.Panel panel4;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.PictureBox pbClose;
         private System.Windows.Forms.PictureBox pbClose;
         private System.Windows.Forms.Panel plTimeLine;
         private System.Windows.Forms.Panel plTimeLine;
         public System.Windows.Forms.Label lblShowState;
         public System.Windows.Forms.Label lblShowState;
-        private System.Windows.Forms.Label lblCompletedAmount;
+        public System.Windows.Forms.Label lblCompletedAmount;
         public System.Windows.Forms.CheckBox CkIsSwitch;
         public System.Windows.Forms.CheckBox CkIsSwitch;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Label label10;
         private System.Windows.Forms.Label label10;

+ 18 - 3
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -121,10 +121,25 @@ namespace HOZProject
                 }
                 }
                 try
                 try
                 {
                 {
-                    int pbValue = (int)((float)finishCount / (float)unFinishedCount*100);
-                    pbMeasure.Value = pbValue;
-                    lblCompletedAmount.Text = pbValue + "%";
+                    if (lblShowState.Text == "失败")
+                    {
+                        pbMeasure.Value = 100;
+                        lblCompletedAmount.Text = "100%";
+                    }
+                    else
+                    {
+                        int pbValue = (int)((float)finishCount / (float)unFinishedCount * 100);
+                        pbMeasure.Value = pbValue;
+                        lblCompletedAmount.Text = pbValue + "%";
+                    }
+
                 }
                 }
+                //try
+                //{
+                //    int pbValue = (int)((float)finishCount / (float)unFinishedCount*100);
+                //    pbMeasure.Value = pbValue;
+                //    lblCompletedAmount.Text = pbValue + "%";
+                //}
                 catch (Exception)
                 catch (Exception)
                 {
                 {