From a675ce81006b53da31117841c1bf0ba783379d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Fri, 28 Jun 2024 10:19:54 +0800 Subject: [PATCH] 222 --- .../Dan/Class1.cs | 149 +++++++++++++++++- .../Su/SuSongInit.cs | 5 +- .../MCProject/nodeForm/FormQuRenAnNue.xml | 72 +++++++++ Main/MCEdit/MCEdit.csproj | 1 + Main/MCRun/Data/SysConfig/MenuConfig.dat | Bin 10156 -> 10563 bytes 5 files changed, 225 insertions(+), 2 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Dan/Class1.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Dan/Class1.cs index c6c3585..095bc8e 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Dan/Class1.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Dan/Class1.cs @@ -1,12 +1,19 @@ -using Mesnac.Action.Base; +using DataBlockHelper; +using DataBlockHelper.DBHelpers; + +using Mesnac.Action.Base; using Mesnac.Controls.ChemicalWeighing; +using Mesnac.Controls.Default; + using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; + using System.Threading.Tasks; +using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.Dan { @@ -14,6 +21,10 @@ namespace Mesnac.Action.ChemicalWeighing.Dan { Que que; + public Timer timer; + MCButton BtnA; + MCButton BtnB; + MCButton BtnC; public void Run(RuntimeParameter runtime) { RunIni(runtime); @@ -29,6 +40,142 @@ namespace Mesnac.Action.ChemicalWeighing.Dan var pro = controller.FirstOrDefault(x => x.Name == name) as HslLanternSimple; sourceProperty.SetValue(que, pro); } + + BtnA = controller.FirstOrDefault(x => x.Name == "BtnA") as MCButton; + BtnB = controller.FirstOrDefault(x => x.Name == "BtnB") as MCButton; + BtnC = controller.FirstOrDefault(x => x.Name == "BtnC") as MCButton; + + +// M20.4 A线确认 +//M20.5 B线确认 +//M20.6 C线确认 + + BtnA.Click += (s, e) => + { + var a= PlcConnect.Instance.ReadBool("M20.4").Content; + if (a) + { + MessageBox.Show("A线已经确认"); + } + else + { + PlcConnect.Instance.Write("M20.4",true); + MessageBox.Show("A线确认成功"); + } + }; + + BtnB.Click += (s, e) => + { + var b = PlcConnect.Instance.ReadBool("M20.5").Content; + if (b) + { + MessageBox.Show("B线已经确认"); + } + else + { + PlcConnect.Instance.Write("M20.5", true); + MessageBox.Show("B线确认成功"); + } + }; + + BtnC.Click += (s, e) => + { + var c = PlcConnect.Instance.ReadBool("M20.6").Content; + if (c) + { + MessageBox.Show("C线已经确认"); + } + else + { + PlcConnect.Instance.Write("M20.6", true); + MessageBox.Show("C线确认成功"); + } + }; + + + timer = new Timer(); + timer.Interval = 1000; + timer.Enabled = true; + timer.Tick += new EventHandler(StateRefresh);//添加事件 + } + + private void StateRefresh(object sender, EventArgs e) + { + if (GetAllControls().Count == 0) + { + timer.Stop(); + timer.Dispose(); + } + + + Db92DengHelp dB92 = new Db92DengHelp(); + var a = dB92.DegA; + SetValue(que.HslAA,a.A); + SetValue(que.HslAB, a.B); + SetValue(que.HslAC, a.C); + SetValue(que.HslAD, a.D); + SetValue(que.HslAE, a.E); + SetValue(que.HslAF, a.F); + SetValue(que.HslAG, a.G); + SetValue(que.HslAH, a.H); + SetValue(que.HslAI, a.I); + SetValue(que.HslAJ, a.J); + SetValue(que.HslAK, a.K); + SetValue(que.HslAL, a.L); + SetValue(que.HslAM, a.M); + SetValue(que.HslAN, a.N); + SetValue(que.HslAO, a.O); + a = dB92.DegB; + + SetValue(que.HslBA, a.A); + SetValue(que.HslBB, a.B); + SetValue(que.HslBC, a.C); + SetValue(que.HslBD, a.D); + SetValue(que.HslBE, a.E); + SetValue(que.HslBF, a.F); + SetValue(que.HslBG, a.G); + SetValue(que.HslBH, a.H); + SetValue(que.HslBI, a.I); + SetValue(que.HslBJ, a.J); + SetValue(que.HslBK, a.K); + SetValue(que.HslBL, a.L); + SetValue(que.HslBM, a.M); + SetValue(que.HslBN, a.N); + SetValue(que.HslBO, a.O); + + + a = dB92.DegC; + + SetValue(que.HslCA, a.A); + SetValue(que.HslCB, a.B); + SetValue(que.HslCC, a.C); + SetValue(que.HslCD, a.D); + SetValue(que.HslCE, a.E); + SetValue(que.HslCF, a.F); + SetValue(que.HslCG, a.G); + SetValue(que.HslCH, a.H); + SetValue(que.HslCI, a.I); + SetValue(que.HslCJ, a.J); + SetValue(que.HslCK, a.K); + SetValue(que.HslCL, a.L); + SetValue(que.HslCM, a.M); + SetValue(que.HslCN, a.N); + SetValue(que.HslCO, a.O); + + + + } + + public void SetValue(HslLanternSimple simple,bool boolDeg) + { + if (boolDeg) + { + simple.LanternBackground=System.Drawing.Color.Green; + } + else + { + simple.LanternBackground = System.Drawing.Color.Gray; + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Su/SuSongInit.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Su/SuSongInit.cs index f551519..d560774 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Su/SuSongInit.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Su/SuSongInit.cs @@ -92,6 +92,9 @@ namespace Mesnac.Action.ChemicalWeighing.Su }; private void Sel() { + var ssss= DateTime.Now.ToString("hh:mm:ss"); + endTime.MCValue=ssss; + var a = Convert.ToDateTime(GetA()); var b = Convert.ToDateTime(GetB()); @@ -173,7 +176,7 @@ namespace Mesnac.Action.ChemicalWeighing.Su private string GetB() { - return Convert.ToDateTime(endDate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endTime.MCValue).ToShortTimeString(); + return Convert.ToDateTime(endDate.MCValue).AddHours(0).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endTime.MCValue).ToShortTimeString(); } } } diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FormQuRenAnNue.xml b/Main/MCEdit/Data/MCProject/nodeForm/FormQuRenAnNue.xml index facc796..7ed5053 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/FormQuRenAnNue.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/FormQuRenAnNue.xml @@ -1,5 +1,77 @@ + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL + + + + False + + + + None + True + True + False + + + Red + DarkGray + C线确认 + 624, 341 + BtnC + 196, 55 + 65 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL + + + + False + + + + None + True + True + False + + + Red + DarkGray + B线确认 + 360, 341 + BtnB + 207, 55 + 64 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL + + + + False + + + + None + True + True + False + + + Red + DarkGray + A线确认 + 81, 341 + BtnA + 208, 55 + 63 + 1332, 191 HslCO diff --git a/Main/MCEdit/MCEdit.csproj b/Main/MCEdit/MCEdit.csproj index 02ab42c..7b40c11 100644 --- a/Main/MCEdit/MCEdit.csproj +++ b/Main/MCEdit/MCEdit.csproj @@ -416,6 +416,7 @@ + PreserveNewest diff --git a/Main/MCRun/Data/SysConfig/MenuConfig.dat b/Main/MCRun/Data/SysConfig/MenuConfig.dat index 259713f84996915bc1d560e7baf92e1900a460e1..f00ba4719cfce2ef9897faa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