Parcourir la source

20200922上午更新

@wang_qi0307 il y a 5 ans
Parent
commit
4f56fc20d3

+ 2 - 1
HOZProject/FormHOZMain.cs

@@ -213,7 +213,7 @@ namespace HOZProject
             pbSave.Enabled = cState;
             pbInit.Enabled = cState;
             pbImportTemplateFile.Enabled = cState;
-            pbLog.Enabled = cState;
+            //pbLog.Enabled = cState;
             pbStop.Enabled = !cState;
         }
         #endregion
@@ -547,6 +547,7 @@ namespace HOZProject
                                     //设置开始时间与结束时间
                                     uControl_ParaInfo.StartTime = cutHoleItem.START.ToString();
                                     uControl_ParaInfo.EndTime = cutHoleItem.END.ToString();
+                                    uControl_ParaInfo.ShowTime();
                                     break;
                                 }
                             }

+ 6 - 3
HOZProject/MeasureMsgDispose/MeasureMsgManage.cs

@@ -57,9 +57,12 @@ namespace HOZProject
                     fileStream.Close();
                     fileStream.Dispose();
                     //流程内容
-                    string semParaContent = "电压:" + args.Picture_Information.Work_Voltage+"KV";
-                    semParaContent += "  放大倍数:" + args.Picture_Information.Magnification + "X";
-                    semParaContent += "  工作距离:" + args.Picture_Information.Work_Distance + "mm";
+                    double Work_Voltage = args.Picture_Information.Work_Voltage/1000;
+                    double Magnification = args.Picture_Information.Magnification;
+                    double Work_Distance = args.Picture_Information.Work_Distance*1000;
+                    string semParaContent = "电压:" + Work_Voltage.ToString("f1") + "KV";
+                    semParaContent += "  放大倍数:" + Magnification + "X";
+                    semParaContent += "  工作距离:" + Work_Distance.ToString("f1") + "mm";
                     formHOZ.lblFlowContent.Text = semParaContent;
                 }
             }

+ 23 - 16
HOZProject/UserControls/UControl_Log.Designer.cs

@@ -54,9 +54,10 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("宋体", 10F);
             this.label1.ForeColor = System.Drawing.Color.LightGray;
-            this.label1.Location = new System.Drawing.Point(13, 8);
+            this.label1.Location = new System.Drawing.Point(17, 10);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(63, 14);
+            this.label1.Size = new System.Drawing.Size(76, 17);
             this.label1.TabIndex = 0;
             this.label1.Text = "查看日志";
             // 
@@ -67,8 +68,9 @@
             this.panel1.Controls.Add(this.label1);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(718, 30);
+            this.panel1.Size = new System.Drawing.Size(957, 38);
             this.panel1.TabIndex = 3;
             // 
             // pbClose
@@ -78,9 +80,10 @@
             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.Location = new System.Drawing.Point(914, 0);
+            this.pbClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbClose.Name = "pbClose";
-            this.pbClose.Size = new System.Drawing.Size(32, 30);
+            this.pbClose.Size = new System.Drawing.Size(43, 38);
             this.pbClose.TabIndex = 107;
             this.pbClose.TabStop = false;
             this.pbClose.Click += new System.EventHandler(this.btnClose_Click);
@@ -117,7 +120,8 @@
             this.dgvLog.DefaultCellStyle = dataGridViewCellStyle2;
             this.dgvLog.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dgvLog.EnableHeadersVisualStyles = false;
-            this.dgvLog.Location = new System.Drawing.Point(0, 30);
+            this.dgvLog.Location = new System.Drawing.Point(0, 38);
+            this.dgvLog.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.dgvLog.MultiSelect = false;
             this.dgvLog.Name = "dgvLog";
             this.dgvLog.ReadOnly = true;
@@ -140,7 +144,7 @@
             this.dgvLog.ShowCellToolTips = false;
             this.dgvLog.ShowEditingIcon = false;
             this.dgvLog.ShowRowErrors = false;
-            this.dgvLog.Size = new System.Drawing.Size(718, 368);
+            this.dgvLog.Size = new System.Drawing.Size(957, 460);
             this.dgvLog.TabIndex = 4;
             this.dgvLog.TabStop = false;
             this.dgvLog.SelectionChanged += new System.EventHandler(this.dgvLog_SelectionChanged);
@@ -152,9 +156,10 @@
             this.panel2.Controls.Add(this.label2);
             this.panel2.Controls.Add(this.lblLogCount);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panel2.Location = new System.Drawing.Point(0, 375);
+            this.panel2.Location = new System.Drawing.Point(0, 470);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(718, 23);
+            this.panel2.Size = new System.Drawing.Size(957, 28);
             this.panel2.TabIndex = 5;
             // 
             // label2
@@ -162,9 +167,10 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("宋体", 10F);
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(8, 4);
+            this.label2.Location = new System.Drawing.Point(11, 5);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(49, 14);
+            this.label2.Size = new System.Drawing.Size(59, 17);
             this.label2.TabIndex = 1;
             this.label2.Text = "共计:";
             // 
@@ -173,9 +179,10 @@
             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(57, 4);
+            this.lblLogCount.Location = new System.Drawing.Point(76, 5);
+            this.lblLogCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lblLogCount.Name = "lblLogCount";
-            this.lblLogCount.Size = new System.Drawing.Size(28, 14);
+            this.lblLogCount.Size = new System.Drawing.Size(34, 17);
             this.lblLogCount.TabIndex = 0;
             this.lblLogCount.Text = "0条";
             // 
@@ -215,20 +222,20 @@
             this.ColState.Name = "ColState";
             this.ColState.ReadOnly = true;
             this.ColState.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.ColState.Visible = false;
             this.ColState.Width = 180;
             // 
             // UControl_Log
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Black;
             this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.Controls.Add(this.panel2);
             this.Controls.Add(this.dgvLog);
             this.Controls.Add(this.panel1);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "UControl_Log";
-            this.Size = new System.Drawing.Size(718, 398);
+            this.Size = new System.Drawing.Size(957, 498);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();

+ 2 - 2
HOZProject/UserControls/UControl_Log.cs

@@ -35,8 +35,8 @@ namespace HOZProject
                 DataRow dr = dt.NewRow();
                 dr[0] = Nt[0];
                 dr[1] = Nt[1];
-                dr[1] = Nt[2];
-                dr[2] = Nt[3];
+                dr[2] = Nt[2];
+                dr[3] = Nt[3];
                 dt.Rows.Add(dr);
             }
             dgvLog.DataSource = dt;

+ 8 - 0
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -55,6 +55,14 @@ namespace HOZProject
             ShowMeasureFlow();
         }
 
+        #region 显示开始与结束时间
+        public void ShowTime()
+        {
+            lblShowStartTime.Text = startTime;
+            lblShowEndTime.Text = endTime;
+        }
+        #endregion
+
         #region 当前进度
         public void UpdateCurrentMeasureSchedule()
         {

+ 5 - 1
MeasureThread/Measure.cs

@@ -595,12 +595,13 @@ namespace MeasureThread
                 //开始循环工作
                 if (i == 0)
                 {
+                    m_cutHoles[i].START = DateTime.Now;
                     //SendMsg("第一个切孔开始测量");
                     //切孔操作-开始
                     SendCutHoleMsg(((int)ThreadState.InProcess).ToString(), m_cutHoles[i].HoleName);
                     firstPosition = iSEM.GetStagePosition();
                     //第一个孔的测试
-                    m_cutHoles[i].START = DateTime.Now;
+                    
                     //成功
                     if(FirstHole())
                     {
@@ -621,6 +622,7 @@ namespace MeasureThread
                 }
                 else
                 {
+                    m_cutHoles[i].START = DateTime.Now;
                     //非第一个孔的测试
                     //SendMsg("第" + i.ToString() + "个切孔开始测量");
                     //切孔操作-开始
@@ -631,12 +633,14 @@ namespace MeasureThread
                     {
                         //保存文件,将测量状态更改
                         m_cutHoles[i].STATE = State.Success;
+                        m_cutHoles[i].END = DateTime.Now;
                         m_measureFile.Save();
                     }
                     //失败
                     else
                     {
                         m_cutHoles[i].STATE = State.Failed;
+                        m_cutHoles[i].END = DateTime.Now;
                         m_measureFile.Save();
                     }