Compare commits

...
3 Commits
Author SHA1 Message Date
gf zhou 233737bc31 添加接口null值检查
打开螺丝引导页面逻辑修改
程序重复打开命名修改
添加心跳线程
2025-04-16 11:31:16 +08:00
zhougf 1a9f2a5bca 4.12
1.添加马头螺丝扭力角度的上传,后期使用定时器定时上传数据
2.抽真空 plc 触发90
3.螺丝开盖按钮添加 从 keyvalue获取值,对比扫码得到的值更新other4
2025-04-12 14:55:51 +08:00
zhougf 69c851c09e 4.11更新
1.添加是否调用mes接口按钮,并只有admin用户可以点击,2.修改螺丝引导页面
3.端子只有一个,端子扫码借用扫码页面
2025-04-11 15:47:10 +08:00
16 changed files with 1444 additions and 499 deletions

No files matched your search

+5 -3
View File
@@ -244,16 +244,17 @@
<Compile Include="form\MESUrl.Designer.cs">
<DependentUpon>MESUrl.cs</DependentUpon>
</Compile>
<Compile Include="MaterialScanForm.cs">
<Compile Include="form\MaterialScanForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MaterialScanForm.Designer.cs">
<Compile Include="form\MaterialScanForm.Designer.cs">
<DependentUpon>MaterialScanForm.cs</DependentUpon>
</Compile>
<Compile Include="mod\database\t_imageposition.cs" />
<Compile Include="mod\database\t_lineplc.cs" />
<Compile Include="mod\database\t_materialcall.cs" />
<Compile Include="mod\database\t_materialscan.cs" />
<Compile Include="mod\database\t_materialupload.cs" />
<Compile Include="mod\database\t_pressurecurve.cs" />
<Compile Include="mod\database\t_flow.cs" />
<Compile Include="mod\database\t_interface.cs" />
@@ -264,6 +265,7 @@
<Compile Include="mod\database\t_plcaddress.cs" />
<Compile Include="mod\database\t_plc.cs" />
<Compile Include="mod\database\t_serialport.cs" />
<Compile Include="mod\database\t_sn.cs" />
<Compile Include="mod\database\t_user.cs" />
<Compile Include="mod\enum\plc_emum.cs" />
<Compile Include="mod\server\otherdata.cs" />
@@ -370,7 +372,7 @@
<EmbeddedResource Include="form\MESUrl.resx">
<DependentUpon>MESUrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MaterialScanForm.resx">
<EmbeddedResource Include="form\MaterialScanForm.resx">
<DependentUpon>MaterialScanForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
+139 -108
View File
@@ -77,9 +77,9 @@ namespace WindowsFormsApp1
this.材料值 = new System.Windows.Forms.Label();
this.材料 = new System.Windows.Forms.Label();
this.LOT号显示 = new System.Windows.Forms.Label();
this.LOT号 = new System.Windows.Forms.Label();
this.MES提示 = new System.Windows.Forms.Label();
this.Tray盘二维码 = new System.Windows.Forms.Label();
this.LOT号 = new System.Windows.Forms.Label();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
@@ -108,6 +108,8 @@ namespace WindowsFormsApp1
this.底部注释3 = new System.Windows.Forms.Label();
this.底部注释4 = new System.Windows.Forms.Label();
this.底部注释5 = new System.Windows.Forms.Label();
this.btnToggleTestMode = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
@@ -133,9 +135,9 @@ namespace WindowsFormsApp1
this.plcStatusGroupBox.Controls.Add(this.plcStatusTableLayout);
this.plcStatusGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.plcStatusGroupBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
this.plcStatusGroupBox.Location = new System.Drawing.Point(3, 969);
this.plcStatusGroupBox.Location = new System.Drawing.Point(3, 931);
this.plcStatusGroupBox.Name = "plcStatusGroupBox";
this.plcStatusGroupBox.Size = new System.Drawing.Size(1754, 94);
this.plcStatusGroupBox.Size = new System.Drawing.Size(1754, 90);
this.plcStatusGroupBox.TabIndex = 9;
this.plcStatusGroupBox.TabStop = false;
this.plcStatusGroupBox.Text = "PLC连接状态";
@@ -149,7 +151,7 @@ namespace WindowsFormsApp1
this.plcStatusTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.plcStatusTableLayout.Location = new System.Drawing.Point(3, 40);
this.plcStatusTableLayout.Name = "plcStatusTableLayout";
this.plcStatusTableLayout.Size = new System.Drawing.Size(1748, 51);
this.plcStatusTableLayout.Size = new System.Drawing.Size(1748, 47);
this.plcStatusTableLayout.TabIndex = 0;
//
// menuStrip1
@@ -369,13 +371,13 @@ namespace WindowsFormsApp1
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 105F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 48F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 101F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 59.66998F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35.03736F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 96F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.292663F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1760, 1112);
this.tableLayoutPanel1.Size = new System.Drawing.Size(1760, 1068);
this.tableLayoutPanel1.TabIndex = 6;
//
// tableLayoutPanel3
@@ -388,12 +390,12 @@ namespace WindowsFormsApp1
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel2, 0, 0);
this.tableLayoutPanel3.Location = new System.Drawing.Point(5, 56);
this.tableLayoutPanel3.Location = new System.Drawing.Point(5, 54);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(1750, 93);
this.tableLayoutPanel3.Size = new System.Drawing.Size(1750, 89);
this.tableLayoutPanel3.TabIndex = 4;
//
// tableLayoutPanel2
@@ -422,18 +424,19 @@ namespace WindowsFormsApp1
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1740, 81);
this.tableLayoutPanel2.Size = new System.Drawing.Size(1740, 77);
this.tableLayoutPanel2.TabIndex = 3;
//
// linemode
//
this.linemode.AutoEllipsis = true;
this.linemode.AutoSize = true;
this.linemode.Dock = System.Windows.Forms.DockStyle.Fill;
this.linemode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linemode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linemode.Location = new System.Drawing.Point(975, 1);
this.linemode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.linemode.Name = "linemode";
this.linemode.Size = new System.Drawing.Size(245, 79);
this.linemode.Size = new System.Drawing.Size(245, 75);
this.linemode.TabIndex = 16;
this.linemode.Text = "MachineID";
this.linemode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -442,11 +445,11 @@ namespace WindowsFormsApp1
//
this.当前时间.AutoSize = true;
this.当前时间.Dock = System.Windows.Forms.DockStyle.Fill;
this.当前时间.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.当前时间.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.当前时间.Location = new System.Drawing.Point(1487, 1);
this.当前时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.当前时间.Name = "当前时间";
this.当前时间.Size = new System.Drawing.Size(247, 79);
this.当前时间.Size = new System.Drawing.Size(247, 75);
this.当前时间.TabIndex = 11;
this.当前时间.Text = "当前状态:";
this.当前时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -455,37 +458,39 @@ namespace WindowsFormsApp1
//
this.操作人员ID.AutoSize = true;
this.操作人员ID.Dock = System.Windows.Forms.DockStyle.Fill;
this.操作人员ID.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.操作人员ID.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.操作人员ID.Location = new System.Drawing.Point(1231, 1);
this.操作人员ID.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.操作人员ID.Name = "操作人员ID";
this.操作人员ID.Size = new System.Drawing.Size(245, 79);
this.操作人员ID.Size = new System.Drawing.Size(245, 75);
this.操作人员ID.TabIndex = 6;
this.操作人员ID.Text = "操作人员ID:";
this.操作人员ID.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// linetype
//
this.linetype.AutoEllipsis = true;
this.linetype.AutoSize = true;
this.linetype.Dock = System.Windows.Forms.DockStyle.Fill;
this.linetype.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linetype.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linetype.Location = new System.Drawing.Point(719, 1);
this.linetype.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.linetype.Name = "linetype";
this.linetype.Size = new System.Drawing.Size(245, 79);
this.linetype.Size = new System.Drawing.Size(245, 75);
this.linetype.TabIndex = 5;
this.linetype.Text = "StationID";
this.linetype.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// linecode
//
this.linecode.AutoEllipsis = true;
this.linecode.AutoSize = true;
this.linecode.Dock = System.Windows.Forms.DockStyle.Fill;
this.linecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linecode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linecode.Location = new System.Drawing.Point(463, 1);
this.linecode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.linecode.Name = "linecode";
this.linecode.Size = new System.Drawing.Size(245, 79);
this.linecode.Size = new System.Drawing.Size(245, 75);
this.linecode.TabIndex = 4;
this.linecode.Text = "Line";
this.linecode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -494,11 +499,11 @@ namespace WindowsFormsApp1
//
this.linename.AutoSize = true;
this.linename.Dock = System.Windows.Forms.DockStyle.Fill;
this.linename.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linename.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linename.Location = new System.Drawing.Point(207, 1);
this.linename.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.linename.Name = "linename";
this.linename.Size = new System.Drawing.Size(245, 79);
this.linename.Size = new System.Drawing.Size(245, 75);
this.linename.TabIndex = 3;
this.linename.Text = "线别:";
this.linename.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -509,7 +514,7 @@ namespace WindowsFormsApp1
this.开始处理.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.开始处理.Location = new System.Drawing.Point(4, 4);
this.开始处理.Name = "开始处理";
this.开始处理.Size = new System.Drawing.Size(194, 73);
this.开始处理.Size = new System.Drawing.Size(194, 69);
this.开始处理.TabIndex = 17;
this.开始处理.Text = "开始处理";
this.开始处理.UseVisualStyleBackColor = true;
@@ -526,13 +531,13 @@ namespace WindowsFormsApp1
this.tableLayoutPanel4.Controls.Add(this.原料包装LOT号, 0, 0);
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel6, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel9, 1, 0);
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 159);
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 153);
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(1754, 503);
this.tableLayoutPanel4.Size = new System.Drawing.Size(1754, 483);
this.tableLayoutPanel4.TabIndex = 8;
//
// 原料包装LOT号
@@ -544,7 +549,7 @@ namespace WindowsFormsApp1
this.原料包装LOT号.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.原料包装LOT号.Name = "原料包装LOT号";
this.原料包装LOT号.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.原料包装LOT号.Size = new System.Drawing.Size(1397, 193);
this.原料包装LOT号.Size = new System.Drawing.Size(1397, 185);
this.原料包装LOT号.TabIndex = 0;
this.原料包装LOT号.TabStop = false;
this.原料包装LOT号.Text = "产品信息:";
@@ -553,15 +558,14 @@ namespace WindowsFormsApp1
//
this.tableLayoutPanel5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.tableLayoutPanel5.ColumnCount = 2;
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 24.49411F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75.50589F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.tableLayoutPanel5.Controls.Add(this.材料值, 1, 1);
this.tableLayoutPanel5.Controls.Add(this.材料, 0, 1);
this.tableLayoutPanel5.Controls.Add(this.LOT号显示, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.LOT号, 1, 0);
this.tableLayoutPanel5.Controls.Add(this.MES提示, 0, 2);
this.tableLayoutPanel5.Controls.Add(this.Tray盘二维码, 1, 2);
this.tableLayoutPanel5.Controls.Add(this.LOT号, 1, 0);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 41);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
@@ -570,7 +574,7 @@ namespace WindowsFormsApp1
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(1391, 148);
this.tableLayoutPanel5.Size = new System.Drawing.Size(1391, 140);
this.tableLayoutPanel5.TabIndex = 0;
//
// 材料值
@@ -578,9 +582,9 @@ namespace WindowsFormsApp1
this.材料值.AutoSize = true;
this.材料值.Dock = System.Windows.Forms.DockStyle.Fill;
this.材料值.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.材料值.Location = new System.Drawing.Point(343, 49);
this.材料值.Location = new System.Drawing.Point(350, 46);
this.材料值.Name = "材料值";
this.材料值.Size = new System.Drawing.Size(1045, 49);
this.材料值.Size = new System.Drawing.Size(1038, 46);
this.材料值.TabIndex = 7;
this.材料值.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
@@ -589,9 +593,9 @@ namespace WindowsFormsApp1
this.材料.AutoSize = true;
this.材料.Dock = System.Windows.Forms.DockStyle.Fill;
this.材料.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.材料.Location = new System.Drawing.Point(3, 49);
this.材料.Location = new System.Drawing.Point(3, 46);
this.材料.Name = "材料";
this.材料.Size = new System.Drawing.Size(334, 49);
this.材料.Size = new System.Drawing.Size(341, 46);
this.材料.TabIndex = 6;
this.材料.Text = "材 料:";
this.材料.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -603,30 +607,19 @@ namespace WindowsFormsApp1
this.LOT号显示.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LOT号显示.Location = new System.Drawing.Point(3, 0);
this.LOT号显示.Name = "LOT号显示";
this.LOT号显示.Size = new System.Drawing.Size(334, 49);
this.LOT号显示.Size = new System.Drawing.Size(341, 46);
this.LOT号显示.TabIndex = 2;
this.LOT号显示.Text = "产品 SN:";
this.LOT号显示.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LOT号
//
this.LOT号.AutoSize = true;
this.LOT号.Dock = System.Windows.Forms.DockStyle.Fill;
this.LOT号.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold);
this.LOT号.Location = new System.Drawing.Point(343, 0);
this.LOT号.Name = "LOT号";
this.LOT号.Size = new System.Drawing.Size(1045, 49);
this.LOT号.TabIndex = 0;
this.LOT号.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// MES提示
//
this.MES提示.AutoSize = true;
this.MES提示.Dock = System.Windows.Forms.DockStyle.Fill;
this.MES提示.Font = new System.Drawing.Font("宋体", 15F);
this.MES提示.Location = new System.Drawing.Point(3, 98);
this.MES提示.Location = new System.Drawing.Point(3, 92);
this.MES提示.Name = "MES提示";
this.MES提示.Size = new System.Drawing.Size(334, 50);
this.MES提示.Size = new System.Drawing.Size(341, 48);
this.MES提示.TabIndex = 4;
this.MES提示.Text = "托 盘 码:";
this.MES提示.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -636,20 +629,31 @@ namespace WindowsFormsApp1
this.Tray盘二维码.AutoSize = true;
this.Tray盘二维码.Dock = System.Windows.Forms.DockStyle.Fill;
this.Tray盘二维码.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold);
this.Tray盘二维码.Location = new System.Drawing.Point(343, 98);
this.Tray盘二维码.Location = new System.Drawing.Point(350, 92);
this.Tray盘二维码.Name = "Tray盘二维码";
this.Tray盘二维码.Size = new System.Drawing.Size(1045, 50);
this.Tray盘二维码.Size = new System.Drawing.Size(1038, 48);
this.Tray盘二维码.TabIndex = 2;
this.Tray盘二维码.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LOT号
//
this.LOT号.AutoSize = true;
this.LOT号.Dock = System.Windows.Forms.DockStyle.Fill;
this.LOT号.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold);
this.LOT号.Location = new System.Drawing.Point(350, 0);
this.LOT号.Name = "LOT号";
this.LOT号.Size = new System.Drawing.Size(1038, 46);
this.LOT号.TabIndex = 0;
this.LOT号.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel4.SetColumnSpan(this.tableLayoutPanel6, 2);
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel6.Controls.Add(this.label2, 1, 0);
this.tableLayoutPanel6.Controls.Add(this.label3, 2, 0);
@@ -657,12 +661,12 @@ namespace WindowsFormsApp1
this.tableLayoutPanel6.Controls.Add(this.MES提示信息, 2, 1);
this.tableLayoutPanel6.Controls.Add(this.eventTableLayout, 0, 1);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 204);
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 196);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 2;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 48F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(1748, 296);
this.tableLayoutPanel6.Size = new System.Drawing.Size(1748, 284);
this.tableLayoutPanel6.TabIndex = 3;
//
// label1
@@ -672,7 +676,7 @@ namespace WindowsFormsApp1
this.label1.Font = new System.Drawing.Font("宋体", 10.125F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(4, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(430, 50);
this.label1.Size = new System.Drawing.Size(430, 48);
this.label1.TabIndex = 0;
this.label1.Text = "MES事件";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -684,7 +688,7 @@ namespace WindowsFormsApp1
this.label2.Font = new System.Drawing.Font("宋体", 10.125F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(441, 1);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(255, 50);
this.label2.Size = new System.Drawing.Size(430, 48);
this.label2.TabIndex = 1;
this.label2.Text = "MES事件结果";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -694,9 +698,9 @@ namespace WindowsFormsApp1
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("宋体", 10.125F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(703, 1);
this.label3.Location = new System.Drawing.Point(878, 1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(1041, 50);
this.label3.Size = new System.Drawing.Size(866, 48);
this.label3.TabIndex = 2;
this.label3.Text = "MES信息提示";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -706,9 +710,9 @@ namespace WindowsFormsApp1
this.事件结果.AutoSize = true;
this.事件结果.Dock = System.Windows.Forms.DockStyle.Fill;
this.事件结果.Font = new System.Drawing.Font("宋体", 25.875F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.事件结果.Location = new System.Drawing.Point(441, 52);
this.事件结果.Location = new System.Drawing.Point(441, 50);
this.事件结果.Name = "事件结果";
this.事件结果.Size = new System.Drawing.Size(255, 243);
this.事件结果.Size = new System.Drawing.Size(430, 233);
this.事件结果.TabIndex = 3;
this.事件结果.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@@ -716,10 +720,10 @@ namespace WindowsFormsApp1
//
this.MES提示信息.AutoSize = true;
this.MES提示信息.Dock = System.Windows.Forms.DockStyle.Fill;
this.MES提示信息.Font = new System.Drawing.Font("宋体", 16.125F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MES提示信息.Location = new System.Drawing.Point(703, 52);
this.MES提示信息.Font = new System.Drawing.Font("宋体", 22.125F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MES提示信息.Location = new System.Drawing.Point(878, 50);
this.MES提示信息.Name = "MES提示信息";
this.MES提示信息.Size = new System.Drawing.Size(1041, 243);
this.MES提示信息.Size = new System.Drawing.Size(866, 233);
this.MES提示信息.TabIndex = 4;
this.MES提示信息.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
@@ -739,7 +743,7 @@ namespace WindowsFormsApp1
this.eventTableLayout.Controls.Add(this.label8, 0, 3);
this.eventTableLayout.Controls.Add(this.label9, 0, 4);
this.eventTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.eventTableLayout.Location = new System.Drawing.Point(4, 55);
this.eventTableLayout.Location = new System.Drawing.Point(4, 53);
this.eventTableLayout.Name = "eventTableLayout";
this.eventTableLayout.RowCount = 5;
this.eventTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
@@ -747,7 +751,7 @@ namespace WindowsFormsApp1
this.eventTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.eventTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.eventTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.eventTableLayout.Size = new System.Drawing.Size(430, 237);
this.eventTableLayout.Size = new System.Drawing.Size(430, 227);
this.eventTableLayout.TabIndex = 5;
//
// panel1
@@ -756,46 +760,46 @@ namespace WindowsFormsApp1
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(333, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(94, 41);
this.panel1.Size = new System.Drawing.Size(94, 39);
this.panel1.TabIndex = 0;
//
// panel2
//
this.panel2.Location = new System.Drawing.Point(38, 47);
this.panel2.Location = new System.Drawing.Point(38, 45);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(200, 41);
this.panel2.Size = new System.Drawing.Size(200, 39);
this.panel2.TabIndex = 1;
//
// panel4
//
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(333, 50);
this.panel4.Location = new System.Drawing.Point(333, 48);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(94, 41);
this.panel4.Size = new System.Drawing.Size(94, 39);
this.panel4.TabIndex = 2;
//
// panel3
//
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(333, 97);
this.panel3.Location = new System.Drawing.Point(333, 93);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(94, 41);
this.panel3.Size = new System.Drawing.Size(94, 39);
this.panel3.TabIndex = 1;
//
// panel5
//
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(333, 144);
this.panel5.Location = new System.Drawing.Point(333, 138);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(94, 41);
this.panel5.Size = new System.Drawing.Size(94, 39);
this.panel5.TabIndex = 3;
//
// panel6
//
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(333, 191);
this.panel6.Location = new System.Drawing.Point(333, 183);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(94, 43);
this.panel6.Size = new System.Drawing.Size(94, 41);
this.panel6.TabIndex = 4;
//
// label5
@@ -805,7 +809,7 @@ namespace WindowsFormsApp1
this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
this.label5.Location = new System.Drawing.Point(3, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(324, 47);
this.label5.Size = new System.Drawing.Size(324, 45);
this.label5.TabIndex = 5;
this.label5.Text = "label5";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -815,9 +819,9 @@ namespace WindowsFormsApp1
this.label6.AutoSize = true;
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(3, 47);
this.label6.Location = new System.Drawing.Point(3, 45);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(324, 47);
this.label6.Size = new System.Drawing.Size(324, 45);
this.label6.TabIndex = 6;
this.label6.Text = "label6";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -827,9 +831,9 @@ namespace WindowsFormsApp1
this.label7.AutoSize = true;
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(3, 94);
this.label7.Location = new System.Drawing.Point(3, 90);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(324, 47);
this.label7.Size = new System.Drawing.Size(324, 45);
this.label7.TabIndex = 7;
this.label7.Text = "label7";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -839,9 +843,9 @@ namespace WindowsFormsApp1
this.label8.AutoSize = true;
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label8.Location = new System.Drawing.Point(3, 141);
this.label8.Location = new System.Drawing.Point(3, 135);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(324, 47);
this.label8.Size = new System.Drawing.Size(324, 45);
this.label8.TabIndex = 8;
this.label8.Text = "label8";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -851,9 +855,9 @@ namespace WindowsFormsApp1
this.label9.AutoSize = true;
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.Location = new System.Drawing.Point(3, 188);
this.label9.Location = new System.Drawing.Point(3, 180);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(324, 49);
this.label9.Size = new System.Drawing.Size(324, 47);
this.label9.TabIndex = 9;
this.label9.Text = "label9";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -869,9 +873,9 @@ namespace WindowsFormsApp1
this.tableLayoutPanel9.Location = new System.Drawing.Point(1406, 3);
this.tableLayoutPanel9.Name = "tableLayoutPanel9";
this.tableLayoutPanel9.RowCount = 2;
this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 48F));
this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel9.Size = new System.Drawing.Size(345, 195);
this.tableLayoutPanel9.Size = new System.Drawing.Size(345, 187);
this.tableLayoutPanel9.TabIndex = 4;
//
// label4
@@ -881,7 +885,7 @@ namespace WindowsFormsApp1
this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(3, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(339, 50);
this.label4.Size = new System.Drawing.Size(339, 48);
this.label4.TabIndex = 0;
this.label4.Text = "胶水寿命";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -891,9 +895,9 @@ namespace WindowsFormsApp1
this.剩余寿命.AutoSize = true;
this.剩余寿命.Dock = System.Windows.Forms.DockStyle.Fill;
this.剩余寿命.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.剩余寿命.Location = new System.Drawing.Point(3, 50);
this.剩余寿命.Location = new System.Drawing.Point(3, 48);
this.剩余寿命.Name = "剩余寿命";
this.剩余寿命.Size = new System.Drawing.Size(339, 145);
this.剩余寿命.Size = new System.Drawing.Size(339, 139);
this.剩余寿命.TabIndex = 1;
this.剩余寿命.Text = "label5";
this.剩余寿命.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -906,7 +910,7 @@ namespace WindowsFormsApp1
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Size = new System.Drawing.Size(1752, 40);
this.groupBox1.Size = new System.Drawing.Size(1752, 38);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "处理界面";
@@ -929,13 +933,15 @@ namespace WindowsFormsApp1
this.tableLayoutPanel8.Controls.Add(this.底部注释3, 2, 0);
this.tableLayoutPanel8.Controls.Add(this.底部注释4, 3, 0);
this.tableLayoutPanel8.Controls.Add(this.底部注释5, 4, 0);
this.tableLayoutPanel8.Controls.Add(this.btnToggleTestMode, 9, 0);
this.tableLayoutPanel8.Controls.Add(this.button1, 8, 0);
this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 1070);
this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 1028);
this.tableLayoutPanel8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel8.Name = "tableLayoutPanel8";
this.tableLayoutPanel8.RowCount = 1;
this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel8.Size = new System.Drawing.Size(1754, 38);
this.tableLayoutPanel8.Size = new System.Drawing.Size(1754, 36);
this.tableLayoutPanel8.TabIndex = 7;
//
// 底部注释1
@@ -944,7 +950,7 @@ namespace WindowsFormsApp1
this.底部注释1.AutoSize = true;
this.底部注释1.Location = new System.Drawing.Point(3, 6);
this.底部注释1.Name = "底部注释1";
this.底部注释1.Size = new System.Drawing.Size(108, 25);
this.底部注释1.Size = new System.Drawing.Size(118, 24);
this.底部注释1.TabIndex = 0;
this.底部注释1.Text = "底部注释1";
//
@@ -954,7 +960,7 @@ namespace WindowsFormsApp1
this.底部注释2.AutoSize = true;
this.底部注释2.Location = new System.Drawing.Point(178, 6);
this.底部注释2.Name = "底部注释2";
this.底部注释2.Size = new System.Drawing.Size(108, 25);
this.底部注释2.Size = new System.Drawing.Size(118, 24);
this.底部注释2.TabIndex = 1;
this.底部注释2.Text = "底部注释2";
//
@@ -964,7 +970,7 @@ namespace WindowsFormsApp1
this.底部注释3.AutoSize = true;
this.底部注释3.Location = new System.Drawing.Point(353, 6);
this.底部注释3.Name = "底部注释3";
this.底部注释3.Size = new System.Drawing.Size(108, 25);
this.底部注释3.Size = new System.Drawing.Size(118, 24);
this.底部注释3.TabIndex = 2;
this.底部注释3.Text = "底部注释3";
//
@@ -974,7 +980,7 @@ namespace WindowsFormsApp1
this.底部注释4.AutoSize = true;
this.底部注释4.Location = new System.Drawing.Point(528, 6);
this.底部注释4.Name = "底部注释4";
this.底部注释4.Size = new System.Drawing.Size(108, 25);
this.底部注释4.Size = new System.Drawing.Size(118, 24);
this.底部注释4.TabIndex = 3;
this.底部注释4.Text = "底部注释4";
//
@@ -984,10 +990,33 @@ namespace WindowsFormsApp1
this.底部注释5.AutoSize = true;
this.底部注释5.Location = new System.Drawing.Point(703, 6);
this.底部注释5.Name = "底部注释5";
this.底部注释5.Size = new System.Drawing.Size(108, 25);
this.底部注释5.Size = new System.Drawing.Size(118, 24);
this.底部注释5.TabIndex = 4;
this.底部注释5.Text = "底部注释5";
//
// btnToggleTestMode
//
this.btnToggleTestMode.BackColor = System.Drawing.Color.Gray;
this.btnToggleTestMode.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnToggleTestMode.Location = new System.Drawing.Point(1578, 3);
this.btnToggleTestMode.Name = "btnToggleTestMode";
this.btnToggleTestMode.Size = new System.Drawing.Size(173, 30);
this.btnToggleTestMode.TabIndex = 5;
this.btnToggleTestMode.Text = "调试模式";
this.btnToggleTestMode.UseVisualStyleBackColor = false;
this.btnToggleTestMode.Click += new System.EventHandler(this.BtnToggleTestMode_Click);
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
this.button1.Location = new System.Drawing.Point(1403, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(169, 30);
this.button1.TabIndex = 6;
this.button1.Text = "螺丝开盖";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tableLayoutPanel7
//
this.tableLayoutPanel7.ColumnCount = 2;
@@ -996,12 +1025,12 @@ namespace WindowsFormsApp1
this.tableLayoutPanel7.Controls.Add(this.richTextBox1, 0, 0);
this.tableLayoutPanel7.Controls.Add(this.richTextBox2, 1, 0);
this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 669);
this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 643);
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(1754, 294);
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 19F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(1754, 282);
this.tableLayoutPanel7.TabIndex = 10;
//
// richTextBox1
@@ -1009,7 +1038,7 @@ namespace WindowsFormsApp1
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(871, 288);
this.richTextBox1.Size = new System.Drawing.Size(871, 276);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
@@ -1018,15 +1047,15 @@ namespace WindowsFormsApp1
this.richTextBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox2.Location = new System.Drawing.Point(880, 3);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(871, 288);
this.richTextBox2.Size = new System.Drawing.Size(871, 276);
this.richTextBox2.TabIndex = 1;
this.richTextBox2.Text = "";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1760, 1112);
this.ClientSize = new System.Drawing.Size(1760, 1068);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.tableLayoutPanel1);
this.MainMenuStrip = this.menuStrip1;
@@ -1142,6 +1171,8 @@ namespace WindowsFormsApp1
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button btnToggleTestMode;
private System.Windows.Forms.Button button1;
}
}
+471 -123
View File
@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Media;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
@@ -30,10 +32,15 @@ namespace WindowsFormsApp1
{
public partial class MainForm : Form
{
#region 内部变量
// 添加一个静态互斥体对象,用于防止程序多开
private static Mutex _singleInstanceMutex;
// 添加一个标志变量,用于标记是否已经执行了清理操作
private bool _isCleanupDone = false;
private bool _isFormClosing = false; // 添加标志,表示窗体正在关闭
// 添加一个静态变量来跟踪下一个要使用的槽位
// 添加标志,表示窗体正在关闭
private bool _isFormClosing = false;
// 添加一个静态变量来跟踪下一个要使用的槽位
private static int _nextEventSlot = 1;
// 在MainForm类中添加一个字典,用于存储PLC状态控件
private Dictionary<int, System.Windows.Forms.Label> plcStatusLabels = new Dictionary<int, System.Windows.Forms.Label>();
@@ -43,23 +50,35 @@ namespace WindowsFormsApp1
private System.Windows.Forms.Timer statusReportTimer = new System.Windows.Forms.Timer();
private ApiClient statusApiClient = new ApiClient(); // 专用于状态上报的API客户端
private object curingLock = new object();
private int OldPlcTrigger = 0;
private Dictionary<int, int> OldPlcTrigger = new Dictionary<int, int>();
// 在MainForm类的成员变量部分添加
private List<Label> eventNameLabels = new List<Label>();
private List<Panel> eventPanels = new List<Panel>();
private Queue<EventInfo> eventHistory = new Queue<EventInfo>();
private const int MAX_EVENT_DISPLAY = 5;
#endregion 内部变量
public MainForm()
{
if (!EnsureSingleInstance())
{
MessageBox.Show("程序已经在运行中,不能重复启动!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
Environment.Exit(0);
return;
}
InitializeComponent();
InitializeEventDisplay();
CheckForIllegalCrossThreadCalls = false;
}
// 初始化状态上报定时器
statusReportTimer.Interval = 15000; // 15秒
statusReportTimer.Tick += StatusReportTimer_Tick;
// 单实例运行的方法
private bool EnsureSingleInstance()
{
bool createdNew;
// 创建一个全局命名的互斥体
_singleInstanceMutex = new Mutex(true, "WindowsFormsApp1_MES_PLC_Control_SingleInstance" + Init.t_Line.linename, out createdNew);
return createdNew;
}
private void Form1_Load(object sender, EventArgs e)
@@ -69,20 +88,12 @@ namespace WindowsFormsApp1
LogExecute.ApilogNet.BeforeSaveToFile += LogNet_BeforeSaveToFile;
LogExecute.OEElogNet.BeforeSaveToFile += LogNet_BeforeSaveToFile;
FormRecover();
linename.Text = $"{Init.t_Line.linename}";
linecode.Text = $"Line: {Init.t_Line.lineremark1}";
linetype.Text = $"Station: {Init.t_Line.lineremark2}";
linemode.Text = $"MachineID: {Init.t_Line.lineremark3}";
//lineremark1.Text = "";
//lineremark2.Text = "";
//lineremark3.Text = "";
//lineremark4.Text = "";
//lineremark5.Text = "";
//lineremark6.Text = "";
//lineremark7.Text = "";
操作人员ID.Text = Init.t_User.username;
@@ -98,6 +109,8 @@ namespace WindowsFormsApp1
系统参数配置ToolStripMenuItem.Enabled = true;
}
// 初始化测试模式切换按钮
InitializeTestModeButton();
// 添加窗体关闭事件处理
this.FormClosing += MainForm_FormClosing;
@@ -105,9 +118,11 @@ namespace WindowsFormsApp1
// 自动开始处理
开始处理_Click(this, EventArgs.Empty);
// 初始化状态上报定时器
statusReportTimer.Interval = int.Parse(Init.t_Keyvalues.First(x => x.key == "StatusTime").value) * 1000; // 15秒
statusReportTimer.Tick += StatusReportTimer_Tick;
}
public void build(t_plc Plc, CancellationToken token)
{
// 获取当前线程名称
@@ -147,7 +162,7 @@ namespace WindowsFormsApp1
// 更新对应PLC的状态指示器为红色
UpdatePlcStatus(Plc.id, false);
LogExecute.logNet.WriteError($"{Plc.plcip}建立S7连接失败");
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}建立S7连接失败");
continue;
}
@@ -163,43 +178,110 @@ namespace WindowsFormsApp1
{
//PLC链接状态.Text = "PLC链接状态:NG";
//PLC链接状态.BackColor = Color.Red;
LogExecute.logNet.WriteError($"{Plc.plcip}读取全部地址处理错误:处理停止");
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}读取全部地址处理错误:处理停止");
continue;
}
//写入心跳
/*
* //写入心跳 在主线程取消,单独开线程 写plc心跳
PlcData.Write_Heartbeat = PlcData.Write_Heartbeat == 0 ? (short)1 : (short)0;
var haertresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!haertresult.Success)
{
//PLC链接状态.Text = "PLC链接状态:NG";
//PLC链接状态.BackColor = Color.Red;
LogExecute.logNet.WriteError($"{Plc.plcip}写入心跳错误:处理停止");
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}写入心跳错误:处理停止");
continue;
}
}*/
//if(Plc.id == 1)
//{
//PlcData.Read_MaterialCode0 = PlcData.Write_stSN;
LOT号.Text = PlcData.Write_stSN;
Tray盘二维码.Text = PlcData.Read_MaterialCode1;
if (Init.t_Lineplcs.Count >= 2 && Plc.id == Init.t_Lineplcs.First().plcid)
{
LOT号.Text = PlcData.Write_stSN;
Tray盘二维码.Text = PlcData.Read_MaterialCode1;
/*
//额外功能,将sn写入数据库中
var snHelper = new db.SQLiteHelper<t_sn>();
var snList = snHelper.QueryAll();
if(snList.Success && snList.Data.Count > 0)
{
var t_sn = new t_sn
{
id = 1,
sn = PlcData.Read_MaterialCode0
};
snHelper.Update(t_sn);
}
else
{
var t_sn = new t_sn
{
id = 1,
sn = PlcData.Read_MaterialCode0
};
snHelper.Insert(t_sn);
}
*/
}
if(Init.t_Lineplcs.Count == 1)
{
LOT号.Text = PlcData.Write_stSN;
Tray盘二维码.Text = PlcData.Read_MaterialCode1;
}
材料值.Text = PlcData.Read_MaterialCode2;
Init.ImageLocation = PlcData.Read_Other4;
Init.ImageName = PlcData.Read_Other3.ToString();
//}
Init.ScrewBegin = PlcData.Read_Other2;
#region 螺丝引导相关
// 螺丝 OK/NG
string vedioFolder = Path.Combine(Application.StartupPath, "WAV");
if (PlcData.Read_Other1 == 1 && PlcData.Write_Other0 != 1)
{
var player = new SoundPlayer(Path.Combine(vedioFolder, "OK.wav"));
player.Play();
PlcData.Write_Other0 = 1;
}
else if (PlcData.Read_Other1 == 2 && PlcData.Write_Other0 != 1)
{
var player = new SoundPlayer(Path.Combine(vedioFolder, "NOK.wav"));
player.Play();
PlcData.Write_Other0 = 1;
}
var okNgresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!okNgresult.Success)
{
LogExecute.logNet.WriteError($"{Plc.plcip}写入OK/NG:处理停止");
continue;
}
var imageFormIsOpened = false;
foreach (Form form in Application.OpenForms)
{
if (form.Name == "ImageDisplayForm")
{
imageFormIsOpened = true;
}
}
// 开始打螺丝 1
if (PlcData.Read_Other2 == 1)
{
if (!imageFormIsOpened)
{
this.Invoke(new Action(() => {
ImageDisplayForm imageDisplayForm = new ImageDisplayForm();
imageDisplayForm.Show();
}));
}
}
#endregion 螺丝引导相关
当前时间.Text = $"PLC状态:{plcstatus.GetName(typeof(plcstatus), PlcData.Read_Status)}";
DateTime Plc_Time = DateTime.Now;
//PLC链接状态.Text = "PLC链接状态:OK";
//PLC链接状态.BackColor = SystemColors.Control;
//PLC通讯时间.Text = "PLC通讯时间:" + Plc_Time.ToString("MM-dd HH:mm:ss");
// 更新对应PLC的状态指示器为绿色
//LogExecute.logNet.WriteError($"{Plc.plcname}");
UpdatePlcStatus(Plc.id, true);
#endregion
@@ -207,6 +289,7 @@ namespace WindowsFormsApp1
ApiClient apiClient = new ApiClient();
otherdata otherdata = new otherdata();
//Init.SN = PlcData.Read_MaterialCode0;
#region 机台状态及报警
//机台状态
@@ -295,13 +378,14 @@ namespace WindowsFormsApp1
#region 判断及查找流程
if (PlcData.Read_Trigger == OldPlcTrigger)
var oldtrigger = OldPlcTrigger[Plc.id];
if (PlcData.Read_Trigger == oldtrigger)
{
continue;
}
else
{
OldPlcTrigger = PlcData.Read_Trigger;
OldPlcTrigger[Plc.id] = PlcData.Read_Trigger;
}
if (PlcData.Read_Trigger == 0 && PlcData.Write_Status == 0)
@@ -324,7 +408,7 @@ namespace WindowsFormsApp1
}
continue;
}
LogExecute.logNet.WriteDebug($"读取状态字{PlcData.Read_Trigger}");
LogExecute.logNet.WriteDebug($"读取状态字{Plc.id}-{PlcData.Read_Trigger}");
var nowflow = Init.t_Flows.FirstOrDefault(a => a.hopestatus == PlcData.Read_Trigger);
if (nowflow == null)
@@ -365,6 +449,21 @@ namespace WindowsFormsApp1
if (nowflow.dzscan)
{
//扫码
ScanForm scanForm = new ScanForm();
DialogResult scan_result = scanForm.ShowDialog();
if (scan_result == DialogResult.OK)
{
string returnValue = scanForm.ReturnValue;
材料值.Text = returnValue;
Init.DZString = returnValue;
}
else
{
continue;
}
/*
//扫码
var stationid = Init.t_Line.lineremark2;
// ccd扫码
if ("Assy1,".Contains(stationid))
@@ -418,7 +517,7 @@ namespace WindowsFormsApp1
//MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
}
continue;
*/
//if (scan_result == DialogResult.OK)
//{
// string returnValue = scanForm.ReturnValue;
@@ -489,71 +588,75 @@ namespace WindowsFormsApp1
}
#endregion
#region 判断物料调用次数 固化站
#region 判断物料调用次数 固化站,抽真空
lock (curingLock)
{
if (Init.t_Line.lineremark2 == "Curing")
bool shouldCallApi = false;
if (Init.t_Line.lineremark2.ToLower() == "curing")
{
SQLiteHelper<t_materialcall> materialCallHelper = new SQLiteHelper<t_materialcall>();
string materialId = PlcData.Read_MaterialCode0;
bool shouldCallApi = false;
string materialId = PlcData.Read_MaterialCode1;
var materialCall = materialCallHelper.QuerySingle(m => m.materialid == materialId).Data;
if (materialCall == null)
var materialCall = materialCallHelper.QuerySingle(m => m.materialid == materialId
&& !m.isout).Data;
// plc1 进 plc2,3 加热,冷却,plc3 出
if (Plc.id == 1)
{
// 首次进站,需要调用接口
materialCall = new t_materialcall { materialid = materialId };
materialCall.checkin1 = DateTime.Now;
materialCallHelper.Insert(materialCall);
shouldCallApi = true;
}
else
{
// 判断当前是第几次调用
if (!materialCall.checkin1.HasValue)
// checkin callapi
if (nowinterface.code.Contains("SN_CheckIN"))
{
materialCall = new t_materialcall { materialid = materialId };
materialCall.sn = "testsn";
materialCall.checkin1 = DateTime.Now;
materialCallHelper.Insert(materialCall);
shouldCallApi = true;
}
else if (!materialCall.checkout3.HasValue
&& materialCall.checkout2.HasValue
&& materialCall.checkout1.HasValue
&& nowinterface.code.Contains("Checkout"))
else if (nowinterface.code.Contains("Checkout"))
{
materialCall.checkout1 = DateTime.Now;
materialCall.sn = PlcData.Write_stSN;
materialCallHelper.Update(materialCall);
}
}
else if (Plc.id == 2 || Plc.id == 3)
{
if (nowinterface.code.Contains("SN_CheckIN"))
{
materialCall.checkin2 = DateTime.Now;
materialCallHelper.Update(materialCall);
PlcData.Write_stSN = materialCall.sn;
}
else if (nowinterface.code.Contains("Checkout"))
{
materialCall.checkout2 = DateTime.Now;
materialCallHelper.Update(materialCall);
}
}
else if (Plc.id == 4)
{
//checkout callapi
if (nowinterface.code.Contains("SN_CheckIN"))
{
materialCall.checkin3 = DateTime.Now;
materialCallHelper.Update(materialCall);
PlcData.Write_stSN = materialCall.sn;
}
else if (nowinterface.code.Contains("Checkout"))
{
// 第三次出站,需要调用接口
materialCall.checkout3 = DateTime.Now;
materialCall.isout = true;
materialCallHelper.Update(materialCall);
shouldCallApi = true;
}
else
{
// 更新对应的时间
if (nowinterface.code.Contains("SN_CheckIN"))
{
if (!materialCall.checkin2.HasValue)
materialCall.checkin2 = DateTime.Now;
else if (!materialCall.checkin3.HasValue)
materialCall.checkin3 = DateTime.Now;
PlcData.Write_Status = PLC_Status.SN_CheckIN;
}
else if (nowinterface.code.Contains("SN_Checkout"))
{
if (!materialCall.checkout1.HasValue)
materialCall.checkout1 = DateTime.Now;
else if (!materialCall.checkout2.HasValue)
materialCall.checkout2 = DateTime.Now;
PlcData.Write_Status = PLC_Status.SN_Checkout;
}
}
materialCallHelper.Update(materialCall);
}
if (!shouldCallApi)
{
// 不需要调用接口,直接返回成功
PlcData.Write_Status = nowinterface.code.Contains("SN_CheckIN")
? (short)PLC_Status.SN_CheckIN
: (short)PLC_Status.SN_Checkout;
PlcData.Write_Status = PlcData.Read_Trigger;
var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!writeresult.Success)
{
@@ -563,6 +666,42 @@ namespace WindowsFormsApp1
continue;
}
}
/* else if (Init.t_Line.lineremark2.ToLower() == "vacuum")
{
//抽真空,两个穴位,判断是否重复进站
SQLiteHelper<t_materialcall> materialCallHelper = new SQLiteHelper<t_materialcall>();
string materialId = PlcData.Read_MaterialCode1;
var materialCall = materialCallHelper.QuerySingle(m => m.materialid == materialId
&& !m.isout).Data;
if (materialCall == null)
{
//首次进站 in
materialCall.materialid = materialId;
materialCallHelper.Insert(materialCall);
shouldCallApi = true;
}
else if (materialCall.isout)
{
//不交互MES,直接返回状态字
PlcData.Write_Status = PlcData.Read_Trigger;
var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!writeresult.Success)
{
LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止");
continue;
}
continue;
}
else
{
// out
materialCall.isout = true;
materialCallHelper.Update(materialCall);
shouldCallApi = true;
}
}*/
}
#endregion
@@ -570,6 +709,7 @@ namespace WindowsFormsApp1
otherdata.FileUploadAddress = Init.t_Keyvalues.First(x => x.key == "UploadPath").value;
otherdata.ImageAddress = Init.t_Keyvalues.First(x => x.key == "ImageFilePath").value;
otherdata.VedioAddress = Init.t_Keyvalues.First(x => x.key == "VedioFilePath").value;
otherdata.plcid = Plc.id;
#region 调用后端接口
var result = apiClient.CallFunctionByName(nowinterface.code, PlcData, otherdata);
@@ -580,34 +720,48 @@ namespace WindowsFormsApp1
if (result.Success)
{
ChangeBarcode();
MES_MsgfORM(nowinterface.code, result, result.Requesttime);
var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!writeresult.Success)
{
//PLC链接状态.Text = "PLC链接状态:NG";
//PLC链接状态.BackColor = Color.Red;
LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止");
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}写入地址处理错误:处理停止");
continue;
}
else
{
ChangeBarcode();
MES_MsgfORM(nowinterface.code, result, result.Requesttime);
//MES链接状态.Text = "MES链接状态:OK";
//MES链接状态.BackColor = SystemColors.Control;
//MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
if (result.Mesresult != mesresult.PASS)
{
PlcData.Write_Status = 1001;
if (result.Msg.Contains("机台上料数量不够扣料"))
{
PlcData.Write_Status = 1003;
}
else if (result.Msg.Contains("此载具为空"))
{
PlcData.Write_Status = 1004;
}
else
{
PlcData.Write_Status = 1001;
}
siemensHelp.WriteAddress(plcaddress, PlcData);
LogExecute.logNet.WriteDebug($"上位机写入触发字:{PlcData.Write_Status}");
continue;
}
else
{
//出站清空sn
if (nowinterface.code == "SN_Checkout")
{
PlcData.Write_stSN = "";
}
}
}
}
else
{
//MES链接状态.Text = "MES链接状态:NG";
//MES链接状态.BackColor = Color.Red;
LogExecute.logNet.WriteError($"MES通讯异常!");
PlcData.Write_Status = 1002;
siemensHelp.WriteAddress(plcaddress, PlcData);
@@ -706,7 +860,11 @@ namespace WindowsFormsApp1
return;
}
foreach (var item in Init.t_Lineplcs)
{
if(!OldPlcTrigger.ContainsKey(item.plcid))
OldPlcTrigger.Add(item.plcid, 0);
}
#region 初始化全局变量
@@ -717,13 +875,16 @@ namespace WindowsFormsApp1
Init.t_Pressurecurves = pressurecurve_result.Data;
Init.t_Interfaces = interface_result.Data;
Init.t_Keyvalues = key_sqlresult.Data;
Init.t_plcs = plc_result;
// 初始化PLC状态面板
InitializePlcStatusPanel();
// 启动状态上报定时器
statusReportTimer.Start();
#endregion
#region 初始化COM口服务
try
{
@@ -791,6 +952,22 @@ namespace WindowsFormsApp1
threadHelp.isrunning1 = true;
}
Init.threadHelps.Add(threadHelp);
//心跳线程
ThreadHelp threadHelp1 = new ThreadHelp();
if (!threadHelp1.isrunning1)
{
threadHelp1.cancellationTokenSource1 = new CancellationTokenSource();
threadHelp1.Thread = new Thread(() => plcheart(plc, threadHelp1.cancellationTokenSource1.Token));
threadHelp1.Thread.Name = $"PLC_{plc.id}_heartThread"; // 显式设置线程名称
threadHelp1.Thread.Start();
threadHelp1.isrunning1 = true;
}
Init.threadHelps.Add(threadHelp1);
}
if(Init.t_User.username.ToLower() != "admin")
{
this.btnToggleTestMode.Enabled = false;
}
开始处理.Text = "停止处理";
@@ -824,6 +1001,7 @@ namespace WindowsFormsApp1
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
开始处理.Enabled = false;
// 设置窗体正在关闭标志
_isFormClosing = true;
@@ -853,6 +1031,14 @@ namespace WindowsFormsApp1
}
});
}
// 释放互斥体
if (_singleInstanceMutex != null)
{
_singleInstanceMutex.ReleaseMutex();
_singleInstanceMutex.Close();
_singleInstanceMutex = null;
}
}
// 添加一个清理资源的私有方法
@@ -873,7 +1059,11 @@ namespace WindowsFormsApp1
if (thread.Thread != null && thread.Thread.IsAlive)
{
thread.cancellationTokenSource1?.Cancel();
thread.Thread.Join(); // 等待线程完成
var threadEnded = thread.Thread.Join(3000); // 等待线程完成
if (!threadEnded)
{
LogExecute.logNet.WriteWarn($"线程 {thread.Thread.Name} 未能在规定时间内结束,将强制继续");
}
}
thread.isrunning1 = false;
}
@@ -911,6 +1101,7 @@ namespace WindowsFormsApp1
}
#endregion
#region 页面按钮-跳转
private void 扭力角度扭矩设置ToolStripMenuItem_Click(object sender, EventArgs e)
{
@@ -923,6 +1114,7 @@ namespace WindowsFormsApp1
Torqueaddress_Manage torqueaddress_Manage = new Torqueaddress_Manage();
torqueaddress_Manage.ShowDialog();
}
private void 流程管理ToolStripMenuItem_Click(object sender, EventArgs e)
{
Flow_Manage fLOW_Mange = new Flow_Manage();
@@ -947,12 +1139,6 @@ namespace WindowsFormsApp1
materialScanForm.Show();
}
//private void 图片展示ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// ImageDisplayForm displayForm = new ImageDisplayForm();
// displayForm.Show();
//}
private void pLC通讯设置ToolStripMenuItem_Click(object sender, EventArgs e)
{
Plc_Manage pLC_Manage = new Plc_Manage();
@@ -964,6 +1150,7 @@ namespace WindowsFormsApp1
PlcAddress_Manage pLCADDRESS_Manage = new PlcAddress_Manage();
pLCADDRESS_Manage.ShowDialog();
}
private void 切换用户ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Restart();
@@ -992,7 +1179,27 @@ namespace WindowsFormsApp1
SerialPort_Manage serialPort_Manage = new SerialPort_Manage();
serialPort_Manage.ShowDialog();
}
private void 图片标注ToolStripMenuItem_Click(object sender, EventArgs e)
{
SimpleImageDisplayForm simpleImageDisplayForm = new SimpleImageDisplayForm();
simpleImageDisplayForm.ShowDialog();
}
private void 螺丝引导ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
ImageDisplayForm imageDisplayForm = new ImageDisplayForm();
imageDisplayForm.SetCurrentName(Init.ImageName);
imageDisplayForm.ShowDialog();
}
catch
{
}
}
#endregion
#region 页面-布局、日志等
private void LogNet_BeforeSaveToFile(object sender, HslEventArgs e)
{
@@ -1094,6 +1301,7 @@ namespace WindowsFormsApp1
{
当前时间.Text = "当前时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
}
public void FormRecover()
{
开始处理.Text = "开始处理";
@@ -1124,6 +1332,7 @@ namespace WindowsFormsApp1
剩余寿命.Text = power == null ? "" : power.value;
}
#region PLC状态面板
// 添加初始化PLC状态面板的方法
private void InitializePlcStatusPanel()
{
@@ -1208,13 +1417,16 @@ namespace WindowsFormsApp1
// 使用Invoke确保在UI线程上更新控件
this.Invoke((MethodInvoker)delegate
{
plcStatusIndicators[plcId].BackColor = Color.Gray;
plcStatusIndicators[plcId].BackColor = isConnected ? Color.Green : Color.Red;
});
}
}
catch { /* 忽略异常 */ }
}
#endregion PLC状态面板
#region 事件显示区域
// 添加初始化事件显示区域的方法
private void InitializeEventDisplay()
{
@@ -1290,6 +1502,7 @@ namespace WindowsFormsApp1
eventHistory = new Queue<EventInfo>();
}
// 修改UpdateEventDisplay方法
private void UpdateEventDisplay(string name, mesresult result, DateTime dateTime, string message)
{
@@ -1331,16 +1544,16 @@ namespace WindowsFormsApp1
// 计算开始显示的索引,确保最新的事件显示在底部
int startIndex = 0;
int displayCount = Math.Min(events.Length, MAX_EVENT_DISPLAY);
// 填充显示区域,按照时间顺序从上到下排列
for (int i = 0; i < displayCount; i++)
{
// 获取当前事件(从最早的开始)
EventInfo currentEvent = events[i];
// 更新事件名称标签
eventNameLabels[i].Text = $"{currentEvent.Name} | {currentEvent.Time.ToString("HH:mm:ss")} ";
// 更新事件结果面板颜色
switch (currentEvent.Result)
{
@@ -1354,7 +1567,7 @@ namespace WindowsFormsApp1
}
}
// 修改MES_MsgfORM方法
// 显示信息
public void MES_MsgfORM(string name, ApiFormResult result, DateTime dateTime)
{
if ("status,alarm".Contains(name.ToLower()))
@@ -1365,22 +1578,19 @@ namespace WindowsFormsApp1
MES提示信息.ForeColor = result.Mesresult == mesresult.PASS ? Color.Green : Color.Red;
事件结果.Visible = true;
事件结果.Text = result.Mesresult == mesresult.PASS ? "PASS" : "FIELD";
事件结果.Text = result.Mesresult == mesresult.PASS ? "PASS" : "FAIL";
事件结果.ForeColor = result.Mesresult == mesresult.PASS ? Color.Green : Color.Red;
// 更新事件显示区域
UpdateEventDisplay(name, result.Mesresult, dateTime, result.Msg);
}
#endregion 事件显示区域
#endregion
#region 其他业务处理
private void 胶水上下线_Click(object sender, EventArgs e)
{
ScanForm_SSQ scanForm = new ScanForm_SSQ();
DialogResult result = scanForm.ShowDialog();
// 写plc
}
//气密接收
public void AirtightPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
@@ -1469,15 +1679,73 @@ namespace WindowsFormsApp1
LogExecute.logNet.WriteError($"通过气密仪获取到压力参数失败,错误原因{ex.Message}");
}
}
// 在初始化组件的方法中添加按钮
private void InitializeTestModeButton()
{
// 初始化按钮状态
UpdateTestModeButtonState();
}
// 切换测试模式的事件处理程序
private void BtnToggleTestMode_Click(object sender, EventArgs e)
{
// 获取当前模式并切换
SQLiteHelper<t_keyvalue> kvHelper = new db.SQLiteHelper<t_keyvalue>();
var testModeSetting = kvHelper.QuerySingle(x => x.key == "TestMode");
bool currentMode = testModeSetting.Success ? testModeSetting.Data.value == "1" : true;
// 切换模式
bool newMode = !currentMode;
// 更新数据库
if (testModeSetting.Success)
{
testModeSetting.Data.value = newMode ? "1" : "0";
kvHelper.Update(testModeSetting.Data);
}
else
{
// 如果设置不存在,创建新的设置
t_keyvalue newSetting = new t_keyvalue
{
key = "TestMode",
value = newMode ? "1" : "0",
remark = "接口测试模式:1=调试模式,0=MES模式"
};
kvHelper.Insert(newSetting);
}
// 更新按钮状态
UpdateTestModeButtonState();
// 显示提示
MessageBox.Show(newMode ? "已切换到调试模式,不调用实际接口" : "已切换到MES模式,将调用实际接口");
// 记录日志
LogExecute.logNet.WriteInfo($"用户{Init.t_User.username}切换接口模式为: {(newMode ? "调试模式" : "MES模式")}");
}
// 更新测试模式按钮状态
private void UpdateTestModeButtonState()
{
SQLiteHelper<t_keyvalue> kvHelper = new db.SQLiteHelper<t_keyvalue>();
var testModeSetting = kvHelper.QuerySingle(x => x.key == "TestMode");
bool isTestMode = testModeSetting.Success ? testModeSetting.Data.value == "1" : true;
btnToggleTestMode.Text = $"{(isTestMode ? "调试模式" : "MES模式")}";
btnToggleTestMode.BackColor = isTestMode ? Color.LightPink : Color.LightGreen;
}
#endregion
#region 定时器
// 添加状态上报定时器的事件处理方法
private void StatusReportTimer_Tick(object sender, EventArgs e)
{
try
{
// 如果没有PLC数据或者状态为0,则不上报
if (Init.Plcstatus == 0)
if (Init.Plcstatus == 0 || Init.Plcstatus == -1)
return;
otherdata statusOtherData = new otherdata();
@@ -1504,16 +1772,96 @@ namespace WindowsFormsApp1
}
}
private void 图片标注ToolStripMenuItem_Click(object sender, EventArgs e)
{
SimpleImageDisplayForm simpleImageDisplayForm = new SimpleImageDisplayForm();
simpleImageDisplayForm.ShowDialog();
}
// 定时扫描 周期扫描未上传 图片,视频等 sn,然后调用上传文件接口 todo
#endregion 定时器
private void 螺丝引导ToolStripMenuItem_Click(object sender, EventArgs e)
/// <summary>
/// 螺丝开盖
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
ImageDisplayForm imageDisplayForm = new ImageDisplayForm();
imageDisplayForm.ShowDialog();
var plc = Init.t_plcs.FirstOrDefault();
plc.plchelp = new SiemensHelp(plc.plcip, plc.timeout);
SiemensHelp siemensHelp = plc.plchelp;
List<t_plcaddress> plcaddress = Init.t_Plcaddresses.FindAll(a => a.plcid == plc.id);
var openresult = siemensHelp.OpenConn();
plcdata PlcData = new plcdata();
var resdresult = siemensHelp.ReadAddress(plcaddress, PlcData);
if (!resdresult.Success)
{
LogExecute.logNet.WriteError($"{plc.plcname}:{plc.plcip}读取全部地址处理错误:处理停止");
}
//扫码
ScanForm scanForm = new ScanForm();
DialogResult scan_result = scanForm.ShowDialog();
if (scan_result == DialogResult.OK)
{
string returnValue = scanForm.ReturnValue;
var writeVal = Init.t_Keyvalues.First(x => x.key == returnValue)?.value;
if (string.IsNullOrEmpty(writeVal))
{
PlcData.Write_Other4 = short.Parse(writeVal);
var result = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!result.Success)
{
LogExecute.logNet.WriteError($"{plc.plcname}:{plc.plcip}写入螺丝开盖失败:处理停止");
}
else
{
LogExecute.logNet.WriteInfo($"{plc.plcname}:{plc.plcip}写入螺丝开盖成功,值:{writeVal}");
}
}
else
{
LogExecute.logNet.WriteError($"未找到螺丝开盖二维码!");
}
}
}
//plc心跳
private void plcheart(t_plc Plc, CancellationToken token)
{
while (!token.IsCancellationRequested)
{
try
{
SiemensHelp siemensHelp = Plc.plchelp;
List<t_plcaddress> plcaddress = Init.t_Plcaddresses.FindAll(a => a.plcid == Plc.id);
plcdata PlcData = new plcdata();
var resdresult = siemensHelp.ReadAddress(plcaddress, PlcData);
if (!resdresult.Success)
{
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}读取全部地址处理错误!");
}
//写入心跳
PlcData.Write_Heartbeat = PlcData.Write_Heartbeat == 0 ? (short)1 : (short)0;
//LogExecute.logNet.WriteDebug($"{Plc.plcname}:{Plc.plcip}写入心跳{PlcData.Write_Heartbeat}!");
var haertresult = siemensHelp.WriteAddress(plcaddress, PlcData);
if (!haertresult.Success)
{
LogExecute.logNet.WriteError($"{Plc.plcname}:{Plc.plcip}写入心跳错误!");
}
}
catch (Exception)
{
}
finally
{
Thread.Sleep(1000);
}
}
}
}
}
+3
View File
@@ -41,6 +41,7 @@ namespace WindowsFormsApp1
public static List<t_flow> t_Flows;
public static List<t_lineplc> t_Lineplcs;
public static List<t_plc> t_plcs;
public static List<t_interface> t_Interfaces;
public static List<t_plcaddress> t_Plcaddresses;
@@ -54,6 +55,7 @@ namespace WindowsFormsApp1
public static List<ThreadHelp> threadHelps;
public static string ScanString;
public static string DZString;
//PLC状态存储
public static short Plcstatus = -1;
@@ -73,6 +75,7 @@ namespace WindowsFormsApp1
public static string ImageName { get; set; }
public static int ImageLocation { get; set; }
public static short ScrewBegin { get; set; }
public static int PlcTrigger { get; set; }
+300 -51
View File
@@ -5,6 +5,8 @@ using System.ComponentModel;
using System.IO;
using WindowsFormsApp1.mod;
using WindowsFormsApp1.db;
using System.Collections.Generic;
using System.Linq;
namespace WindowsFormsApp1
{
@@ -23,13 +25,33 @@ namespace WindowsFormsApp1
private string currentName = "";
private string currentPosition = "";
private bool isBlinking = false;
// 圆形标记相关参数
private float currentRadius = 20f;
private const float MIN_RADIUS = 20f;
private const float MAX_RADIUS = 50f;
private const float MIN_RADIUS = 30f;
private const float MAX_RADIUS = 55f;
private bool isExpanding = true;
private const float RADIUS_CHANGE_SPEED = 2f;
// 添加上一个位置的坐标
private int previousX = -1;
private int previousY = -1;
private bool hasPreviousPosition = false;
// 添加所有点位的列表
private List<t_imageposition> allPositions = new List<t_imageposition>();
private bool showAllPositions = true;
// 添加历史位置列表
private List<PositionHistory> previousPositions = new List<PositionHistory>();
// 定义历史位置类
private class PositionHistory
{
public int X { get; set; }
public int Y { get; set; }
public string Position { get; set; }
}
#endregion
#region 构造函数和初始化
@@ -43,6 +65,25 @@ namespace WindowsFormsApp1
autoUpdateTimer.Interval = 1000;
autoUpdateTimer.Tick += new EventHandler(AutoUpdateTimer_Tick);
autoUpdateTimer.Start();
// 添加窗体加载事件
this.Load += ImageDisplayForm_Load;
}
private void ImageDisplayForm_Load(object sender, EventArgs e)
{
// 设置窗体大小为屏幕工作区的80%
Screen screen = Screen.FromControl(this);
this.Size = new Size(
(int)(screen.WorkingArea.Width * 0.8),
(int)(screen.WorkingArea.Height * 0.8)
);
this.CenterToScreen();
// 或者使用以下代码设置为全屏但非最大化
// this.WindowState = FormWindowState.Normal;
// this.FormBorderStyle = FormBorderStyle.None;
// this.Bounds = Screen.FromControl(this).Bounds;
}
#endregion
@@ -98,6 +139,9 @@ namespace WindowsFormsApp1
originalImage = new Bitmap(imagePath);
markedImage = new Bitmap(originalImage);
pictureBox.Image = markedImage;
// 加载所有点位并标注
LoadAllPositions(name);
}
catch (Exception ex)
{
@@ -110,65 +154,157 @@ namespace WindowsFormsApp1
}
}
// 在图像上绘制标记
private void DrawMark(int x, int y)
// 加载所有点位并标注
private void LoadAllPositions(string name)
{
try
{
SQLiteHelper<t_imageposition> sQLiteHelper_position = new db.SQLiteHelper<t_imageposition>();
allPositions = sQLiteHelper_position.Query(x => x.name == name).Data;
if (allPositions != null && allPositions.Count > 0)
{
// 重新绘制图像,标注所有点位
RedrawImage();
}
}
catch (Exception ex)
{
Console.WriteLine($"加载所有点位失败:{ex.Message}");
}
}
// 重新绘制图像,包括所有标记
private void RedrawImage()
{
if (originalImage == null)
return;
// 创建新的标记图像
if (markedImage != null)
markedImage.Dispose();
markedImage = new Bitmap(originalImage);
using (Graphics g = Graphics.FromImage(markedImage))
{
if (isBlinking)
// 设置高质量绘图模式
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
// 绘制所有点位(白色实心圆和序号)
if (showAllPositions && allPositions != null)
{
// 设置高质量绘图模式
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
// 只绘制白色圆
using (Brush whiteBrush = new SolidBrush(Color.White))
for (int i = 0; i < allPositions.Count; i++)
{
g.FillEllipse(whiteBrush,
x - currentRadius,
y - currentRadius,
currentRadius * 2,
currentRadius * 2);
}
var pos = allPositions[i];
// 更新半径
if (isExpanding)
{
currentRadius += RADIUS_CHANGE_SPEED;
if (currentRadius >= MAX_RADIUS)
// 绘制白色实心圆
using (Brush whiteBrush = new SolidBrush(Color.White))
{
currentRadius = MAX_RADIUS;
isExpanding = false;
g.FillEllipse(whiteBrush,
pos.x - MIN_RADIUS,
pos.y - MIN_RADIUS,
MIN_RADIUS * 2,
MIN_RADIUS * 2);
}
}
else
{
currentRadius -= RADIUS_CHANGE_SPEED;
if (currentRadius <= MIN_RADIUS)
// 绘制白色序号
using (Font font = new Font("Arial", 16, FontStyle.Bold))
using (Brush textBrush = new SolidBrush(Color.Black))
{
currentRadius = MIN_RADIUS;
isExpanding = true;
string text = pos.position; // 使用position属性
SizeF textSize = g.MeasureString(text, font);
g.DrawString(text, font, textBrush,
pos.x - textSize.Width / 2,
pos.y - textSize.Height / 2);
}
}
}
// 绘制所有历史位置的绿色标记
foreach (var history in previousPositions)
{
using (Brush greenBrush = new SolidBrush(Color.Green))
{
g.FillEllipse(greenBrush,
history.X - MIN_RADIUS,
history.Y - MIN_RADIUS,
MIN_RADIUS * 2,
MIN_RADIUS * 2);
}
// 绘制绿色标记上的文字
using (Font font = new Font("Arial", 16, FontStyle.Bold))
using (Brush textBrush = new SolidBrush(Color.White))
{
string text = history.Position;
SizeF textSize = g.MeasureString(text, font);
g.DrawString(text, font, textBrush,
history.X - textSize.Width / 2,
history.Y - textSize.Height / 2);
}
}
}
pictureBox.Image = markedImage;
}
#endregion
#region 数据查询和更新
// 自动更新定时器事件
private void AutoUpdateTimer_Tick(object sender, EventArgs e)
{
if(Init.ScrewBegin != 1)
{
this.Close();
return;
}
// 获取当前位置变量
//string newPosition = GetCurrentPosition();
string newPosition = Init.ImageLocation.ToString();
if (newPosition != currentPosition || (string.IsNullOrEmpty(currentPosition) && !string.IsNullOrEmpty(newPosition)))
{
// 保存上一个位置
if (!string.IsNullOrEmpty(currentPosition))
{
SQLiteHelper<t_imageposition> sQLiteHelper_position = new db.SQLiteHelper<t_imageposition>();
var positions = sQLiteHelper_position.Query(x => x.name == currentName
&& x.position == currentPosition).Data;
if (positions != null && positions.Count > 0)
{
var pos = positions[0];
// 检查是否已经存在相同位置的历史记录
bool exists = false;
foreach (var history in previousPositions)
{
if (history.X == pos.x && history.Y == pos.y)
{
// 更新位置文本
history.Position = currentPosition;
exists = true;
break;
}
}
// 如果不存在,添加到历史记录
if (!exists)
{
previousPositions.Add(new PositionHistory
{
X = pos.x,
Y = pos.y,
Position = currentPosition
});
}
// 设置最近的历史位置
previousX = pos.x;
previousY = pos.y;
hasPreviousPosition = true;
}
}
currentPosition = newPosition;
// 如果名称和位置都有值,则查询坐标并标注
@@ -193,49 +329,162 @@ namespace WindowsFormsApp1
{
try
{
SQLiteHelper<t_imageposition> sQLiteHelper_position = new db.SQLiteHelper<t_imageposition>();
var positions = sQLiteHelper_position.Query(x => x.name == name
&& x.position == position).Data;
// 从已加载的点位列表中查找,避免重复查询数据库
var pos = allPositions?.FirstOrDefault(x => x.name == name && x.position == position);
if (positions != null && positions.Count > 0)
if (pos != null)
{
var pos = positions[0];
// 标记位置
if (originalImage != null)
{
isBlinking = true; // 设置为 true 后不再切换
currentRadius = MIN_RADIUS; // 重置半径
blinkTimer.Start();
// 确保闪烁定时器已启动
if (blinkTimer != null && !blinkTimer.Enabled)
blinkTimer.Start();
// 在图像上绘制标记
DrawMark(pos.x, pos.y);
}
}
else
{
// 如果在内存中没有找到,尝试从数据库查询
SQLiteHelper<t_imageposition> sQLiteHelper_position = new db.SQLiteHelper<t_imageposition>();
var positions = sQLiteHelper_position.Query(x => x.name == name && x.position == position).Data;
if (positions != null && positions.Count > 0)
{
pos = positions[0];
// 添加到内存中的列表
if (!allPositions.Any(x => x.name == name && x.position == position))
{
allPositions.Add(pos);
}
// 标记位置
if (originalImage != null)
{
isBlinking = true;
currentRadius = MIN_RADIUS;
if (blinkTimer != null && !blinkTimer.Enabled)
blinkTimer.Start();
DrawMark(pos.x, pos.y);
}
}
else
{
// 如果没有找到对应的位置,停止闪烁
isBlinking = false;
blinkTimer?.Stop();
// 仍然重绘图像以显示所有点位和之前的绿色标记
RedrawImage();
Console.WriteLine($"未找到名称为 {name} 位置为 {position} 的坐标");
}
}
}
catch (Exception ex)
{
Console.WriteLine($"查询坐标失败:{ex.Message}");
// 发生异常时也重绘图像
RedrawImage();
}
}
#endregion
#region 事件处理
// 在图像上绘制标记
private void DrawMark(int x, int y)
{
if (originalImage == null)
return;
// 先重新绘制基础图像(包含所有点位标记)
RedrawImage();
using (Graphics g = Graphics.FromImage(markedImage))
{
// 设置高质量绘图模式
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
if (isBlinking)
{
// 绘制当前位置的黄色实心圆
using (Brush brush = new SolidBrush(Color.Yellow))
{
g.FillEllipse(brush,
x - MIN_RADIUS,
y - MIN_RADIUS,
MIN_RADIUS * 2,
MIN_RADIUS * 2);
}
// 绘制白色数字标记
using (Font font = new Font("Arial", 16, FontStyle.Bold))
using (Brush textBrush = new SolidBrush(Color.Black))
{
string text = currentPosition;
SizeF textSize = g.MeasureString(text, font);
g.DrawString(text, font, textBrush,
x - textSize.Width / 2,
y - textSize.Height / 2);
}
// 绘制黄色虚线空心圆闪烁效果
using (Pen yellowPen = new Pen(Color.Yellow, 2))
{
yellowPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
g.DrawEllipse(yellowPen,
x - currentRadius,
y - currentRadius,
currentRadius * 2,
currentRadius * 2);
}
}
}
pictureBox.Image = markedImage;
}
// 闪烁定时器事件
private void BlinkTimer_Tick(object sender, EventArgs e)
{
SQLiteHelper<t_imageposition> sQLiteHelper_position = new db.SQLiteHelper<t_imageposition>();
var positions = sQLiteHelper_position.Query(x => x.name == currentName
&& x.position == currentPosition).Data;
// 从已加载的点位列表中查找当前位置
var pos = allPositions?.FirstOrDefault(x => x.name == currentName && x.position == currentPosition);
if (positions != null && positions.Count > 0)
if (pos != null)
{
var pos = positions[0];
// 直接调用DrawMark方法绘制标记
DrawMark(pos.x, pos.y);
// 更新半径
if (isExpanding)
{
currentRadius += RADIUS_CHANGE_SPEED;
if (currentRadius >= MAX_RADIUS)
{
currentRadius = MAX_RADIUS;
isExpanding = false;
}
}
else
{
currentRadius -= RADIUS_CHANGE_SPEED;
if (currentRadius <= MIN_RADIUS)
{
currentRadius = MIN_RADIUS;
isExpanding = true;
}
}
}
}
// 移除了 BtnLoadImage_Click 事件处理程序
#endregion
#region 资源释放
protected override void Dispose(bool disposing)
{
@@ -297,4 +546,4 @@ namespace WindowsFormsApp1
#endregion
}
}
}
@@ -42,6 +42,7 @@ namespace WindowsFormsApp1
else
{
MessageBox.Show("扫码枪串口未配置,请检查系统设置", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
_dbHelper = new SQLiteHelper<t_materialscan>();
_apiClient = new ApiClient();
+11 -2
View File
@@ -104,8 +104,17 @@ namespace WindowsFormsApp1
{
端子1校验.Text = "校验OK";
}));
// 写数据到 主页的barcode 数据库改,缓存改
var txt = Init.t_Keyvalues.FirstOrDefault(a => a.key == "Barcode1");
txt.value = 端子1.Text;
var code = key_sqlresult.Data.First(x => x.key == txt.key);
code.value = 端子1.Text;
sQLiteHelper_key.Update(code);
//继续调用接口
var result2 = ApiClient.CallFunctionByName("Link_Comp", PlcData, new otherdata() { JS_SN = barcode });
/*var result2 = ApiClient.CallFunctionByName("Link_Comp", PlcData, new otherdata() { JS_SN = barcode });
if (result2.Success && result2.Mesresult == mesresult.PASS)
{
this.Invoke(new Action(() =>
@@ -127,7 +136,7 @@ namespace WindowsFormsApp1
{
端子1结果.Text = "绑定NG";
}));
}
}*/
}
else
{
@@ -34,7 +34,7 @@ namespace WindowsFormsApp1
// 圆形标记相关参数
private float currentRadius = 20f;
private const float MIN_RADIUS = 20f;
private const float MIN_RADIUS = 25f;
private const float MAX_RADIUS = 50f;
private bool isExpanding = true;
private const float RADIUS_CHANGE_SPEED = 2f;
@@ -44,6 +44,24 @@ namespace WindowsFormsApp1
public SimpleImageDisplayForm()
{
InitializeComponent();
// 添加窗体加载事件
this.Load += ImageDisplayForm_Load;
}
private void ImageDisplayForm_Load(object sender, EventArgs e)
{
// 设置窗体大小为屏幕工作区的80%
Screen screen = Screen.FromControl(this);
this.Size = new Size(
(int)(screen.WorkingArea.Width * 0.8),
(int)(screen.WorkingArea.Height * 0.8)
);
this.CenterToScreen();
// 或者使用以下代码设置为全屏但非最大化
// this.WindowState = FormWindowState.Normal;
// this.FormBorderStyle = FormBorderStyle.None;
// this.Bounds = Screen.FromControl(this).Bounds;
}
#endregion
@@ -53,7 +71,7 @@ namespace WindowsFormsApp1
{
if (originalImage == null)
return;
markedImage.Dispose();
markedImage = new Bitmap(originalImage);
using (Graphics g = Graphics.FromImage(markedImage))
{
@@ -63,9 +81,9 @@ namespace WindowsFormsApp1
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
// 只绘制白色圆
using (Brush whiteBrush = new SolidBrush(Color.White))
using (var brush = new Pen(Color.Yellow))
{
g.FillEllipse(whiteBrush,
g.DrawEllipse(brush,
x - currentRadius,
y - currentRadius,
currentRadius * 2,
@@ -7,6 +7,7 @@ using SQLite;
namespace WindowsFormsApp1.mod
{
[Table("t_imageposition")]
public class t_imageposition
{
[PrimaryKey, AutoIncrement]
@@ -9,6 +9,8 @@ namespace WindowsFormsApp1.mod
[PrimaryKey, AutoIncrement]
public int id { get; set; }
public string materialid { get; set; }
public string sn { get; set; }
public bool isout { get; set; }
public DateTime? checkin1 { get; set; }
public DateTime? checkin2 { get; set; }
public DateTime? checkin3 { get; set; }
@@ -0,0 +1,20 @@
using SQLite;
using System;
namespace WindowsFormsApp1.mod
{
[Table("material_upload")]
public class t_materialupload
{
[PrimaryKey, AutoIncrement]
public int id { get; set; }
public string sn { get; set; }
public string CarrierID { get; set; }
// plc·´À¡µÄ½á¹û£¬ok/ng
public string result { get; set; }
public int imageUploaded { get; set; }
public int vedioUploaded { get; set; }
public int datacollectionUploaded { get; set; }
public string date { get; set; }
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SQLite;
namespace WindowsFormsApp1.mod
{
[Table("sn")]
public class t_sn
{
public int id { get; set; }
public string sn { get; set; }
}
}
+4
View File
@@ -76,6 +76,10 @@ namespace WindowsFormsApp1.mod.server
/// 上下料操作 上料:1;下料 2
/// </summary>
public int opindex { get; set; }
public int plcid { get; set; }
public t_materialupload material { get; set; }
}
File diff suppressed because it is too large. Load diff