From 3be258e6714c6663a80f834f59d4b4afd576ce9e Mon Sep 17 00:00:00 2001 From: gongxh Date: Fri, 27 May 2022 15:47:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CleanMachineHMI/CleanMachineHMI.csproj | 1 + .../FrmUserControl/frmIOMonitorAuto.cs | 4 +- .../FrmUserControl/frmMainDetail.Designer.cs | 120 ++++++++++-------- .../FrmUserControl/frmMainDetail.cs | 17 ++- CleanMachineHMI/Utils/PlcOperationHelper.cs | 8 +- 5 files changed, 84 insertions(+), 66 deletions(-) diff --git a/CleanMachineHMI/CleanMachineHMI.csproj b/CleanMachineHMI/CleanMachineHMI.csproj index 6a5de17..fb74715 100644 --- a/CleanMachineHMI/CleanMachineHMI.csproj +++ b/CleanMachineHMI/CleanMachineHMI.csproj @@ -27,6 +27,7 @@ + diff --git a/CleanMachineHMI/FrmUserControl/frmIOMonitorAuto.cs b/CleanMachineHMI/FrmUserControl/frmIOMonitorAuto.cs index 0a00fd8..2d2f79b 100644 --- a/CleanMachineHMI/FrmUserControl/frmIOMonitorAuto.cs +++ b/CleanMachineHMI/FrmUserControl/frmIOMonitorAuto.cs @@ -131,7 +131,7 @@ namespace CleanMachineHMI.FrmUserControl foreach (PlcItem item in tempLst) { var IO = new IOBlock(); - IO.Code = "X" + (int.Parse( item.PlcItemPriAddress)+1).ToString().PadLeft(2, '0'); + IO.Code = "X" + Convert.ToString((int.Parse(item.PlcItemPriAddress)), 8).PadLeft(2, '0'); IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode); this.flowLayoutPanel1.Controls.Add(IO); buttons.Add(item, IO); @@ -151,7 +151,7 @@ namespace CleanMachineHMI.FrmUserControl foreach (PlcItem item in tempLst) { var IO = new IOBlock(); - IO.Code = "Y" + (int.Parse(item.PlcItemPriAddress) + 1).ToString().PadLeft(2,'0'); + IO.Code = "Y" + Convert.ToString((int.Parse(item.PlcItemPriAddress) ), 8).PadLeft(2, '0'); IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode); this.flowLayoutPanel1.Controls.Add(IO); diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs b/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs index 49e72ae..a3e0dda 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs @@ -500,19 +500,14 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonGroupBox7.Panel // - this.kryptonGroupBox7.Panel.Controls.Add(this.kryptonLabel12); this.kryptonGroupBox7.Panel.Controls.Add(this.kryptonLabel11); - this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_fpalletmod); + this.kryptonGroupBox7.Panel.Controls.Add(this.circleButton1); this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_staticbar); - this.kryptonGroupBox7.Panel.Controls.Add(this.swtbtn_fullPalletMod); this.kryptonGroupBox7.Panel.Controls.Add(this.swtbtn_staticBar); this.kryptonGroupBox7.Panel.Controls.Add(this.label2); - this.kryptonGroupBox7.Panel.Controls.Add(this.kryptonLabel6); this.kryptonGroupBox7.Panel.Controls.Add(this.label1); - this.kryptonGroupBox7.Panel.Controls.Add(this.swtbtn_nozzle1); - this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_RunStatusTran); - this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_NozzleStatusTran); this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_ResetSys); + this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_RunStatusTran); this.kryptonGroupBox7.Panel.Controls.Add(this.kryptonLabel7); this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_StopTran); this.kryptonGroupBox7.Panel.Controls.Add(this.swtbtn_brush3); @@ -530,7 +525,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel12 // - this.kryptonLabel12.Location = new System.Drawing.Point(21, 302); + this.kryptonLabel12.Location = new System.Drawing.Point(4, 221); this.kryptonLabel12.Name = "kryptonLabel12"; this.kryptonLabel12.Size = new System.Drawing.Size(62, 20); this.kryptonLabel12.TabIndex = 51; @@ -539,7 +534,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel11 // - this.kryptonLabel11.Location = new System.Drawing.Point(20, 243); + this.kryptonLabel11.Location = new System.Drawing.Point(20, 306); this.kryptonLabel11.Name = "kryptonLabel11"; this.kryptonLabel11.Size = new System.Drawing.Size(49, 20); this.kryptonLabel11.TabIndex = 50; @@ -548,7 +543,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_fpalletmod // this.cbt_fpalletmod.BackColor = System.Drawing.Color.Gray; - this.cbt_fpalletmod.Location = new System.Drawing.Point(203, 300); + this.cbt_fpalletmod.Location = new System.Drawing.Point(186, 219); this.cbt_fpalletmod.Name = "cbt_fpalletmod"; this.cbt_fpalletmod.Size = new System.Drawing.Size(30, 30); this.cbt_fpalletmod.TabIndex = 49; @@ -558,7 +553,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_staticbar // this.cbt_staticbar.BackColor = System.Drawing.Color.Gray; - this.cbt_staticbar.Location = new System.Drawing.Point(203, 241); + this.cbt_staticbar.Location = new System.Drawing.Point(203, 304); this.cbt_staticbar.Name = "cbt_staticbar"; this.cbt_staticbar.Size = new System.Drawing.Size(30, 30); this.cbt_staticbar.TabIndex = 48; @@ -575,7 +570,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_fullPalletMod.L_IsOpen = false; this.swtbtn_fullPalletMod.L_Margin = 2; this.swtbtn_fullPalletMod.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_fullPalletMod.Location = new System.Drawing.Point(106, 300); + this.swtbtn_fullPalletMod.Location = new System.Drawing.Point(89, 219); this.swtbtn_fullPalletMod.Name = "swtbtn_fullPalletMod"; this.swtbtn_fullPalletMod.Size = new System.Drawing.Size(58, 25); this.swtbtn_fullPalletMod.TabIndex = 47; @@ -594,7 +589,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_staticBar.L_IsOpen = false; this.swtbtn_staticBar.L_Margin = 2; this.swtbtn_staticBar.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_staticBar.Location = new System.Drawing.Point(105, 241); + this.swtbtn_staticBar.Location = new System.Drawing.Point(105, 304); this.swtbtn_staticBar.Name = "swtbtn_staticBar"; this.swtbtn_staticBar.Size = new System.Drawing.Size(58, 25); this.swtbtn_staticBar.TabIndex = 46; @@ -607,7 +602,7 @@ namespace CleanMachineHMI.FrmUserControl this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.ForeColor = System.Drawing.Color.Black; - this.label2.Location = new System.Drawing.Point(16, 129); + this.label2.Location = new System.Drawing.Point(16, 192); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(98, 21); this.label2.TabIndex = 8; @@ -615,7 +610,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel6 // - this.kryptonLabel6.Location = new System.Drawing.Point(21, 273); + this.kryptonLabel6.Location = new System.Drawing.Point(4, 192); this.kryptonLabel6.Name = "kryptonLabel6"; this.kryptonLabel6.Size = new System.Drawing.Size(36, 20); this.kryptonLabel6.TabIndex = 44; @@ -645,7 +640,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_nozzle1.L_IsOpen = false; this.swtbtn_nozzle1.L_Margin = 2; this.swtbtn_nozzle1.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_nozzle1.Location = new System.Drawing.Point(106, 271); + this.swtbtn_nozzle1.Location = new System.Drawing.Point(89, 190); this.swtbtn_nozzle1.Name = "swtbtn_nozzle1"; this.swtbtn_nozzle1.Size = new System.Drawing.Size(58, 25); this.swtbtn_nozzle1.TabIndex = 43; @@ -665,7 +660,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_NozzleStatusTran // this.cbt_NozzleStatusTran.BackColor = System.Drawing.Color.Gray; - this.cbt_NozzleStatusTran.Location = new System.Drawing.Point(203, 272); + this.cbt_NozzleStatusTran.Location = new System.Drawing.Point(186, 191); this.cbt_NozzleStatusTran.Name = "cbt_NozzleStatusTran"; this.cbt_NozzleStatusTran.Size = new System.Drawing.Size(30, 30); this.cbt_NozzleStatusTran.TabIndex = 42; @@ -677,7 +672,7 @@ namespace CleanMachineHMI.FrmUserControl this.cbt_ResetSys.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(153)))), ((int)(((byte)(0))))); this.cbt_ResetSys.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cbt_ResetSys.ForeColor = System.Drawing.Color.White; - this.cbt_ResetSys.Location = new System.Drawing.Point(162, 41); + this.cbt_ResetSys.Location = new System.Drawing.Point(30, 107); this.cbt_ResetSys.Name = "cbt_ResetSys"; this.cbt_ResetSys.Size = new System.Drawing.Size(60, 60); this.cbt_ResetSys.TabIndex = 5; @@ -688,7 +683,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel7 // - this.kryptonLabel7.Location = new System.Drawing.Point(20, 213); + this.kryptonLabel7.Location = new System.Drawing.Point(20, 276); this.kryptonLabel7.Name = "kryptonLabel7"; this.kryptonLabel7.Size = new System.Drawing.Size(43, 20); this.kryptonLabel7.TabIndex = 41; @@ -699,7 +694,7 @@ namespace CleanMachineHMI.FrmUserControl this.cbt_StopTran.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20))))); this.cbt_StopTran.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cbt_StopTran.ForeColor = System.Drawing.Color.White; - this.cbt_StopTran.Location = new System.Drawing.Point(96, 41); + this.cbt_StopTran.Location = new System.Drawing.Point(105, 41); this.cbt_StopTran.Name = "cbt_StopTran"; this.cbt_StopTran.Size = new System.Drawing.Size(60, 60); this.cbt_StopTran.TabIndex = 5; @@ -720,7 +715,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_brush3.L_IsOpen = false; this.swtbtn_brush3.L_Margin = 2; this.swtbtn_brush3.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_brush3.Location = new System.Drawing.Point(105, 211); + this.swtbtn_brush3.Location = new System.Drawing.Point(105, 274); this.swtbtn_brush3.Name = "swtbtn_brush3"; this.swtbtn_brush3.Size = new System.Drawing.Size(58, 25); this.swtbtn_brush3.TabIndex = 40; @@ -744,7 +739,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_Brush3StatusTran // this.cbt_Brush3StatusTran.BackColor = System.Drawing.Color.Gray; - this.cbt_Brush3StatusTran.Location = new System.Drawing.Point(203, 210); + this.cbt_Brush3StatusTran.Location = new System.Drawing.Point(203, 273); this.cbt_Brush3StatusTran.Name = "cbt_Brush3StatusTran"; this.cbt_Brush3StatusTran.Size = new System.Drawing.Size(30, 30); this.cbt_Brush3StatusTran.TabIndex = 39; @@ -761,7 +756,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_brush1.L_IsOpen = false; this.swtbtn_brush1.L_Margin = 2; this.swtbtn_brush1.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_brush1.Location = new System.Drawing.Point(105, 153); + this.swtbtn_brush1.Location = new System.Drawing.Point(105, 216); this.swtbtn_brush1.Name = "swtbtn_brush1"; this.swtbtn_brush1.Size = new System.Drawing.Size(58, 25); this.swtbtn_brush1.TabIndex = 35; @@ -770,7 +765,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel8 // - this.kryptonLabel8.Location = new System.Drawing.Point(20, 184); + this.kryptonLabel8.Location = new System.Drawing.Point(20, 247); this.kryptonLabel8.Name = "kryptonLabel8"; this.kryptonLabel8.Size = new System.Drawing.Size(43, 20); this.kryptonLabel8.TabIndex = 38; @@ -779,7 +774,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_Brush1StatusTran // this.cbt_Brush1StatusTran.BackColor = System.Drawing.Color.Gray; - this.cbt_Brush1StatusTran.Location = new System.Drawing.Point(203, 150); + this.cbt_Brush1StatusTran.Location = new System.Drawing.Point(203, 213); this.cbt_Brush1StatusTran.Name = "cbt_Brush1StatusTran"; this.cbt_Brush1StatusTran.Size = new System.Drawing.Size(30, 30); this.cbt_Brush1StatusTran.TabIndex = 33; @@ -787,7 +782,7 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonLabel9 // - this.kryptonLabel9.Location = new System.Drawing.Point(20, 155); + this.kryptonLabel9.Location = new System.Drawing.Point(20, 218); this.kryptonLabel9.Name = "kryptonLabel9"; this.kryptonLabel9.Size = new System.Drawing.Size(43, 20); this.kryptonLabel9.TabIndex = 34; @@ -804,7 +799,7 @@ namespace CleanMachineHMI.FrmUserControl this.swtbtn_brush2.L_IsOpen = false; this.swtbtn_brush2.L_Margin = 2; this.swtbtn_brush2.L_OpenColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); - this.swtbtn_brush2.Location = new System.Drawing.Point(105, 182); + this.swtbtn_brush2.Location = new System.Drawing.Point(105, 245); this.swtbtn_brush2.Name = "swtbtn_brush2"; this.swtbtn_brush2.Size = new System.Drawing.Size(58, 25); this.swtbtn_brush2.TabIndex = 37; @@ -814,7 +809,7 @@ namespace CleanMachineHMI.FrmUserControl // cbt_Brush2StatusTran // this.cbt_Brush2StatusTran.BackColor = System.Drawing.Color.Gray; - this.cbt_Brush2StatusTran.Location = new System.Drawing.Point(203, 180); + this.cbt_Brush2StatusTran.Location = new System.Drawing.Point(203, 243); this.cbt_Brush2StatusTran.Name = "cbt_Brush2StatusTran"; this.cbt_Brush2StatusTran.Size = new System.Drawing.Size(30, 30); this.cbt_Brush2StatusTran.TabIndex = 36; @@ -825,15 +820,15 @@ namespace CleanMachineHMI.FrmUserControl this.circleButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20))))); this.circleButton1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.circleButton1.ForeColor = System.Drawing.Color.White; - this.circleButton1.Location = new System.Drawing.Point(37, 125); + this.circleButton1.Location = new System.Drawing.Point(171, 41); this.circleButton1.Name = "circleButton1"; this.circleButton1.Size = new System.Drawing.Size(60, 60); this.circleButton1.TabIndex = 53; this.circleButton1.Text = "Auto Stop"; this.circleButton1.UseVisualStyleBackColor = false; - this.circleButton1.Visible = false; this.circleButton1.Click += new System.EventHandler(this.circleButton1_Click); - this.circleButton1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.circleButton1_KeyUp); + this.circleButton1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.circleButton1_MouseDown_1); + this.circleButton1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.circleButton1_MouseUp); // // tableLayoutPanel2 // @@ -1934,14 +1929,19 @@ namespace CleanMachineHMI.FrmUserControl // // kryptonGroupBox4.Panel // - this.kryptonGroupBox4.Panel.Controls.Add(this.circleButton1); + this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonLabel12); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonButton8); + this.kryptonGroupBox4.Panel.Controls.Add(this.cbt_fpalletmod); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonPanel23); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonPanel39); + this.kryptonGroupBox4.Panel.Controls.Add(this.swtbtn_fullPalletMod); this.kryptonGroupBox4.Panel.Controls.Add(this.ktb_ShiftCount); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonPanel8); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonButton1); + this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonLabel6); this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonLabel16); + this.kryptonGroupBox4.Panel.Controls.Add(this.cbt_NozzleStatusTran); + this.kryptonGroupBox4.Panel.Controls.Add(this.swtbtn_nozzle1); this.kryptonGroupBox4.Size = new System.Drawing.Size(244, 264); this.kryptonGroupBox4.TabIndex = 2; this.kryptonGroupBox4.Values.Heading = ""; @@ -2366,12 +2366,13 @@ namespace CleanMachineHMI.FrmUserControl // kryptonButton9 // this.kryptonButton9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kryptonButton9.AutoSize = true; this.kryptonButton9.Location = new System.Drawing.Point(831, 6); this.kryptonButton9.Name = "kryptonButton9"; this.kryptonButton9.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.kryptonButton9.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.kryptonButton9.Size = new System.Drawing.Size(80, 47); + this.kryptonButton9.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.kryptonButton9.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonButton9.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.kryptonButton9.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.kryptonButton9.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2405,12 +2406,13 @@ namespace CleanMachineHMI.FrmUserControl // btnShiftCount // this.btnShiftCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnShiftCount.AutoSize = true; - this.btnShiftCount.Location = new System.Drawing.Point(744, 6); + this.btnShiftCount.Location = new System.Drawing.Point(741, 6); this.btnShiftCount.Name = "btnShiftCount"; this.btnShiftCount.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnShiftCount.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnShiftCount.Size = new System.Drawing.Size(80, 47); + this.btnShiftCount.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnShiftCount.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnShiftCount.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnShiftCount.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnShiftCount.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2444,12 +2446,13 @@ namespace CleanMachineHMI.FrmUserControl // btnParamater // this.btnParamater.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnParamater.AutoSize = true; - this.btnParamater.Location = new System.Drawing.Point(130, 6); + this.btnParamater.Location = new System.Drawing.Point(133, 6); this.btnParamater.Name = "btnParamater"; this.btnParamater.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnParamater.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; - this.btnParamater.Size = new System.Drawing.Size(124, 47); + this.btnParamater.Size = new System.Drawing.Size(87, 47); + this.btnParamater.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnParamater.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnParamater.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnParamater.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnParamater.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2483,12 +2486,13 @@ namespace CleanMachineHMI.FrmUserControl // btnLogin // this.btnLogin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnLogin.AutoSize = true; - this.btnLogin.Location = new System.Drawing.Point(918, 6); + this.btnLogin.Location = new System.Drawing.Point(921, 6); this.btnLogin.Name = "btnLogin"; this.btnLogin.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnLogin.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnLogin.Size = new System.Drawing.Size(64, 47); + this.btnLogin.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnLogin.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnLogin.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLogin.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnLogin.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2522,12 +2526,13 @@ namespace CleanMachineHMI.FrmUserControl // btnBase // this.btnBase.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnBase.AutoSize = true; this.btnBase.Location = new System.Drawing.Point(7, 6); this.btnBase.Name = "btnBase"; this.btnBase.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnBase.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnBase.Size = new System.Drawing.Size(116, 47); + this.btnBase.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnBase.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnBase.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnBase.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnBase.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2561,12 +2566,13 @@ namespace CleanMachineHMI.FrmUserControl // btnWarningLog // this.btnWarningLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnWarningLog.AutoSize = true; - this.btnWarningLog.Location = new System.Drawing.Point(509, 6); + this.btnWarningLog.Location = new System.Drawing.Point(487, 6); this.btnWarningLog.Name = "btnWarningLog"; this.btnWarningLog.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnWarningLog.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnWarningLog.Size = new System.Drawing.Size(68, 47); + this.btnWarningLog.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnWarningLog.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnWarningLog.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnWarningLog.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnWarningLog.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2600,12 +2606,13 @@ namespace CleanMachineHMI.FrmUserControl // btnPrinter // this.btnPrinter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnPrinter.AutoSize = true; - this.btnPrinter.Location = new System.Drawing.Point(652, 6); + this.btnPrinter.Location = new System.Drawing.Point(636, 6); this.btnPrinter.Name = "btnPrinter"; this.btnPrinter.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPrinter.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; - this.btnPrinter.Size = new System.Drawing.Size(85, 47); + this.btnPrinter.Size = new System.Drawing.Size(95, 47); + this.btnPrinter.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnPrinter.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnPrinter.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnPrinter.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPrinter.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2639,12 +2646,13 @@ namespace CleanMachineHMI.FrmUserControl // btnIR // this.btnIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnIR.AutoSize = true; - this.btnIR.Location = new System.Drawing.Point(584, 6); + this.btnIR.Location = new System.Drawing.Point(565, 6); this.btnIR.Name = "btnIR"; this.btnIR.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIR.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnIR.Size = new System.Drawing.Size(61, 47); + this.btnIR.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnIR.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnIR.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnIR.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIR.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2678,12 +2686,13 @@ namespace CleanMachineHMI.FrmUserControl // btnPLCConfig // this.btnPLCConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnPLCConfig.AutoSize = true; - this.btnPLCConfig.Location = new System.Drawing.Point(261, 6); + this.btnPLCConfig.Location = new System.Drawing.Point(230, 6); this.btnPLCConfig.Name = "btnPLCConfig"; this.btnPLCConfig.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPLCConfig.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnPLCConfig.Size = new System.Drawing.Size(96, 47); + this.btnPLCConfig.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnPLCConfig.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnPLCConfig.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnPLCConfig.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPLCConfig.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2717,12 +2726,13 @@ namespace CleanMachineHMI.FrmUserControl // btnIO // this.btnIO.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnIO.AutoSize = true; - this.btnIO.Location = new System.Drawing.Point(442, 6); + this.btnIO.Location = new System.Drawing.Point(417, 6); this.btnIO.Name = "btnIO"; this.btnIO.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIO.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnIO.Size = new System.Drawing.Size(60, 47); + this.btnIO.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnIO.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnIO.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnIO.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIO.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2756,12 +2766,13 @@ namespace CleanMachineHMI.FrmUserControl // btnManual // this.btnManual.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnManual.AutoSize = true; - this.btnManual.Location = new System.Drawing.Point(364, 6); + this.btnManual.Location = new System.Drawing.Point(336, 6); this.btnManual.Name = "btnManual"; this.btnManual.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnManual.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnManual.Size = new System.Drawing.Size(71, 47); + this.btnManual.StateCommon.Content.LongText.MultiLine = Krypton.Toolkit.InheritBool.True; + this.btnManual.StateCommon.Content.LongText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.btnManual.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnManual.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnManual.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2890,7 +2901,6 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonPanel7.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panMenu)).EndInit(); this.panMenu.ResumeLayout(false); - this.panMenu.PerformLayout(); this.ResumeLayout(false); } diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetail.cs b/CleanMachineHMI/FrmUserControl/frmMainDetail.cs index c2865e6..828be19 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetail.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetail.cs @@ -2835,14 +2835,21 @@ namespace CleanMachineHMI.FrmUserControl frmMainNew.SwitchFrmMenu(EnumFormType.OperatorReport, false); } - private void circleButton1_KeyUp(object sender, KeyEventArgs e) - { - _device.NextStop = true; - } - private void circleButton1_Click(object sender, EventArgs e) { } + + + + private void circleButton1_MouseDown_1(object sender, MouseEventArgs e) + { + _device.NextStop = true; + } + + private void circleButton1_MouseUp(object sender, MouseEventArgs e) + { + _device.NextStop = false; + } } } diff --git a/CleanMachineHMI/Utils/PlcOperationHelper.cs b/CleanMachineHMI/Utils/PlcOperationHelper.cs index a417f02..dd40947 100644 --- a/CleanMachineHMI/Utils/PlcOperationHelper.cs +++ b/CleanMachineHMI/Utils/PlcOperationHelper.cs @@ -2,12 +2,12 @@ #if DEBUG -#define USE_LOCAL_TCP_DEBUG +//#define USE_LOCAL_TCP_DEBUG #endif //启用心跳检查 //#if RELEASE -//#define UseHeartbeat +#define UseHeartbeat //#endif using CleanMachine.Model; using CleanMachine.Model.BAS; @@ -251,7 +251,7 @@ namespace CleanMachineHMI } #if USE_LOCAL_TCP_DEBUG - port.Connect("10.0.0.95", 5002); + port.Connect("10.20.88.95", 5002); this._isConn = true; return true; #else @@ -1322,7 +1322,7 @@ namespace CleanMachineHMI #if UseHeartbeat - if (DateTime.Now > HeartbeatTime.AddSeconds(5))//心跳超时 + if (DateTime.Now > HeartbeatTime.AddSeconds(10))//心跳超时 { IsConn = false; //报警处理。