This commit is contained in:
liyaobang 2025-03-27 11:41:44 +08:00
commit 8868915944
3 changed files with 170 additions and 8 deletions

View File

@ -58,6 +58,16 @@
btnLoadProject = new AntdUI.Button();
sltProjects = new AntdUI.Select();
segmented1 = new AntdUI.Segmented();
panel5 = new Panel();
panel7 = new Panel();
label2 = new Label();
lblNum = new Label();
lblUPH = new Label();
label4 = new Label();
lblstarttime = new Label();
label6 = new Label();
lblNowtime = new Label();
label8 = new Label();
titlebar.SuspendLayout();
pageHeader1.SuspendLayout();
panelmain.SuspendLayout();
@ -75,6 +85,8 @@
tabsConfig.SuspendLayout();
panel1.SuspendLayout();
panel3.SuspendLayout();
panel5.SuspendLayout();
panel7.SuspendLayout();
SuspendLayout();
//
// titlebar
@ -229,14 +241,44 @@
tabImgDisplay.TabIndex = 1;
tabImgDisplay.Text = "tabs1";
//
// tabMain
//
tabMain.Location = new Point(3, 28);
tabMain.Name = "tabMain";
tabMain.Size = new Size(574, 289);
tabMain.TabIndex = 0;
tabMain.Text = "检测";
//
// tabsStas
//
tabsStas.Dock = DockStyle.Fill;
tabsStas.Location = new Point(0, 0);
tabsStas.Name = "tabsStas";
tabsStas.Pages.Add(tabPage3);
tabsStas.Size = new Size(580, 176);
tabsStas.Style = styleCard2;
tabsStas.TabIndex = 3;
tabsStas.Text = "tabs3";
//
// tabPage3
//
tabPage3.Controls.Add(panel7);
tabPage3.Controls.Add(panel5);
tabPage3.Location = new Point(3, 28);
tabPage3.Name = "tabPage3";
tabPage3.Size = new Size(574, 145);
tabPage3.TabIndex = 0;
tabPage3.Text = "日志";
//
// richTextBox1
//
richTextBox1.Dock = DockStyle.Fill;
richTextBox1.Location = new Point(0, 0);
richTextBox1.Name = "richTextBox1";
richTextBox1.Size = new Size(606, 176);
richTextBox1.Size = new Size(374, 145);
richTextBox1.TabIndex = 0;
richTextBox1.Text = "";
richTextBox1.TextChanged += richTextBox1_TextChanged;
//
// tabsConfig
//
@ -401,6 +443,103 @@
segmented1.Text = "segmented1";
segmented1.SelectIndexChanged += segmented1_SelectIndexChanged;
//
// panel5
//
panel5.Controls.Add(lblNowtime);
panel5.Controls.Add(label8);
panel5.Controls.Add(lblstarttime);
panel5.Controls.Add(label6);
panel5.Controls.Add(lblUPH);
panel5.Controls.Add(label4);
panel5.Controls.Add(lblNum);
panel5.Controls.Add(label2);
panel5.Dock = DockStyle.Right;
panel5.Location = new Point(374, 0);
panel5.Name = "panel5";
panel5.Size = new Size(200, 145);
panel5.TabIndex = 1;
//
// panel7
//
panel7.Controls.Add(richTextBox1);
panel7.Dock = DockStyle.Fill;
panel7.Location = new Point(0, 0);
panel7.Name = "panel7";
panel7.Size = new Size(374, 145);
panel7.TabIndex = 2;
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(7, 75);
label2.Name = "label2";
label2.Size = new Size(32, 17);
label2.TabIndex = 0;
label2.Text = "总数";
//
// lblNum
//
lblNum.AutoSize = true;
lblNum.Location = new Point(70, 75);
lblNum.Name = "lblNum";
lblNum.Size = new Size(15, 17);
lblNum.TabIndex = 1;
lblNum.Text = "0";
//
// lblUPH
//
lblUPH.AutoSize = true;
lblUPH.Location = new Point(70, 105);
lblUPH.Name = "lblUPH";
lblUPH.Size = new Size(15, 17);
lblUPH.TabIndex = 3;
lblUPH.Text = "0";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(7, 105);
label4.Name = "label4";
label4.Size = new Size(33, 17);
label4.TabIndex = 2;
label4.Text = "UPH";
//
// lblstarttime
//
lblstarttime.AutoSize = true;
lblstarttime.Location = new Point(69, 15);
lblstarttime.Name = "lblstarttime";
lblstarttime.Size = new Size(15, 17);
lblstarttime.TabIndex = 5;
lblstarttime.Text = "0";
//
// label6
//
label6.AutoSize = true;
label6.Location = new Point(7, 15);
label6.Name = "label6";
label6.Size = new Size(56, 17);
label6.TabIndex = 4;
label6.Text = "开始时间";
//
// lblNowtime
//
lblNowtime.AutoSize = true;
lblNowtime.Location = new Point(69, 41);
lblNowtime.Name = "lblNowtime";
lblNowtime.Size = new Size(15, 17);
lblNowtime.TabIndex = 7;
lblNowtime.Text = "0";
//
// label8
//
label8.AutoSize = true;
label8.Location = new Point(7, 41);
label8.Name = "label8";
label8.Size = new Size(56, 17);
label8.TabIndex = 6;
label8.Text = "此刻时间";
//
// MainWindow
//
ClientSize = new Size(1024, 648);
@ -434,6 +573,9 @@
tabsConfig.ResumeLayout(false);
panel1.ResumeLayout(false);
panel3.ResumeLayout(false);
panel5.ResumeLayout(false);
panel5.PerformLayout();
panel7.ResumeLayout(false);
ResumeLayout(false);
}
@ -461,6 +603,15 @@
private AntdUI.Button btnAddProject;
private AntdUI.Button btnLoadProject;
public AntdUI.Select sltProjects;
private RichTextBox richTextBox1;
private Panel panel7;
private Panel panel5;
private Label lblNum;
private Label label2;
private Label lblNowtime;
private Label label8;
private Label lblstarttime;
private Label label6;
private Label lblUPH;
private Label label4;
}
}

View File

@ -512,7 +512,8 @@ namespace DHSoftware
{
camera.CameraDisConnect();
}
PLC.PLCDisConnect();
if (PLC != null)
PLC.PLCDisConnect();
CloseWindow.Instance.Close();// 关闭提示窗口
//Application.Exit();
System.Environment.Exit(0);
@ -570,7 +571,7 @@ namespace DHSoftware
private List<SimboStationMLEngineSet> SimboStationMLEngineList = new List<SimboStationMLEngineSet>();
private Dictionary<string, HDevEngineTool> HalconToolDict = new Dictionary<string, HDevEngineTool>();
public List<RecongnitionLabel> RecongnitionLabelList { get; set; } = new List<RecongnitionLabel>();
public DateTime startTime;
public DateTime ProcessstartTime;
private void HandleStartButton()
{
@ -581,7 +582,8 @@ namespace DHSoftware
private void StartProcess()
{
startTime= DateTime.Now;
ProcessstartTime= DateTime.Now;
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss")
//计数清零
PieceCount = 0;
@ -1017,12 +1019,16 @@ namespace DHSoftware
public void CalculateOEE()
{
TimeSpan timeSpan = DateTime.Now - startTime;
TimeSpan timeSpan = DateTime.Now - ProcessstartTime;
UPH = (int)(ProductNum_Total / timeSpan.TotalHours) + 100;
//UPM = (int)UPH / 60;
this.BeginInvoke(new MethodInvoker(delegate ()
{
lblNowtime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
label1.Text = UPH.ToString();
lblUPH.Text = UPH.ToString();
lblNum.Text = ProductNum_Total.ToString();
labuph.Text = UPH.ToString();
}));
}
@ -1050,5 +1056,10 @@ namespace DHSoftware
private void splitter1_SplitterMoved(object sender, SplitterEventArgs e)
{
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@ -48,7 +48,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter