Browse Source

添加线程状态

wb_han 5 years ago
parent
commit
5778592112

+ 94 - 27
HOZProject/FormHOZMain.Designer.cs

@@ -30,7 +30,11 @@
         {
             this.plMain = new System.Windows.Forms.Panel();
             this.plFill = new System.Windows.Forms.Panel();
-            this.plProcess = new System.Windows.Forms.Panel();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.plPrarInfo = new System.Windows.Forms.Panel();
             this.listmsg = new System.Windows.Forms.ListBox();
             this.pbImage = new System.Windows.Forms.PictureBox();
             this.plSEM = new System.Windows.Forms.Panel();
@@ -48,8 +52,9 @@
             this.pbLog = new System.Windows.Forms.PictureBox();
             this.pbInit = new System.Windows.Forms.PictureBox();
             this.pbSave = new System.Windows.Forms.PictureBox();
-            this.pbNew = new System.Windows.Forms.PictureBox();
             this.pbOpen = new System.Windows.Forms.PictureBox();
+            this.pbNew = new System.Windows.Forms.PictureBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.plMain.SuspendLayout();
             this.plFill.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
@@ -65,8 +70,9 @@
             ((System.ComponentModel.ISupportInitialize)(this.pbLog)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbInit)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbSave)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbNew)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbOpen)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbNew)).BeginInit();
+            this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
             // plMain
@@ -89,7 +95,8 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.plFill.BackColor = System.Drawing.Color.Black;
-            this.plFill.Controls.Add(this.plProcess);
+            this.plFill.Controls.Add(this.groupBox1);
+            this.plFill.Controls.Add(this.plPrarInfo);
             this.plFill.Controls.Add(this.listmsg);
             this.plFill.Controls.Add(this.pbImage);
             this.plFill.Controls.Add(this.plSEM);
@@ -98,14 +105,53 @@
             this.plFill.Size = new System.Drawing.Size(894, 658);
             this.plFill.TabIndex = 5;
             // 
-            // plProcess
-            // 
-            this.plProcess.BackColor = System.Drawing.Color.White;
-            this.plProcess.Location = new System.Drawing.Point(1, 1);
-            this.plProcess.Name = "plProcess";
-            this.plProcess.Size = new System.Drawing.Size(218, 100);
-            this.plProcess.TabIndex = 2;
-            this.plProcess.Visible = false;
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "0",
+            "1",
+            "2"});
+            this.comboBox1.Location = new System.Drawing.Point(6, 74);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(100, 20);
+            this.comboBox1.TabIndex = 25;
+            // 
+            // button1
+            // 
+            this.button1.ForeColor = System.Drawing.Color.Black;
+            this.button1.Location = new System.Drawing.Point(119, 20);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 74);
+            this.button1.TabIndex = 24;
+            this.button1.Text = "测试";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(6, 47);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(100, 21);
+            this.textBox2.TabIndex = 22;
+            this.textBox2.Text = "编号";
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(6, 20);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(100, 21);
+            this.textBox1.TabIndex = 21;
+            this.textBox1.Text = "切孔名称";
+            // 
+            // plPrarInfo
+            // 
+            this.plPrarInfo.BackColor = System.Drawing.Color.White;
+            this.plPrarInfo.Location = new System.Drawing.Point(1, 1);
+            this.plPrarInfo.Name = "plPrarInfo";
+            this.plPrarInfo.Size = new System.Drawing.Size(218, 100);
+            this.plPrarInfo.TabIndex = 2;
+            this.plPrarInfo.Visible = false;
             // 
             // listmsg
             // 
@@ -153,11 +199,11 @@
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.Color.Gainsboro;
-            this.label1.Location = new System.Drawing.Point(15, 3);
+            this.label1.Location = new System.Drawing.Point(22, 3);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(70, 12);
+            this.label1.Size = new System.Drawing.Size(57, 12);
             this.label1.TabIndex = 1;
-            this.label1.Text = "切入点列表";
+            this.label1.Text = "切列表";
             // 
             // plLeftContent
             // 
@@ -319,6 +365,18 @@
             this.pbSave.TabStop = false;
             this.pbSave.Click += new System.EventHandler(this.pbSave_Click);
             // 
+            // pbOpen
+            // 
+            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(5, 4);
+            this.pbOpen.Name = "pbOpen";
+            this.pbOpen.Size = new System.Drawing.Size(68, 71);
+            this.pbOpen.TabIndex = 3;
+            this.pbOpen.TabStop = false;
+            this.pbOpen.Click += new System.EventHandler(this.pbOpen_Click);
+            // 
             // pbNew
             // 
             this.pbNew.BackgroundImage = global::HOZProject.Properties.Resources.New;
@@ -332,17 +390,19 @@
             this.pbNew.Visible = false;
             this.pbNew.Click += new System.EventHandler(this.pbNew_Click);
             // 
-            // pbOpen
+            // groupBox1
             // 
-            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(5, 4);
-            this.pbOpen.Name = "pbOpen";
-            this.pbOpen.Size = new System.Drawing.Size(68, 71);
-            this.pbOpen.TabIndex = 3;
-            this.pbOpen.TabStop = false;
-            this.pbOpen.Click += new System.EventHandler(this.pbOpen_Click);
+            this.groupBox1.Controls.Add(this.textBox1);
+            this.groupBox1.Controls.Add(this.button1);
+            this.groupBox1.Controls.Add(this.comboBox1);
+            this.groupBox1.Controls.Add(this.textBox2);
+            this.groupBox1.ForeColor = System.Drawing.Color.White;
+            this.groupBox1.Location = new System.Drawing.Point(691, 236);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(200, 100);
+            this.groupBox1.TabIndex = 26;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "测试设置状态";
             // 
             // FormHOZMain
             // 
@@ -374,15 +434,17 @@
             ((System.ComponentModel.ISupportInitialize)(this.pbLog)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbInit)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbSave)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbNew)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbOpen)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbNew)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
             this.ResumeLayout(false);
 
         }
 
         #endregion
         private System.Windows.Forms.Panel plMain;
-        public System.Windows.Forms.Panel plProcess;
+        public System.Windows.Forms.Panel plPrarInfo;
         private System.Windows.Forms.Panel plLeft;
         public System.Windows.Forms.Panel plTop;
         public System.Windows.Forms.Panel plFill;
@@ -403,5 +465,10 @@
         private System.Windows.Forms.Panel plSEM;
         private System.Windows.Forms.PictureBox pbImage;
         private System.Windows.Forms.PictureBox pbImportTemplateFile;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.GroupBox groupBox1;
     }
 }

+ 78 - 15
HOZProject/FormHOZMain.cs

@@ -82,7 +82,7 @@ namespace HOZProject
             this.BeginInvoke((Action)delegate
             {
                 //流程编号
-                int eCode = e.Step_Code;
+                string eCode = e.Step_Code;
                 //流程开始时间
                 DateTime eTime = e.Time;
                 //图片对象
@@ -142,22 +142,43 @@ namespace HOZProject
         {
             //清空左侧Panel中的切孔控件
             plLeftContent.Controls.Clear();
+            plPrarInfo.Controls.Clear();
             for (int i = ListCutHole.Count - 1; i >= 0; i--)
             {
                 UControl_CutHole ucCutHole = new UControl_CutHole(this);
                 ucCutHole.Dock = DockStyle.Top;
                 ucCutHole.CutHoleName = ListCutHole[i].HoleName;
+
+                //显示切孔参数信息
+                if (ucCutHole.UControl_ParaInfo == null)
+                {
+                    ucCutHole.UControl_ParaInfo = new UControl_ParaInfo(this);
+                }
+                plPrarInfo.Width = ucCutHole.UControl_ParaInfo.Width;
+                plPrarInfo.Height = ucCutHole.UControl_ParaInfo.Height;
+                //设置当前样品的参数信息
+                ucCutHole.UControl_ParaInfo.Name = ListCutHole[i].HoleName;
+                ucCutHole.UControl_ParaInfo.CutHoleName = ListCutHole[i].HoleName;
+                ucCutHole.UControl_ParaInfo.Position = ListCutHole[i].Position;
+                ucCutHole.UControl_ParaInfo.StartTime = ListCutHole[i].START.ToString();
+                ucCutHole.UControl_ParaInfo.EndTime = ListCutHole[i].END.ToString();
+                ucCutHole.UControl_ParaInfo.State = ListCutHole[i].STATE.ToString();
+                ucCutHole.UControl_ParaInfo.IsSwitch = ListCutHole[i].SWITCH;
+                ucCutHole.UControl_ParaInfo.Dock = DockStyle.Fill;
+                ucCutHole.UControl_ParaInfo.ShowParaInfo();
+                plPrarInfo.Controls.Add(ucCutHole.UControl_ParaInfo);
                 plLeftContent.Controls.Add(ucCutHole);
             }
+            plPrarInfo.Visible = false;
         } 
         #endregion
 
         //隐藏处理层
         private void FormHOZMain_Click(object sender, EventArgs e)
         {
-            if (plProcess.Visible)
+            if (plPrarInfo.Visible)
             {
-                plProcess.Visible = false;
+                plPrarInfo.Visible = false;
             }
         }
 
@@ -233,7 +254,7 @@ namespace HOZProject
         }
         #endregion
 
-        #region 新建、保存、打开、初始化、查看日志
+        #region 新建、保存、打开、初始化、导入配置、查看日志
         private void pbNew_Click(object sender, EventArgs e)
         {
             NewCreate();
@@ -293,6 +314,24 @@ namespace HOZProject
             m_FormInit.ShowDialog();
         }
 
+        private void pbImportTemplateFile_Click(object sender, EventArgs e)
+        {
+            //打开默认路径
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            openFileDialog.Filter = "样品参数文件|*.cfg";
+            if (openFileDialog.ShowDialog() == DialogResult.OK)
+            {
+                if (uControl_Init == null)
+                {
+                    uControl_Init = new UControl_Init(this);
+                }
+                //设置选择的模板文件
+                uControl_Init.ReadConfigPath = openFileDialog.FileName;
+                //获取文件
+                uControl_Init.ReadConfigInfo();
+            }
+        }
+
         private void pbLog_Click(object sender, EventArgs e)
         {
             m_FormLog = new Form();
@@ -432,21 +471,45 @@ namespace HOZProject
         }
         #endregion
 
-        private void pbImportTemplateFile_Click(object sender, EventArgs e)
+        #region 清空处理层中的控件
+        /// <summary>
+        /// 清空处理层中的控件
+        /// </summary>
+        private void ClearProcessControls()
         {
-            //打开默认路径
-            OpenFileDialog openFileDialog = new OpenFileDialog();
-            openFileDialog.Filter = "样品参数文件|*.cfg";
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
+            //清空处理层中的控件
+            plPrarInfo.Controls.Clear();
+        }
+        #endregion
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            if (plPrarInfo.Controls.Count > 0)
             {
-                if (uControl_Init == null)
+                string name = textBox1.Text;
+                string code = textBox2.Text;
+                int state = Convert.ToInt32(comboBox1.Text);
+                foreach (Control item in plPrarInfo.Controls)
                 {
-                    uControl_Init = new UControl_Init(this);
+                    if (item is UserControl)
+                    {
+                        if (item.Name == name)
+                        {
+                            UControl_ParaInfo uControl_ParaInfo = (UControl_ParaInfo)item;
+                            TimeLineItem[] ParaItem = uControl_ParaInfo.TlItem;
+                            foreach (TimeLineItem tlItem in ParaItem)
+                            {
+                                if (tlItem.Code == code)
+                                {
+                                    tlItem.State = state;
+                                    break;
+                                }
+                            }
+                            uControl_ParaInfo.TimeLineInvalidate();
+                            break;
+                        }
+                    }
                 }
-                //设置选择的模板文件
-                uControl_Init.ReadConfigPath = openFileDialog.FileName;
-                //获取文件
-                uControl_Init.ReadConfigInfo();
             }
         }
     }

+ 33 - 7
HOZProject/UserControls/UCTimeLine.cs

@@ -58,7 +58,7 @@ namespace HOZProject
         /// <summary>
         /// The title forcolor
         /// </summary>
-        private Color titleForcolor = TextColors.MoreDark;
+        private Color titleForcolor = TextColors.Light;
 
         /// <summary>
         /// Gets or sets the title forcolor.
@@ -98,7 +98,7 @@ namespace HOZProject
         /// <summary>
         /// The details forcolor
         /// </summary>
-        private Color detailsForcolor = TextColors.Light;
+        private Color detailsForcolor = TextColors.MoreDark;
 
         /// <summary>
         /// Gets or sets the details forcolor.
@@ -170,14 +170,14 @@ namespace HOZProject
                 this.Controls.Clear();
                 if (items != null)
                 {
-
                     foreach (var item in items)
                     {
                         FlowLayoutPanel panelTitle = new FlowLayoutPanel();
                         panelTitle.Dock = DockStyle.Top;
                         panelTitle.AutoScroll = false;
                         panelTitle.Padding = new System.Windows.Forms.Padding(5);
-                        panelTitle.Name = "title_" + Guid.NewGuid().ToString();
+                        panelTitle.Name = "Code_" + item.Code;//+ Guid.NewGuid().ToString();
+                        panelTitle.Tag = item.Code;
                         //panelTitle.BackColor = Color.Yellow;
                         Label lblTitle = new Label();
                         lblTitle.Dock = DockStyle.Top;
@@ -185,6 +185,8 @@ namespace HOZProject
                         lblTitle.Font = titleFont;
                         lblTitle.ForeColor = titleForcolor;
                         lblTitle.Text = item.Title;
+                        lblTitle.Tag = item.Code;
+                        lblTitle.Name = "lbl"+item.Code;
                         lblTitle.SizeChanged += item_SizeChanged;
                         panelTitle.Controls.Add(lblTitle);
                         this.Controls.Add(panelTitle);
@@ -195,7 +197,7 @@ namespace HOZProject
                         panelDetails.Dock = DockStyle.Top;
                         panelDetails.AutoScroll = false;
                         panelDetails.Padding = new System.Windows.Forms.Padding(5);
-                        panelDetails.Name = "details_" + Guid.NewGuid().ToString();
+                        panelDetails.Name = "details_" + item.Code; //"details_" + Guid.NewGuid().ToString();
                         panelDetails.BackColor = Color.Black;
                         Label lblDetails = new Label();
                         lblDetails.AutoSize = true;
@@ -236,9 +238,33 @@ namespace HOZProject
             base.OnPaint(e);
             var g = e.Graphics;
             g.SetGDIHigh();
-            var lst = this.Controls.ToArray().Where(p => p.Name.StartsWith("title_")).ToList();
-            for (int i = 0; i < lst.Count; i++)
+            var lst = this.Controls.ToArray().Where(p => p.Name.StartsWith("Code_")).ToList();
+            //for (int i = lst.Count-1;i>=0; i--)
+            for (int i =  0; i<lst.Count; i++)
             {
+                Label label = (Label)lst[i].Controls[0];
+                foreach (var item in items)
+                {
+                    if(label.Tag.ToString() == item.Code)
+                    {
+                        switch (item.State)
+                        {
+                            case 0:
+                                lineColor = Color.Red;
+                                break;
+                            case 1:
+                                lineColor = Color.Yellow;
+                                break;
+                            case 2:
+                                lineColor = Color.White;
+                                break;
+                            default:
+                                lineColor = TextColors.Light;
+                                break;
+                        }
+                        break;
+                    }
+                }
                 //画圆
                 g.DrawEllipse(new Pen(new SolidBrush(lineColor)), new Rectangle(7, lst[i].Location.Y + 10, 16, 16));
                 //划线

+ 54 - 44
HOZProject/UserControls/UControl_CutHole.cs

@@ -22,6 +22,8 @@ namespace HOZProject
 
         private FormHOZMain formHOZMain;
         public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
+        private UControl_ParaInfo uControl_ParaInfo;
+        public UControl_ParaInfo UControl_ParaInfo { get => uControl_ParaInfo; set => uControl_ParaInfo = value; }
 
         public UControl_CutHole(FormHOZMain formHOZ)
         {
@@ -36,63 +38,71 @@ namespace HOZProject
 
         private void tsShowProcess_Click(object sender, EventArgs e)
         {
-            ClearProcessControls();
+            //ClearProcessControls();
             //显示检测过程信息
             UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject);
-            //UCTimeLine uControl_Process = new UCTimeLine();
-            FormHOZMainObject.plProcess.Width = uControl_Process.Width;
-            FormHOZMainObject.plProcess.Height = uControl_Process.Height;
-            if ((this.Location.Y + uControl_Process.Height) > FormHOZMainObject.Height)
-            {
-                uControl_Process.Location = new Point(this.Left, this.Bottom- this.Top);
-            }
-            else
-            {
-                uControl_Process.Location = new Point(this.Location.X, this.Location.Y);
-            }
+            FormHOZMainObject.plPrarInfo.Width = uControl_Process.Width;
+            FormHOZMainObject.plPrarInfo.Height = uControl_Process.Height;
             uControl_Process.Dock = DockStyle.Fill;
-            FormHOZMainObject.plProcess.Location = uControl_Process.Location;
-            FormHOZMainObject.plProcess.Controls.Add(uControl_Process);
-            FormHOZMainObject.plProcess.Visible = true;
+            FormHOZMainObject.plPrarInfo.Location = uControl_Process.Location;
+            FormHOZMainObject.plPrarInfo.Controls.Add(uControl_Process);
+            FormHOZMainObject.plPrarInfo.Visible = true;
         }
 
         private void tsShowParaInfo_Click(object sender, EventArgs e)
         {
-            ClearProcessControls();
-            //显示切孔参数信息
-            UControl_ParaInfo uControl_ParaInfo = new UControl_ParaInfo(FormHOZMainObject);
-            
-            FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width;
-            FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height;
-            List<CutHole> cutHoleList = FormHOZMainObject.m_MeasureFile.ListCutHole;
-            foreach (CutHole cutHoleItem in cutHoleList)
+            //显示处理信息
+            ShowParaControl(UControl_ParaInfo.Name);
+            FormHOZMainObject.plPrarInfo.Visible = true;
+        }
+
+        /// <summary>
+        /// 向主界面中的属性层中,添加切孔信息用户控件
+        /// </summary>
+        /// <param name="uControl_ParaInfo"></param>
+        private void AddParaControl(UControl_ParaInfo uControl_ParaInfo)
+        {
+            bool isExist = false;
+            if (FormHOZMainObject.plPrarInfo.Controls.Count == 0)
+            {
+                FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo);
+                isExist = true;
+            }
+            else
             {
-                if (cutHoleItem.HoleName == CutHoleName)
+                foreach (Control item in FormHOZMainObject.plPrarInfo.Controls)
                 {
-
-                    //设置当前样品的参数信息
-                    uControl_ParaInfo.CutHoleName = cutHoleItem.HoleName;
-                    uControl_ParaInfo.Position = cutHoleItem.Position;
-                    uControl_ParaInfo.StartTime = cutHoleItem.START.ToString();
-                    uControl_ParaInfo.EndTime = cutHoleItem.END.ToString();
-                    uControl_ParaInfo.State = cutHoleItem.STATE.ToString();
-                    uControl_ParaInfo.IsSwitch = cutHoleItem.SWITCH;
-                    break;
+                    if (item is UserControl)
+                    {
+                        if (item.Name == uControl_ParaInfo.Name)
+                        {
+                            isExist = true;
+                            break;
+                        }
+                    }
                 }
             }
-
-            uControl_ParaInfo.Dock = DockStyle.Fill;
-            //uControl_ParaInfo.ShowParaInfo();
-            FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location;
-            FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo);
-            FormHOZMainObject.plProcess.Visible = true;
+            if (!isExist)
+            {
+                FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo);
+            }
         }
-        
-
-        private void ClearProcessControls()
+        private void ShowParaControl(string cutHoleName)
         {
-            //清空处理层中的控件
-            FormHOZMainObject.plProcess.Controls.Clear();
+            foreach (Control item in FormHOZMainObject.plPrarInfo.Controls)
+            {
+                if (item is UserControl)
+                {
+                    if (item.Name == cutHoleName)
+                    {
+                        item.Visible = true;
+                    }
+                    else
+                    {
+                        item.Visible = false;
+                    }
+                }
+            }
         }
     }
 }

+ 0 - 2
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -699,7 +699,6 @@
         private System.Windows.Forms.PictureBox pbPTTemplateFile;
         private System.Windows.Forms.Label lblCutHoleCount;
         private System.Windows.Forms.CheckBox chkManul;
-        private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.ComboBox cbbWPZD;
         private System.Windows.Forms.ComboBox cbbWPZF;
@@ -723,7 +722,6 @@
         private System.Windows.Forms.Label label61;
         private System.Windows.Forms.CheckBox chkWPT;
         private System.Windows.Forms.Button btnCreateConfig;
-        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.TextBox txtWFIBF;
         private System.Windows.Forms.PictureBox pbFIBTemplateFile;
         private System.Windows.Forms.PictureBox pbCutHoleAuto;

+ 12 - 6
HOZProject/UserControls/UControl_Init.cs

@@ -138,7 +138,7 @@ namespace HOZProject
         }
         #endregion
 
-        #region 创建与读取样品参数文件
+        #region 创建与读取样品参数、配置文件
         private void btnCreateConfig_Click(object sender, EventArgs e)
         {
             SaveTemplateFile();
@@ -447,6 +447,16 @@ namespace HOZProject
                 cbbWCS.Text = cfm.m_Config.Firm;
             }
         }
+
+        /// <summary>
+        /// 修改配置文件默认值
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnSaveDefalutPara_Click(object sender, EventArgs e)
+        {
+            EditConfig();
+        }
         #endregion
 
         #region 删除下拉菜单选择项
@@ -500,10 +510,6 @@ namespace HOZProject
             }
         }
         #endregion
-
-        private void btnSaveDefalutPara_Click(object sender, EventArgs e)
-        {
-            EditConfig();
-        }
+        
     }
 }

+ 17 - 4
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -34,6 +34,9 @@ namespace HOZProject
         private bool isSwitch;
         private string cutHoleName;
         private FormHOZMain formHOZMain;
+        private TimeLineItem[] tlItem = null;
+        private UCTimeLine uCTimeLine=null;
+        private int flowCode = 1;
         public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
         public string StartTime { get => startTime; set => startTime = value; }
         public string EndTime { get => endTime; set => endTime = value; }
@@ -41,6 +44,7 @@ namespace HOZProject
         public SemPosition Position { get => position; set => position = value; }
         public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
         public bool IsSwitch { get => isSwitch; set => isSwitch = value; }
+        public TimeLineItem[] TlItem { get => tlItem; set => tlItem = value; }
 
         public UControl_ParaInfo(FormHOZMain formHOZ)
         {
@@ -73,12 +77,18 @@ namespace HOZProject
         {
             if (plTimeLine.Controls.Count == 0)
             {
-                UCTimeLine uCTimeLine = new UCTimeLine(tlItem);
+                uCTimeLine = new UCTimeLine(tlItem);
                 uCTimeLine.Dock = DockStyle.Fill;
                 plTimeLine.Controls.Add(uCTimeLine);
             }
         }
 
+        public void TimeLineInvalidate()
+        {
+            plTimeLine.Invalidate();
+            uCTimeLine.Invalidate();
+        }
+
         /// <summary>
         /// 显示切孔参数信息
         /// </summary>
@@ -105,10 +115,13 @@ namespace HOZProject
         /// <param name="flowCode"></param>
         private void ShowMeasureFlow(string flowCode)
         {
-            TimeLineItem[]  tlItem = GetMeasureFlowStructInfo(flowCode);
-            if (tlItem != null)
+            if (TlItem == null)
+            {
+                TlItem = GetMeasureFlowStructInfo(flowCode);
+            }
+            if (TlItem != null)
             {
-                ShowUCTimeLine(tlItem);
+                ShowUCTimeLine(TlItem);
             }
         }
         private TimeLineItem[] GetMeasureFlowStructInfo(string MeasureCode)