소스 검색

添加线程处理类

wb_han 5 년 전
부모
커밋
e1914fb9b8
4개의 변경된 파일85개의 추가작업 그리고 62개의 파일을 삭제
  1. 20 2
      HOZProject/FormHOZMain.Designer.cs
  2. 14 11
      HOZProject/FormHOZMain.cs
  3. 1 0
      HOZProject/UnitControl.csproj
  4. 50 49
      HOZProject/UserControls/UControl_Log.Designer.cs

+ 20 - 2
HOZProject/FormHOZMain.Designer.cs

@@ -55,9 +55,11 @@
             this.pbOpen = new System.Windows.Forms.PictureBox();
             this.pbNew = new System.Windows.Forms.PictureBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.lblFlowContent = new System.Windows.Forms.Label();
             this.plMain.SuspendLayout();
             this.plFill.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
+            this.plSEM.SuspendLayout();
             this.plLeft.SuspendLayout();
             this.plTop.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbStop)).BeginInit();
@@ -176,6 +178,7 @@
             // 
             // plSEM
             // 
+            this.plSEM.Controls.Add(this.lblFlowContent);
             this.plSEM.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.plSEM.Location = new System.Drawing.Point(0, 568);
             this.plSEM.Name = "plSEM";
@@ -392,18 +395,30 @@
             // 
             // groupBox1
             // 
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             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.Location = new System.Drawing.Point(694, 2);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Size = new System.Drawing.Size(200, 100);
             this.groupBox1.TabIndex = 26;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "测试设置状态";
             // 
+            // lblFlowContent
+            // 
+            this.lblFlowContent.AutoSize = true;
+            this.lblFlowContent.Font = new System.Drawing.Font("宋体", 10F);
+            this.lblFlowContent.ForeColor = System.Drawing.Color.White;
+            this.lblFlowContent.Location = new System.Drawing.Point(23, 38);
+            this.lblFlowContent.Name = "lblFlowContent";
+            this.lblFlowContent.Size = new System.Drawing.Size(28, 14);
+            this.lblFlowContent.TabIndex = 0;
+            this.lblFlowContent.Text = "---";
+            // 
             // FormHOZMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -421,6 +436,8 @@
             this.plMain.ResumeLayout(false);
             this.plFill.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).EndInit();
+            this.plSEM.ResumeLayout(false);
+            this.plSEM.PerformLayout();
             this.plLeft.ResumeLayout(false);
             this.plLeft.PerformLayout();
             this.plTop.ResumeLayout(false);
@@ -463,12 +480,13 @@
         private System.Windows.Forms.PictureBox pbPause;
         private System.Windows.Forms.ListBox listmsg;
         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;
+        public System.Windows.Forms.PictureBox pbImage;
+        public System.Windows.Forms.Label lblFlowContent;
     }
 }

+ 14 - 11
HOZProject/FormHOZMain.cs

@@ -90,6 +90,8 @@ namespace HOZProject
                 //当前状态
                 string eState = e.State;
                 this.listmsg.Items.Add(e.Time.ToString() +"_"+ e.State);
+                //显示流程中对应编号的内容
+                MeasureMsgManage.ShowMsgContent(this, e);
                 ShowLogInfo();
             });
         }
@@ -141,8 +143,7 @@ namespace HOZProject
         public void CreateCutHoleList(List<CutHole> ListCutHole)
         {
             //清空左侧Panel中的切孔控件
-            plLeftContent.Controls.Clear();
-            plPrarInfo.Controls.Clear();
+            ClearPanelControls();
             for (int i = ListCutHole.Count - 1; i >= 0; i--)
             {
                 UControl_CutHole ucCutHole = new UControl_CutHole(this);
@@ -269,9 +270,8 @@ namespace HOZProject
             }
             else
             {
-                //清空切孔列表用户控件
-                plLeftContent.Controls.Clear();
-                //加载配置文件
+                //清空内容容器中的控件
+                ClearPanelControls();
             }
         }
 
@@ -410,7 +410,7 @@ namespace HOZProject
                                 break;
                             //完成
                             case (int)ThreadState.Success:
-                                btnCutHole.BackColor = Color.LawnGreen;
+                                btnCutHole.BackColor = Color.GreenYellow;
                                 break;
                             //错误
                             case (int)ThreadState.Failed:
@@ -471,17 +471,19 @@ namespace HOZProject
         }
         #endregion
 
-        #region 清空处理层中的控件
+        #region 清空内容容器中的控件
         /// <summary>
-        /// 清空处理层中的控件
+        /// 清空内容容器中的控件
         /// </summary>
-        private void ClearProcessControls()
+        private void ClearPanelControls()
         {
-            //清空处理层中的控件
+            //清空内容容器中的控件
+            plLeftContent.Controls.Clear();
             plPrarInfo.Controls.Clear();
         }
         #endregion
 
+        #region 测试修改切孔中流程状态
         private void button1_Click(object sender, EventArgs e)
         {
             if (plPrarInfo.Controls.Count > 0)
@@ -511,6 +513,7 @@ namespace HOZProject
                     }
                 }
             }
-        }
+        } 
+        #endregion
     }
 }

+ 1 - 0
HOZProject/UnitControl.csproj

@@ -76,6 +76,7 @@
     </Compile>
     <Compile Include="Helpers\ControlHelper.cs" />
     <Compile Include="Helpers\NativeMethods.cs" />
+    <Compile Include="MeasureMsgDispose\MeasureMsgManage.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="UserControls\UControl_CutHole.cs">

+ 50 - 49
HOZProject/UserControls/UControl_Log.Designer.cs

@@ -28,12 +28,13 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
             this.label1 = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.pbClose = new System.Windows.Forms.PictureBox();
             this.dgvLog = new System.Windows.Forms.DataGridView();
             this.ColCutHoleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ColStep = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -42,11 +43,10 @@
             this.panel2 = new System.Windows.Forms.Panel();
             this.label2 = new System.Windows.Forms.Label();
             this.lblLogCount = new System.Windows.Forms.Label();
-            this.pbClose = new System.Windows.Forms.PictureBox();
             this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvLog)).BeginInit();
             this.panel2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             this.SuspendLayout();
             // 
             // label1
@@ -71,52 +71,66 @@
             this.panel1.Size = new System.Drawing.Size(718, 30);
             this.panel1.TabIndex = 3;
             // 
+            // pbClose
+            // 
+            this.pbClose.BackColor = System.Drawing.Color.Black;
+            this.pbClose.BackgroundImage = global::HOZProject.Properties.Resources.exit_Gray;
+            this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
+            this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.pbClose.Dock = System.Windows.Forms.DockStyle.Right;
+            this.pbClose.Location = new System.Drawing.Point(686, 0);
+            this.pbClose.Name = "pbClose";
+            this.pbClose.Size = new System.Drawing.Size(32, 30);
+            this.pbClose.TabIndex = 107;
+            this.pbClose.TabStop = false;
+            this.pbClose.Click += new System.EventHandler(this.btnClose_Click);
+            // 
             // dgvLog
             // 
             this.dgvLog.AllowUserToAddRows = false;
             this.dgvLog.AllowUserToDeleteRows = false;
             this.dgvLog.AllowUserToResizeColumns = false;
             this.dgvLog.AllowUserToResizeRows = false;
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvLog.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+            dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvLog.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9;
             this.dgvLog.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
             this.dgvLog.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.ColCutHoleName,
             this.ColStep,
             this.ColTime,
             this.ColState});
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dgvLog.DefaultCellStyle = dataGridViewCellStyle2;
+            dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dgvLog.DefaultCellStyle = dataGridViewCellStyle10;
             this.dgvLog.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dgvLog.EnableHeadersVisualStyles = false;
             this.dgvLog.Location = new System.Drawing.Point(0, 30);
             this.dgvLog.MultiSelect = false;
             this.dgvLog.Name = "dgvLog";
             this.dgvLog.ReadOnly = true;
-            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvLog.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
+            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvLog.RowHeadersDefaultCellStyle = dataGridViewCellStyle11;
             this.dgvLog.RowHeadersVisible = false;
             this.dgvLog.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
-            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.dgvLog.RowsDefaultCellStyle = dataGridViewCellStyle4;
+            dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
+            this.dgvLog.RowsDefaultCellStyle = dataGridViewCellStyle12;
             this.dgvLog.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.SystemColors.WindowText;
             this.dgvLog.RowTemplate.Height = 23;
             this.dgvLog.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@@ -197,24 +211,11 @@
             this.lblLogCount.AutoSize = true;
             this.lblLogCount.Font = new System.Drawing.Font("宋体", 10F);
             this.lblLogCount.ForeColor = System.Drawing.Color.Black;
-            this.lblLogCount.Location = new System.Drawing.Point(52, 4);
+            this.lblLogCount.Location = new System.Drawing.Point(57, 4);
             this.lblLogCount.Name = "lblLogCount";
-            this.lblLogCount.Size = new System.Drawing.Size(0, 14);
+            this.lblLogCount.Size = new System.Drawing.Size(28, 14);
             this.lblLogCount.TabIndex = 0;
-            // 
-            // pbClose
-            // 
-            this.pbClose.BackColor = System.Drawing.Color.Black;
-            this.pbClose.BackgroundImage = global::HOZProject.Properties.Resources.exit_Gray;
-            this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbClose.Dock = System.Windows.Forms.DockStyle.Right;
-            this.pbClose.Location = new System.Drawing.Point(686, 0);
-            this.pbClose.Name = "pbClose";
-            this.pbClose.Size = new System.Drawing.Size(32, 30);
-            this.pbClose.TabIndex = 107;
-            this.pbClose.TabStop = false;
-            this.pbClose.Click += new System.EventHandler(this.btnClose_Click);
+            this.lblLogCount.Text = "0条";
             // 
             // UControl_Log
             // 
@@ -229,10 +230,10 @@
             this.Size = new System.Drawing.Size(718, 398);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvLog)).EndInit();
             this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();
             this.ResumeLayout(false);
 
         }