diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs index dfaf896..baba701 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs @@ -14,6 +14,11 @@ using static Mesnac.Action.ChemicalWeighing.AutoControl.AutoLogHelper; using static Mesnac.Action.ChemicalWeighing.AutoControl.PlcAutoWriteHelper; using Mesnac.Controls.Default; using Mesnac.Action.ChemicalWeighing.Report; +using System.Threading; +using DataBlockHelper; +using System.Diagnostics; +using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; +using Mesnac.Action.ChemicalWeighing.InterfaceDocking; namespace Mesnac.Action.ChemicalWeighing.AutoControl { @@ -406,6 +411,72 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl } #endregion + + #region 清报警 + + if (ButtonE.EliAlarms == runtime.Sender) + { + PlcConnect.Instance.Write("DB2107.10.7", true); + Thread.Sleep(2000); + PlcConnect.Instance.Write("DB2107.10.7", false); + } + + #endregion + + #region 下传送料请求 + + if (ButtonE.DownloadRequest == runtime.Sender) + { + bool mixok1 = PlcConnect.Instance.ReadBool("DB3000.0.0").Content; + Time(1, mixok1 ? 1 : 0); + bool mixok2 = PlcConnect.Instance.ReadBool("DB3000.0.1").Content; + Time(2, mixok2 ? 1 : 0); + bool mixok3 = PlcConnect.Instance.ReadBool("DB3000.0.2").Content; + Time(3, mixok3 ? 1 : 0); + bool mixok4 = PlcConnect.Instance.ReadBool("DB3000.0.3").Content; + Time(4, mixok4 ? 1 : 0); + bool mixok5 = PlcConnect.Instance.ReadBool("DB3000.0.4").Content; + Time(5, mixok5 ? 1 : 0); + bool mixok6 = PlcConnect.Instance.ReadBool("DB3000.0.5").Content; + Time(6, mixok6 ? 1 : 0); + bool mixok7 = PlcConnect.Instance.ReadBool("DB3000.0.6").Content; + Trace.WriteLine("7号信号:" + mixok7); + Time(7, mixok7 ? 1 : 0); + bool mixok8 = PlcConnect.Instance.ReadBool("DB3000.0.7").Content; + Trace.WriteLine("8号信号:" + mixok8); + Time(8, mixok8 ? 1 : 0); + } + + #endregion + + } + + #region 下发接料请求 + + /// + /// 下发接料请求 + /// + /// + /// + private void Time(int deviceNo, int statu) + { + TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity() + { + reqCode = System.Guid.NewGuid().ToString(), + reqTime = DateTime.Now, + deviceNo = deviceNo.ToString(), + state = statu.ToString(), + }; + //即使网络不同 也不会影响上位机的使用 + ThreadPool.QueueUserWorkItem(delegate + { + HttpResponse httpResponse = new HttpResponse(); + string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); + MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest); + }); } + + #endregion + } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/Entity/GelerWeterControlsEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/Entity/GelerWeterControlsEntity.cs index ceaccdc..6bc7e4d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/Entity/GelerWeterControlsEntity.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/Entity/GelerWeterControlsEntity.cs @@ -85,6 +85,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.Entity public Button CAOnOff { get; set; } public Button HBOnOff { get; set; } public Button CBOnOff { get; set; } + public Button EliAlarms { get; set; } + public Button DownloadRequest { get; set; } } public class MCTextBoxEntity diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs index 7cebcd6..75ee7c7 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs @@ -29,8 +29,6 @@ namespace Mesnac.Action.ChemicalWeighing.Report MCButton ManualControl; MCButton Refresh; MCButton SelectByText; - MCButton EliAlarms; - MCButton DownloadRequest; //HslSwitch HslSwitch1; //HslSwitch HslSwitch2; @@ -62,8 +60,6 @@ namespace Mesnac.Action.ChemicalWeighing.Report ManualControl = control.FirstOrDefault(x => x != null && x.Name == "ManualControl") as MCButton; Refresh = control.FirstOrDefault(x => x != null && x.Name == "Refresh") as MCButton; SelectByText = control.FirstOrDefault(x => x != null && x.Name == "SelectByText") as MCButton; - EliAlarms = control.FirstOrDefault(x => x != null && x.Name == "EliAlarms") as MCButton; - DownloadRequest = control.FirstOrDefault(x => x != null && x.Name == "DownloadRequest") as MCButton; StartDate = control.FirstOrDefault(x => x != null && x.Name == "StartDate") as MCDateTimePicker; EndDate = control.FirstOrDefault(x => x != null && x.Name == "EndDate") as MCDateTimePicker; LogForm = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ManualLogGridView1").FirstOrDefault(); @@ -110,8 +106,6 @@ namespace Mesnac.Action.ChemicalWeighing.Report ManualControl.Click += ManualControlSelect; Refresh.Click += RefreshAction; SelectByText.Click += SelectByTextAction; - EliAlarms.Click += EliAlarmsClick; - DownloadRequest.Click += RequestDownloadClick; } /// @@ -171,9 +165,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report /// private void EliAlarmsClick(object sender, EventArgs e) { - PlcConnect.Instance.Write("DB2107.10.7", true); - Thread.Sleep(2000); - PlcConnect.Instance.Write("DB2107.10.7", false); + } /// diff --git a/Main/MCEdit/Data/MCProject/nodeForm/AutoControlC.xml b/Main/MCEdit/Data/MCProject/nodeForm/AutoControlC.xml index 7ccbdba..5714949 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/AutoControlC.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/AutoControlC.xml @@ -1,5 +1,55 @@ + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAKAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIERCRTgxOTNENDE2MDRBRDVCOTRBRTNDMkQzNDc1MUQyBgYAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2BgcAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2Cw== + + DownloadRequest + + False + + + + Query + True + True + False + + + Red + DarkGray + 下发送料请求 + 宋体, 12pt + 1364, 509 + DownloadRequest + 168, 50 + 70 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAGAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIERCRTgxOTNENDE2MDRBRDVCOTRBRTNDMkQzNDc1MUQyBgYAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2BgcAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2Cw== + + EliAlarms + + False + + + + Query + True + True + False + + + Red + DarkGray + 消除报警 + 宋体, 12pt + 1364, 453 + EliAlarms + 168, 50 + 69 + @@ -2946,7 +2996,7 @@ True True - 1474, 612 + 1471, 624 RepairState 17, 12 @@ -2965,7 +3015,7 @@ True True 维修状态: - 1409, 612 + 1408, 624 MCLabel52 65, 12 @@ -2989,7 +3039,7 @@ DarkGray 维修模式 宋体, 12pt - 1364, 546 + 1364, 565 RepairMode 168, 49 54 @@ -3182,7 +3232,7 @@ DarkGray 湿混机糊化机下传 宋体, 12pt - 1364, 441 + 1364, 397 Download 168, 50 8 diff --git a/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml b/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml index 7292eb0..adf0591 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml @@ -1,95 +1,5 @@ - - - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAIAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDhBNkE3NzM4OTg2NDRFQjlBQ0FGQkRDOEZENjZERjNDBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw== - - DownloadRequest - - False - - - - Query - True - True - False - - - Red - DarkGray - 下发送料请求 - 宋体, 12pt - 63, 409 - DownloadRequest - 148, 44 - 49 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAACAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDhBNkE3NzM4OTg2NDRFQjlBQ0FGQkRDOEZENjZERjNDBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw== - - EliAlarms - - False - - - - Query - True - True - False - - - Red - DarkGray - 消除报警 - 宋体, 12pt - 63, 350 - EliAlarms - 148, 44 - 48 - - - 142, 476 - HslSwitch2 - 73, 79 - - - 142, 731 - HslSwitch8 - 73, 79 - - - 51, 731 - HslSwitch7 - 73, 79 - - - 141, 646 - HslSwitch6 - 73, 79 - - - 51, 646 - HslSwitch5 - 73, 79 - - - 141, 561 - HslSwitch4 - 73, 79 - - - 51, 561 - HslSwitch3 - 73, 79 - - - 51, 476 - HslSwitch1 - 73, 79 - False